MemoFS MCP Server — Claude Code MCP server: agent memory
Gives a coding agent persistent project memory and a virtual filesystem for sessions. Useful when context keeps vanishing between runs.
claude mcp add --env MEMOFS_API_KEY=<MEMOFS_API_KEY> --env MEMOFS_RUNTIME=<MEMOFS_RUNTIME> --transport stdio mcp-server -- npx -y @memofs/mcp-serverWhat MemoFS MCP Server does
MemoFS MCP Server attaches to your agent over stdio or HTTP and exposes 10 tools: four memory verbs plus six AgentFS session tools. Another 9 resources cover memory, the graph and sessions. The agent picks what to store, look up or update.
Memories can be tied to source files. memofs.remember takes an optional anchor parameter, and once an anchored file changes, memofs.recall marks that entry stale. Recall also returns an unverified flag when a memory has outlived the decay floor for its kind. Sessions end through memofs_agent_session_complete, whose outcome, ephemeral and reason parameters drive a 5-row matrix deciding what gets promoted to durable memory and what leaves the workspace.
Two runtime modes are available, local and hybrid, with cloud sync through --cloud-url and --api-key. The --read-only flag blocks mutating tools, which matters if the client on the other end is untrusted. Node.js 22 or newer is required. Cloud sync needs a MEMOFS_API_KEY.
What it helps with
- keep project conventions across agent sessions
- see what the agent already knows about one file
- flag memory as outdated after a source edit
- close a session and decide what stays in durable memory
- reach project memory over HTTP without a local process
Example prompts for the agent
- Remember that the auth module moved to the new library, and anchor it to
src/auth.ts - What do you know about this project? Show me the stale entries
- Complete the session as successful and drop the scratch notes
How to install MemoFS MCP Server
1Platform CLI
claude mcp add --env MEMOFS_API_KEY=<MEMOFS_API_KEY> --env MEMOFS_RUNTIME=<MEMOFS_RUNTIME> --transport stdio mcp-server -- npx -y @memofs/mcp-serverReplace <…> with your own values
2Platform CLI: remote server
claude mcp add --transport http mcp-server https://memofs.dev/api/v1/projects/{projectId}/mcp1Platform CLI
codex mcp add mcp-server --env MEMOFS_API_KEY=<MEMOFS_API_KEY> --env MEMOFS_RUNTIME=<MEMOFS_RUNTIME> -- npx -y @memofs/mcp-serverReplace <…> with your own values
2Platform CLI: remote server
codex mcp add mcp-server --url https://memofs.dev/api/v1/projects/{projectId}/mcp1Config file
{
"mcpServers": {
"mcp-server": {
"command": "npx",
"args": [
"-y",
"@memofs/mcp-server"
],
"env": {
"MEMOFS_API_KEY": "<MEMOFS_API_KEY>",
"MEMOFS_RUNTIME": "<MEMOFS_RUNTIME>"
}
}
}
}Replace <…> with your own values
2Config file
{
"mcpServers": {
"mcp-server": {
"url": "https://memofs.dev/api/v1/projects/{projectId}/mcp"
}
}
}1Config file
{
"servers": {
"mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@memofs/mcp-server"
],
"env": {
"MEMOFS_API_KEY": "<MEMOFS_API_KEY>",
"MEMOFS_RUNTIME": "<MEMOFS_RUNTIME>"
}
}
}
}Replace <…> with your own values
2Config file
{
"servers": {
"mcp-server": {
"type": "http",
"url": "https://memofs.dev/api/v1/projects/{projectId}/mcp"
}
}
}1Platform CLI
gemini mcp add -e MEMOFS_API_KEY=<MEMOFS_API_KEY> -e MEMOFS_RUNTIME=<MEMOFS_RUNTIME> mcp-server npx -y @memofs/mcp-serverReplace <…> with your own values
2Platform CLI: remote server
gemini mcp add -t http mcp-server https://memofs.dev/api/v1/projects/{projectId}/mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about MemoFS MCP Server
How do I install MemoFS MCP Server in Claude Code?
Run claude mcp add mcp-server -e MEMOFS_API_KEY=<MEMOFS_API_KEY> -- npx -y @memofs/mcp-server, replacing the key with your own.
What does MemoFS MCP Server do?
It hands the agent tools to read, search and update project memory, plus AgentFS session tools. Memories can be anchored to files and marked stale when those files change.
What does MemoFS MCP Server need to run?
Node.js 22 or newer. Cloud sync takes --cloud-url and --api-key, and the client config carries the MEMOFS_API_KEY variable.