memcode docs
CLI

MCP

Connect memcode to Model Context Protocol servers, and expose memcode's own memory as an MCP server.

memcode speaks the Model Context Protocol in both directions. It can use external MCP servers as tools, and it can act as an MCP server that exposes your project's memory to other tools.

Add a server

For a remote server, give its URL:

memcode mcp add --transport http docs https://example.com/mcp

Pass a header if it needs auth:

memcode mcp add --transport http --header "Authorization: Bearer $TOKEN" api https://api.example.com/mcp

For a local server, put the command after --:

memcode mcp add fs -- npx -y @modelcontextprotocol/server-filesystem /path

Other useful flags are --scope, --env KEY=VALUE for local servers, and --timeout.

Manage servers

memcode mcp list
memcode mcp get <name>
memcode mcp remove <name>

Scopes and trust

A server's scope decides who sees it:

ScopeWhere it applies
localJust this machine. The default.
userAll your projects. Stored in ~/.memcode/mcp.json.
projectChecked in at the repo root as .mcp.json and shared with your team.

Project-scoped servers are untrusted until approved, since they come from the repo:

memcode mcp approve <name>
memcode mcp reject <name>
memcode mcp reset-project-choices

MCP tools are gated by the same permission policy as everything else.

Exposing memcode as a server

Turn memcode into an MCP server that serves this project's memory over stdio. It works offline, read-only, and needs no account:

memcode mcp serve

It exposes tools such as memcode_recall, memcode_overview, memcode_claims, memcode_session, and memcode_locate. Add it to another MCP client, for example:

claude mcp add memcode -- memcode mcp serve

Now that client can query what memcode knows about your codebase.

On this page