Self-hosted, source-traceable memory layer and MCP server for AI agents, on your own Postgres.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Persistent, source-traceable memory for AI agents β self-hosted on your own Postgres, with no API keys required to run.

brain_why) β no trust-me summaries.Who it's for: dev teams running agents that need one shared memory Β· agencies needing hard per-client isolation Β· anyone who wants their assistant to remember across sessions β import your ChatGPT / Claude history (from your data export) and your AI knows you on day one.
Built solo by a growth marketer β not a career engineer β directing AI coding agents over ~3 months. How it was built β
The usual fix for agent amnesia β letting an LLM maintain its own memory β fills it with duplicates, hallucinated summaries, and confident answers nobody can trace. Myco Brain is built on the opposite contract:
The LLM proposes. Deterministic rules decide what becomes a fact. You set the bar β from corroboration-gated auto-promotion (the default) to strict human review of every fact (
BRAIN_REQUIRE_HUMAN_REVIEW=1).
Claude, Cursor, Windsurf, Continue, Zed, and custom agents all share one memory backed by your own Postgres.
β If the trust model resonates, a star helps others find it.
[!TIP] Zero API keys, all the way down. Full-text search, semantic search (local embeddings), and the knowledge graph (local extraction) all run with no hosted dependency. Add an Anthropic key only if you want the most accurate graph.
MCP-native by design β your agent knows when to use memory, not just how.
Most MCP servers expose tools and hope the model calls them. Myco ships a usage
contract over MCP's instructions channel: the moment it connects, your agent
knows to pull context before a task, save durable decisions, and cite sources
with brain_why β no per-project prompting. Tune the policy in one copy-paste
block: Teach your agent to use it well.
Quick links: 10-minute quickstart Β· Teach your agent to use it well Β· The trust engine Β· Benchmark β run it yourself Β· Run every proof Β· Who it's for Β· Environment variables Β· Architecture Β· Roadmap Β· Cloud waitlist
Most agent memory overwrites facts silently. Myco Brain compounds them:

brain_why about any fact and you get its distinct source count (per
relationship, not per mention), its confidence trend over time ("0.8 β 0.86"),
and any superseded history.
Contradictions stay visible. Your memory can't gaslight you.Proof: npm run test:compounding β the full lifecycle runs against a live
database in seconds, no LLM required.
brain_stats: "Brain proposed 3 new
types from your data").BRAIN_SCHEMA_AUTO_PROMOTE=1), counted per document, not per mention, so two
documents passed back and forth can't manufacture consensus. One chatty
document can never promote anything.Proofs: npm run test:dynamic-schema, npm run test:schema-promotion.
You pick the trust dial:
| Mode | Behavior |
|---|---|
| Default | Confident facts auto-promote; novel types wait for review |
BRAIN_REQUIRE_HUMAN_REVIEW=1 | Strict curation β nothing the LLM proposes touches the canonical graph without a human decision |
BRAIN_SCHEMA_AUTO_PROMOTE=1 | Corroborated new types promote themselves, audited |
When something is waiting on you β novel types in default mode, or everything in strict mode β review it from the command line:
Proof: npm run test:review β approving actually lands the entity / edge /
type in the canonical graph; rejecting never does.
Multi-agent teams get real isolation: documents marked private are readable
only by the agent that created them β enforced in every read tool, on top
of workspace row-level security. Workspace memory stays shared. Proof:
npm run test:sharing (a two-agent visibility matrix). Like workspace
isolation, it binds only under the least-privilege brain_app role
(security note).
Put each client in their own workspace, share one agency-wide playbook, and
the guarantee you sell is Postgres row-level security β a session scoped
to Client A cannot return Client B's rows. The
agency starter kit provisions it (one command) and ships
the least-privilege DB role that makes the isolation actually bind. Proof:
npm run test:agency β Client A sees zero of Client B's facts.
[!IMPORTANT] Isolation binds only under the least-privilege role. RLS does not constrain a Postgres superuser, and the zero-config quickstart's default
brainrole is a superuser (fine for a single-workspace self-host β there's nothing to isolate). Before you put more than one client in one database, run the app as theNOSUPERUSERbrain_approle the agency kit ships;mycobrain-doctorflags a superuser connection. Multi-tenant isolation is a guarantee ofbrain_app, not of the default quickstart role.
BRAIN_TRUST_REQUEST_IDENTITY)RLS decides which rows a tenant can read; this setting decides which tenant a
request is β the step before RLS. On the stdio server, identity is taken
only from the server's environment by default: a workspace_id, agent_id,
or api_key supplied in tool-call arguments is ignored, so even a
prompt-injected agent can't pass workspace_id: "<someone-else>" to reach
another workspace. (For brain_ keys, identity comes from the key string and
nothing else.)
Set BRAIN_TRUST_REQUEST_IDENTITY=1 only when you front the server with a
real multi-tenant gateway that authenticates each request and maps it to a
tenant itself β then per-request identity is honored (and a service-role JWT
must equal BRAIN_SERVICE_ROLE_KEY, not merely look like one). Single-tenant
self-hosts need none of this β their identity is already environment-derived.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/myco-brain)<a href="https://allmcps.com/mcp/myco-brain"><img src="https://allmcps.com/api/badge/myco-brain?style=directory" alt="Myco Brain on AllMCPs" /></a>