Personal Brain MCP
Connects to OpenAI’s Codex and ChatGPT agent environments, enabling project-scoped instruction retrieval, task preparation and review, and Fusion analysis of project styles through the selected agent provider.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Personal Brain
Your working preferences, applied consistently across AI tools.
Personal Brain stores how you want work done: communication preferences, quality expectations, artifact formats and review criteria. External skills provide task procedures. Manage preferences locally and retrieve them through Claude Code, Codex CLI, OpenCode, ChatGPT (read-only) or Claude Desktop.
Task resolution makes applicability, conflicts and provenance visible. It does not guarantee that a host model follows instructions. See the preference contract for precedence, conditional guidance and safe catalog upgrades.
How it works
Choose shared styles, adapt them privately to your repository, and let your agent retrieve the instructions needed for each task. A learning loop — learn, feedback, consent, reuse — brings reusable lessons back to the shared library, and nothing changes without your consent.
flowchart TD
Library["Global style library"] -->|Select starting styles|Project["Project styles and required dependencies"]
Repo["Existing repository"] -->|Read source evidence|Personalize["Agent personalizes selected styles"]
Project --> Personalize
Personalize -->|Save private changes|Project
Project -->|Project-scoped discovery|MCP["Personal Brain MCP"]
MCP -->|Load task instructions on demand|Agent["Claude Code, Codex or OpenCode"]
Skills["Installed external skills"] -->|Read required procedures|Agent
Agent --> Work["Develop and verify deliverables"]
Work --> Review["Review against prepared instructions"]
Review -->|Record evidence and gaps|Trace["Local reviews and activity traces"]
Agent -->|Learn: corrections, remember and forget|Proposals
Project -->|Learn: compare selected projects|Analysis["Project analysis with Codex or Claude"]
Analysis --> Proposals["Feedback: proposed style changes on the Learning page"]
Proposals -->|Consent: you apply or dismiss|Library
Library -->|Reuse: agents load approved versions|MCP
classDef shared fill:#fff1e6,stroke:#a9431e,color:#292524;
classDef project fill:#eef3e5,stroke:#526b2d,color:#292524;
classDef agent fill:#eaf2f8,stroke:#36637d,color:#292524;
class Library,Proposals shared;
class Project,Repo,Trace project;
class Personalize,MCP,Agent,Skills,Work,Review,Analysis agent;Legend: orange = shared styles and proposals; green = project context and records; blue = agent workflow. Arrows show information flow or an explicit action. Styles and review evidence are stored locally in SQLite. Learning from projects sends selected instructions to the chosen agent provider; applying a proposal updates shared styles without overwriting private copies. Recorded reviews do not prove that an agent followed every instruction.
Related MCP server: Claude PM MCP
Export and import library items
In Library → Table, check individual items or choose Select visible items, then Export selected. Selection persists across pages and categories until cleared. The JSON download includes required and conditional linked dependencies so links can be restored on another installation.
Choose Import library, open an exported JSON file, inspect the preview and select the items to import. New linked dependencies are included automatically. Existing keys are kept unchanged; incompatible types, capabilities or statuses are reported as conflicts. Imports are atomic and reject stale previews. Shared library records and capability metadata transfer; project-private records, assignments and revision history do not. Imported MCP tools remain disabled. Files are limited to 300 records and under 4.9 MB.
Install
Requires Node.js 22.13+; Node 24 LTS is recommended. This is a beta package; the commands below become available after publication.
npm install -g personal-brain-style@beta
personal-brain setupOpen http://127.0.0.1:4177. Setup starts the local workspace; create a project, select styles and link its repository in the UI. It does not change agent configuration automatically. Keep the process running while using the browser UI.
For a temporary preview: npx personal-brain-style@beta setup. A global installation is recommended for daily use; agents connected from an npx copy start through npx, which is slower per hook call.
Fresh-install global styles
The first start with a new data directory installs the bundled release catalog: 52 records (51 styles and one review checklist) in nine capabilities: Foundations; Quality & review; Product & analysis; Architecture; Drawing; UI/UX design; Engineering standards; Delivery & operations; Writing documents. This works with personal-brain setup, personal-brain mcp and personal-brain seed. Dependencies receive local IDs. The full list is in Style catalog.
All nine capabilities are combinable: a project may select several styles from one capability. Switch a capability to Pick one (styles are alternatives, such as two palettes) under Capabilities → Rename, or choose Combine styles / Pick one when adding it. Pick one is refused while any project selects two styles in that capability. A style may require up to 12 others, without cycles; required styles load transitively. Format styles (Draw.io, Mermaid) are selected per project, never required.
Writing documents holds Document writing plus 11 document templates (PRD, Roadmap, BRD, ADR, HLD, LLD, API specification, Database design, Test plan and test cases, Integration specification, Runbook). A style that produces a document requires its template; the requirement applies only when that document is in scope. Styles name skills by their plain installed name with a "(when …)" condition. Nothing requires installing new skills, and a missing skill never blocks work.
Existing libraries and edits are preserved. Restarting does not reset styles or add deleted records. The release catalog contains no projects, private styles, conversations, audit history or tool credentials. It is a release snapshot, not synchronization between computers. Maintainers update src/styles/global-style-catalog.ts from reviewed global records before releasing changes.
Create a project
Open Projects → New Project. The wizard guides you through:
Project & folder: enter a name, then use Browse folders to select an existing repository on the computer running Personal Brain, or paste its absolute path. The standard operating-system folder dialog opens on the server computer; no files are uploaded. Linux requires Zenity and a graphical session. If a dialog cannot open, paste the path instead. Already-linked folders are rejected without changing their links.
Discover & personalize with AI: optionally ask an installed, signed-in Codex or Claude CLI to recommend styles and draft project-specific guidelines. This sends bounded repository evidence and style guidelines to the chosen provider. Review the reasons and proposed guidelines on each card, then choose Use suggestion. Adaptations preserve the base guidelines and are saved as project-only overrides; global styles stay unchanged. You can cancel, retry or continue manually.
Select styles: search immediately by name, capability or keyword. In a combinable capability you can select several styles; in a Pick one capability, one. Selected styles remain visible; customization drafts survive search and Back navigation.
Review: check the folder and selections, then create the project and repository link. Required dependencies are validated before saving.
AI discovery uses repository instructions, README and build manifests, not an exhaustive code review. Existing projects use the same workflow through Repository setup → Discover & personalize with AI, then save their reviewed selections. Closing or reloading an unfinished wizard discards its unsaved draft after the browser's leave warning.
Connect your agent
personal-brain connect claude # hooks + MCP server, via the claude CLI
personal-brain connect codex # hooks + MCP server, via the codex CLI
personal-brain connect opencode # one plugin: MCP server + context
personal-brain connect all # all threeconnect installs the hooks (or the OpenCode plugin) and registers the MCP server with the agent's own CLI; disconnect removes both. Without a global install use npx --yes personal-brain-style@beta connect …: agents are then started through npx pinned to that version, so clearing the npx cache does not break them. Agent setup always shows personal-brain …; when that command is not installed it shows the install command and, under Other ways to run it, the npx form and (from a source checkout) the absolute command. If an agent CLI is missing, connect prints the registration command to run yourself.
Restart your agent and approve hooks where required (Codex: /hooks). The UI provides repository linking and project personalization instructions. External skills are references; they must be installed separately.
Once hooks are active, Brain preference edits do not require restarting the agent. Each submitted message checks a per-session fingerprint of the current effective instructions, including project overrides and dependencies. Changes trigger a reload notice even for “continue” or “ok”; unchanged sessions receive no extra refresh notice. The notice tells the agent to rediscover the ongoing task and reload current instructions before continuing. Hosts without a session ID receive that reminder on every prompt. Updates take effect at the next prompt, not midway through an answer; the agent still has to follow the reload instructions. This applies to hooks running this version, not an older pinned installation.
From a source checkout, bash scripts/activate-personal-brain.sh --apply or --repair installs Claude/Codex hooks and the OpenCode plugin. With no arguments it previews all three; --status reports their installation state. --remove removes the hooks and OpenCode plugin but preserves Claude/Codex MCP registrations. Restart OpenCode after installing or removing its plugin. For just one agent, use personal-brain connect opencode (or codex / claude).
hooks install|remove|status claude|codex|opencode|both|all still manages only the hooks or plugin; personal-brain doctor prints the MCP registration commands. OpenCode uses one managed plugin file, ~/.config/opencode/plugins/personal-brain.js; the generated plugin supports the V2 setup API and retains the V1 server entry point (V1 1.18.29+). Plugin loading and MCP connection were verified with OpenCode 2.2.5; model-driven behaviour and V1 runtime remain unverified. The Agent setup card status means the hook or plugin file is installed, not that the agent loaded it.
For ChatGPT, open Agent setup → ChatGPT and select a project. See ChatGPT connection. OpenAI tunnel access and workspace authorization are required. The helper currently requires Bash.
Claude Desktop: local installation
From this repository, use Linux/macOS Bash or Windows Git Bash with native Windows Node.js:
bash scripts/activate-personal-brain.sh --desktop
bash scripts/activate-personal-brain.sh --repair --desktop
bash scripts/activate-personal-brain.sh --status --desktopThe first command previews the configuration. Repair creates or refreshes this installation's Desktop MCP entry, backs up existing configuration, and preserves other servers. Fully quit and reopen Claude Desktop afterward. It launches its own MCP process; npm start remains the separate browser UI server.
Without Bash, including Windows PowerShell, use the same installer through npm:
npm run cli -- desktop repair
npm run cli -- desktop status
npm run cli -- desktop removeOptionally append --project YOUR_PROJECT_ID to set a default project, or --config "ABSOLUTE_CONFIG_PATH" to use the file shown by Claude Desktop's Edit Config. Defaults are %APPDATA%/Claude/claude_desktop_config.json on Windows, $XDG_CONFIG_HOME/Claude/claude_desktop_config.json (or ~/.config/Claude/) on Linux, and ~/Library/Application Support/Claude/claude_desktop_config.json on macOS. Alternate Windows/MSIX or Linux installations may require --config. Use native Windows Node for Windows Desktop; running inside WSL targets Linux paths and is not a Windows Desktop installation.
The --desktop option does not install Claude Code/Codex hooks. Existing activation commands without it retain their CLI-agent behavior. Configuration success is not proof of a live Desktop connection; check the server status in Claude Desktop after restarting.
Using the UI
The sidebar groups pages into Workspace (Overview, Projects, Library, Learning), Setup (Agent setup, Capabilities) and Diagnostics (Trace Explorer, Skill discovery, Style discovery, Startup index). Diagnostics is collapsed and opens when one of its pages is active. The footer shows the version and UI build time.
The Library type Templates holds reusable document outlines, code scaffolds and prompt starters. Each row has a Copy action; agents find templates through MCP discovery. In data and the API the record kind remains example.
Trace Explorer, under Diagnostics, updates live every 5 seconds. See Trace Explorer.
Learning loop and project instructions
Learning runs on its own in one loop: Learn → Feedback → Consent → Reuse. Agents relay corrections and your explicit remember/forget requests as they work, and — if you turn it on when the Learning page first asks (it is off by default) — whenever a project's customized styles change, Personal Brain asks Codex or Claude to compare them and propose shared-style updates (no agent call when nothing changed). The Learning page shows what it is doing and lists proposed changes; your only step is to apply or dismiss each one. Applying creates a new style version that agents reuse on their next task, and History can restore. Proposals from your projects re-check that their sources and the shared style are unchanged, and never overwrite project-private copies.
Agents can use brain_prepare to load a version-bound task instruction set, then brain_review to check the same set before completion. See Learning and instruction workflow for research decisions, examples and verification limits.
Data and upgrades
Data stays in ~/.personal-brain-style by default; PB_HOME selects another directory. The package contains no user database, credentials or installed third-party skill files. A new data directory receives the release catalog; review styles before selecting them for a project.
personal-brain backup /absolute/path/brain-backup.sqlite
npm install -g personal-brain-style@beta
personal-brain doctorStop the running server before upgrading. Restart afterward. Run personal-brain connect … again if the installation path or npx version changes. Keep backups before upgrades; do not run an older version against a migrated database.
To uninstall, run personal-brain disconnect all, then npm uninstall -g personal-brain-style. Your database is preserved. Removing the data folder is a separate, destructive action.
Development
Source is grouped by responsibility, with one stable CLI entry point:
src/
cli.ts CLI entry point for local and packaged execution
core/ Models, validation, ranking metadata and SQLite storage
projects/ Project scope, repository evidence and skill discovery
instructions/ Task preparation, compliance, review and learning from projects
agents/ MCP transport, agent hooks, OpenCode plugin, connect launcher and tool bridge
server/ Local HTTP API and static file serving
styles/ Release style catalog (global-style-catalog.ts), seeds and versioned upgrades
web/ Browser TypeScript source
public/ HTML, CSS and generated browser JavaScript
scripts/ Development, packaging and agent setup commands
tests/ Behavior and regression tests
examples/ Sample style catalog
docs/ Architecture, workflows and operating guides
dist/ Generated npm package contents (do not edit)Keep agent and HTTP adapters thin; place shared behavior in the relevant source module. Update importing tests when moving a module. Keep the src/cli.ts entry point stable for existing agent registrations. The package build recursively compiles source modules and preserves their directory layout.
After editing the style catalog, regenerate its documentation with `node scripts/run.mjs scripts/catalog-doc.mjs` (writes docs/STYLE-CATALOG.md).
### Common development standard and language substyles
The Library has one **Global Development Standard**, inherited by TypeScript,
C#/.NET, Python, Java, Swift, Kotlin and Dart substyles. Select the relevant language
in your project; common rules load once. Framework rules apply only to the task.
Explicit repository settings override personal formatting defaults.
For preparation/review, pass known `context.languages`, `context.frameworks` and
`context.targets` (for example `typescript`, `react`, `web`). Pass empty arrays when
none apply; omit unknown context and resolve the resulting questions rather than
guessing. Examples of other targets: `api`, `worker`, `cli`, `sdk`, `mobile`.
Existing libraries can use **Library → … → Review standards consolidation**.
The version-bound preview preserves IDs, private copies, project selections and
history; personal edits or overrides require manual comparison. Successful batches
offer guarded Undo. Fresh seeds already include the hierarchy. Compatibility
records are hidden from normal Library lists/discovery but retain old references.
Restart long-running MCP hosts after upgrading to load the extended context schema.
See the [rule mapping and migration report](docs/research/development-standards-implementation-2026-11-07.md).
npm install
npm run build:package
npm test
npm pack
node scripts/test-package.mjsThe npm artifact includes compiled JavaScript and the prebuilt browser UI. No runtime npm dependencies are required. The CLI and UI run locally on loopback; retrieved content is shared with the agent provider when requested. Trace events show observed activity, not proof of model compliance.
MIT licensed. See platform verification and remaining Windows/macOS checks. Native platform CI is configured; results must be checked before claiming full compatibility.
Project and support
Source: nghiacr002/personal-brain-style. Report reproducible problems through GitHub Issues.
Package discovery keywords are maintained in package.json; npm displays them after the next published version. They describe MCP, agent instructions, skills, project styles and the learning loop.
Create project-private styles through MCP
Agents can call brain_create_project_style with an explicit projectId, the current expectedProjectVersion from brain_projects, and a style containing keyId (a stable lowercase slug), domain, title, summary and content. Optional fields include skill references, templates (examples), review criteria and required style IDs. The capability must already exist.
The style is private to that project and selected by default. Use select: false to save an unselected alternative. If that capability is Pick one and already has a selected style, update it with brain_update_project_style or change the selection in Configure project. Matching uses the immutable keyId, not the display title. A global match is selected and personalized for the project; a private match is updated rather than duplicated. Different projects can own the same private key until publishing establishes its global identity. Publishing reuses an existing global key and never overwrites its content; private variants retain their content and link to the global style. Global edits belong in the Library or the Learning page. New keys are generated from the title when omitted. The editor displays the key and locks it after creation. Existing conflicting legacy records retain distinct keys and their original content/history. Restart an existing MCP connection to discover the new tool; the ChatGPT read-only connection does not expose it.
Instruction delivery and quality
See delivery diagnostics and the retrieval baseline for doctor observations, MCP compatibility and the repeatable npm run test:quality check.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Related MCP Connectors
Path-scoped team memories, rules and skills for Claude Code, Cursor, Codex and other MCP clients.
Shared project docs, task planning and GitHub evidence for people and their AI agents.
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Long-term, rotatable project memory and pre-write checks for AI coding agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with queryable, version-controlled project rules and coding standards. Enables validation, rule-based guidance, and task summaries to keep AI work aligned with your project's conventions without repeating context.2MIT
- AlicenseNot gradedqualityCmaintenanceTurns Claude Code into an engineering project manager by orchestrating feature development with isolated Git worktrees, structured task validation, and approval-gated integration.1MIT
- AlicenseNot gradedqualityBmaintenanceServes instructions and templates that make any AI coding tool plan before building, work through a project checklist in the right order, and hold a consistent standard, while all reading and writing of your code stays on your machine.MIT
- AlicenseNot gradedqualityAmaintenanceEnables Claude Code, Cursor, Codex, and Claude Desktop to carry project decisions, rules, bugs, to-dos, and failed approaches across sessions by saving them as lines in a repo file and bringing the relevant ones back on each prompt. It also checks commands and file edits against those saved rules before they run, flagging anything that might break one.217 npmMIT