# ctxfile

Captures working files, git status, and session decisions into a local snapshot shared across your coding agents. Useful when switching between CLI tools and editor chats.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5
- Author: ctxfile
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ctxfile/ctxfile
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/ctxfile

## What it does

Switching between tools like Claude Code and Cursor usually wipes your active context. The ctxfile server gathers priority files, plans, and git history into a unified payload via the `get_context` tool. When switching environments, `save_session` and `continue_thread` hand over the working log without manual recaps.

The core engine operates entirely on your machine without external network traffic. It scans repo files in read-only mode and scrubs private keys, tokens, and `.env` values before building the snapshot.

Runtime demands are strict: Node 20 is required on Unix systems, and Windows setups need Node 22 or higher. Optional external integrations like Notion only trigger when you supply explicit environment credentials.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `NOTION_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add ctxfile -e NOTION_TOKEN=<NOTION_TOKEN> -- npx -y ctxfile
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add ctxfile --env NOTION_TOKEN=<NOTION_TOKEN> -- npx -y ctxfile
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "ctxfile": {
            "command": "npx",
            "args": [
                "-y",
                "ctxfile"
            ],
            "env": {
                "NOTION_TOKEN": "<NOTION_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "ctxfile": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "ctxfile"
            ],
            "env": {
                "NOTION_TOKEN": "<NOTION_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e NOTION_TOKEN=<NOTION_TOKEN> ctxfile npx -y ctxfile
```
Replace <…> with your own values

## When to use it
- Hand off active project context between terminal tools and IDE agents
- Resume unfinished coding sessions without re-explaining past decisions
- Strip credentials and sensitive keys before feeding files to an agent
- Track cross-agent tasks and review open items in a shared thread

## Example prompts
- Call get_context to inspect our working state
- Run save_session to summarize what we changed so another agent can continue
- Fetch open items for this thread using list_tasks

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
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
