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/mcpPass a header if it needs auth:
memcode mcp add --transport http --header "Authorization: Bearer $TOKEN" api https://api.example.com/mcpFor a local server, put the command after --:
memcode mcp add fs -- npx -y @modelcontextprotocol/server-filesystem /pathOther 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:
| Scope | Where it applies |
|---|---|
local | Just this machine. The default. |
user | All your projects. Stored in ~/.memcode/mcp.json. |
project | Checked 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-choicesMCP 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 serveIt 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 serveNow that client can query what memcode knows about your codebase.