# MemoFS MCP Server

Gives a coding agent persistent project memory and a virtual filesystem for sessions. Useful when context keeps vanishing between runs.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: 0xbuffdev
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/0xbuffdev/memofs/tree/HEAD/packages/mcp-server
- Updated: 2026-10-18
- HTML: https://affpapa.org/en/nevibecode/mcp/memofs-mcp-server

## What it 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`.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://memofs.dev/api/v1/projects/{projectId}/mcp`
- Environment variables: `MEMOFS_API_KEY`, `MEMOFS_RUNTIME` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

1. **Platform CLI**
```bash
claude mcp add --env MEMOFS_API_KEY=<MEMOFS_API_KEY> --env MEMOFS_RUNTIME=<MEMOFS_RUNTIME> --transport stdio mcp-server -- npx -y @memofs/mcp-server
```
Replace <…> with your own values

2. **Platform CLI: remote server**
```bash
claude mcp add --transport http mcp-server https://memofs.dev/api/v1/projects/{projectId}/mcp
```

### Codex

1. **Platform CLI**
```bash
codex mcp add mcp-server --env MEMOFS_API_KEY=<MEMOFS_API_KEY> --env MEMOFS_RUNTIME=<MEMOFS_RUNTIME> -- npx -y @memofs/mcp-server
```
Replace <…> with your own values

2. **Platform CLI: remote server**
```bash
codex mcp add mcp-server --url https://memofs.dev/api/v1/projects/{projectId}/mcp
```

### Cursor

1. **Config file**
File `.cursor/mcp.json`:
```json
{
    "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

2. **Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-server": {
            "url": "https://memofs.dev/api/v1/projects/{projectId}/mcp"
        }
    }
}
```

### GitHub Copilot

1. **Config file**
File `.vscode/mcp.json`:
```json
{
    "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

2. **Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-server": {
            "type": "http",
            "url": "https://memofs.dev/api/v1/projects/{projectId}/mcp"
        }
    }
}
```

### Gemini CLI

1. **Platform CLI**
```bash
gemini mcp add -e MEMOFS_API_KEY=<MEMOFS_API_KEY> -e MEMOFS_RUNTIME=<MEMOFS_RUNTIME> mcp-server npx -y @memofs/mcp-server
```
Replace <…> with your own values

2. **Platform CLI: remote server**
```bash
gemini mcp add -t http mcp-server https://memofs.dev/api/v1/projects/{projectId}/mcp
```

## When to use it
- 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
- 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

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
