forgemind-brain
The server provides a local, approval-gated shared memory for AI coding agents, exposed through eight MCP tools.
Load a small ranked project memory packet at session start (
brain_context).Search approved entries and session history, returning at most 5 results (
brain_search).Propose conventions, lessons, decisions, or patterns that stay pending owner approval (
brain_propose).Record short session summaries and outcomes with optional screenshot/PDF attachments (
brain_record).Retrieve recent sessions and recipes from the same tool for reflection (
brain_reflect_packet).Write an Architecture Decision Record that stays proposed until accepted (
brain_adr).Save reusable task recipes with goal, plan, prompts, dead ends, verification, and outcome (
brain_recipe).Read a full ADR or recipe by id (
brain_doc).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@forgemind-brain search my project memory for lessons about flaky e2e tests"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
forgemind-brain
Local memory for AI coding agents. Claude Code, Cursor and Codex share one brain on your machine. Each new session knows what was done in a project, what worked and what failed, without you re-explaining it.
Private by design: one SQLite file in
~/.forgemind. It is never in git, never uploaded, and has no cloud service and no telemetry.You stay in control: agents can propose lessons. A lesson guides future sessions only after you approve it, so wrong guesses don't pile up.
Works across tools: a lesson approved while you use Cursor is there the next time you open Claude Code.
Small: about 1,100 lines of TypeScript. The only runtime is Node.js, with no other dependencies.
How it works
Claude Code ─┐ ┌─ lessons, conventions, decisions (you approve)
Cursor ──────┼── MCP + hooks ──► brain.sqlite ─┼─ session history (what was done, outcome)
Codex ───────┘ └─ attachments (screenshots, PDFs)Session start: a hook loads a short, size-capped packet into the agent's context. It holds the approved lessons for this project and recent history.
During work: the agent can search the brain, record what it did, attach screenshots (for example from a bug bash) and propose new lessons.
Session end: a hook records a fallback summary (first prompt, changed files and the first line of the agent's last reply as the outcome), so nothing is lost if the agent forgets.
Reflect: say "reflect" in any tool to review recent sessions in-chat (
brain_reflect_packet), or schedule it in the background; seedocs/brain.md.You review:
npm run brain -- list --workspace <project> --status proposed, thenapproveorreject.
Obsidian view: npm run brain -- export --obsidian writes a read-only vault, so Obsidian's graph shows projects, sessions, ADRs, recipes and lessons (docs).
The server also tells agents to record a short summary after they read tickets, chats or email (Jira, Slack, Teams, Outlook) through your other MCP connectors. The summary holds decisions, outcomes and IDs; raw message content is never pasted. That way what an agent learned there is not lost when the session ends.
Related MCP server: apex-memory
Why not just built-in memory?
Claude Code's auto memory and /insights cover part of this. What they don't give you:
Approval before guidance: auto memory writes notes the agent reads straight away. Here a lesson is only a proposal until you approve it.
One brain for every tool: Claude Code memory stays in Claude Code. This brain is shared by Claude Code, Cursor and Codex.
Recipes and ADRs: a recipe keeps the plan, the exact prompts, dead ends, verification and outcome of a task, so you can repeat it. ADRs keep decisions and why they were made.
Why lessons are short: a lesson is at most 300 characters because approved lessons
go into each session's start packet, which is capped at 3,200 characters. Long how-tos
belong in a recipe or ADR (each field up to 8,000 characters), which agents find with
brain_search and read in full with brain_doc when they need them. The brain never edits your skills, CLAUDE.md or
AGENTS.md; promoting a lesson into one of those stays your call.
Quick start
Requires Node.js 26.7 or newer (it uses the built-in node:sqlite). Tested on macOS.
git clone https://github.com/sleepingfreak94/forgemind-brain.git
cd forgemind-brain
npm ci
npm run install-local # builds and installs to ~/.forgemind/binConnect Claude Code:
claude mcp add --scope user forgemind-brain -- node ~/.forgemind/bin/brain-mcp.js --source claude-codeThen add the session hooks so memory loads and saves automatically.
Connect Cursor: add the server to ~/.cursor/mcp.json, the hooks to
~/.cursor/hooks.json, and, for the Cursor CLI, allow all eight brain tools in
~/.cursor/cli-config.json (brain_context, brain_search, brain_record,
brain_propose, brain_adr, brain_recipe, brain_doc, brain_reflect_packet).
Exact snippets for Cursor and Codex are in docs/brain.md.
Try it in any project:
npm run brain -- add --workspace ~/code/my-app --kind lesson \
--text "Run e2e tests with --workers=1; parallel runs flake on CI." --reason "seen twice"
npm run brain -- list --workspace ~/code/my-app --status proposed
npm run brain -- approve --workspace ~/code/my-app --id <id>The next agent session in ~/code/my-app starts with that lesson in its context.
What gets stored
Kind | Example | Needs approval |
| "Mocking the clock broke the retry test; use fake timers." | yes |
| "Commit subjects follow type(scope): description." | yes |
| "We chose SQLite over Postgres for local state." | yes |
| "API handlers validate input at the boundary." | yes |
history | "Fixed login redirect: worked; tried cookie fix first: failed." | no (facts) |
attachment | screenshot of the bug, before and after | no |
Text that looks like a secret (API keys, tokens, passwords) is refused or redacted. Agents never read the database directly: they get at most 3,200 characters of context and 5 search results at a time.
Learn from an existing repo
npm run brain -- learn --workspace ~/code/my-app --source allThis reads the git log, branch names and merged PRs (via gh), then proposes
conventions it finds, such as "commit subjects follow type(scope)". They wait for your approval.
Docs
docs/brain.md: full reference covering commands, tool setup, hooks, attachments and limits.
docs/migrating-from-forgemind.md: only for users of the old ForgeMind harness.
Contributing
Issues and PRs are welcome. Run npm test before you open a PR. See
AGENTS.md for the rules agents and humans follow in this repo.
License
Available Tools
8 toolsbrain_adrB
Write an Architecture Decision Record for a significant choice (ADR-0001 covers the project goals and stack). It stays proposed until the owner accepts it.
Inputs: title (required), context (required), decision (required), alternatives (required), +2 more.
brain_contextA
Small ranked memory packet for this project: approved conventions and latest history. Call at session start.
Inputs: no named parameters.
brain_docB
Read one ADR or recipe of this project in full, by id or ADR-n.
Inputs: id (required).
brain_proposeC
Propose a memory entry. It stays proposed until the owner approves it.
Inputs: kind (required), text (required), reason (required).
brain_recipeA
Save a task recipe at the end of a task: goal, plan, the exact prompts the user gave (max 50, 4000 chars each, secrets are redacted), dead ends, how it was verified and the outcome.
Inputs: goal (required), plan (required), outcome (required), prompts (required), +3 more.
brain_recordA
Record what this session did or read (short summary, never raw content). Optional attachments: up to 10 absolute paths of png/jpg/gif/webp/pdf files, max 10 MB each. Call before finishing.
Inputs: title (required), outcome (required), summary (required), files, +1 more.
brain_reflect_packetB
Recent sessions and recipes of this tool only, plus instructions for reflecting on them. Call when the user says 'reflect'.
Inputs: days.
brain_searchB
Search approved entries and history for this project. Returns at most 5 short items.
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
The read tools are reasonably separated by trigger and scope (session-start packet vs. query-based search vs. reflection-specific packet vs. fetch-one-by-id), and the write tools map to distinct artifact types (session log with attachments, generic proposed entry, ADR, recipe). Minor overlap remains between brain_propose and the typed writers brain_adr/brain_recipe, since all three create pending entries, which could cause a misselection when the agent just wants to 'remember something'.
Every tool uses the same brain_ prefix, so the namespace is instantly predictable. Within that, the stems mix verbs (search, propose, record) with nouns (context, adr, recipe, doc) and one compound (reflect_packet), a minor deviation but still readable and clearly grouped as reads vs. writes.
Eight tools is well-scoped for a project-memory server: four retrieval tools and four authoring tools, each covering a distinct artifact or lifecycle stage. No tool looks redundant or padded.
Write coverage is solid (propose, record, ADR, recipe) and search/context/doc cover most retrieval, but there is no way to read a general memory entry in full — brain_search returns only short snippets and brain_doc is limited to ADRs and recipes, leaving a dead end. There is also no update, retract, or delete operation for entries, so corrections must go through a new proposal plus out-of-band owner action.
Maintenance
Related MCP Connectors
A personal memory you control, shared across Claude, ChatGPT, Cursor and any MCP client.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Shared AI memory. ChatGPT, Claude, Cursor and any MCP app read and write the same memory.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceLocal-first cross-agent memory for AI coding agents. Persistent, shared memory over MCP — what you tell one agent can be recalled by another — with all data stored in a single local SQLite file, no cloud and no API keys.-
- AlicenseNot gradedqualityDmaintenancePersistent memory for AI coding agents. Enables agents to save and recall decisions, patterns, bugs, and context across sessions via an MCP server with local SQLite storage.21 npm2MIT
- AlicenseAqualityBmaintenancePersistent memory for AI coding agents, storing decisions, bug fixes, conventions, and discoveries in a local SQLite database and automatically recalling them when relevant. Works with Claude Code, Codex, Cursor, Gemini CLI, and other MCP-compatible agents.224MIT
- AlicenseAqualityCmaintenanceGives coding assistants a local-first SQLite store for project and global lessons with evidence, immutable replacements, retrieval tracking, and agent feedback, searched by keyword out of the box or by optional local semantic search. It runs over MCP stdio with launch-bound workspace scopes and write permissions disabled by default, so assistants can save, supersede, archive, retrieve, and rate memories entirely on the local machine.6MIT