# Sophon

Sophon compresses MCP agent context, including chat history, prompts, command output, and file deltas. Use it when tool traffic keeps growing.

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

## What it does

Sophon exposes MCP tools for reducing prompts, conversation history, and shell output. It can pass file edits as deltas, turn repeated fragments into token references, keep an incremental JSONL memory, and rank relevant parts of a repository for a code question.

The server ships as a single Rust binary and performs query-time compression without an ML model, GPU, or API key. Its output filters cover commands such as `git`, `cargo`, `docker`, `kubectl`, plus JSON data. You can run it through MCP with `npx -y mcp-sophon`.

There are practical limits. On raw source files, `compress_prompt` follows a budget cap instead of routing sections by the query. Some shell commands can add tokens, so the result depends on the data and the repository state.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add sophon -- npx -y mcp-sophon
```

### Codex

**Platform CLI**
```bash
codex mcp add sophon -- npx -y mcp-sophon
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "sophon": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-sophon"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "sophon": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "mcp-sophon"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add sophon npx -y mcp-sophon
```

## When to use it
- compress a growing conversation history
- trim `git` or `cargo` command output
- send file changes instead of the full file
- rank relevant code in a repository
- replace repeated boilerplate with a token reference

## Example prompts
- Use `compress_history` to reduce this conversation while keeping its facts and recent context.
- Run `compress_output` on the output from `cargo test` and retain the failures.
- Use `navigate_codebase` to locate the code responsible for authentication.

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