Skip to content
MCP server

Context Guardian

Fail-open compaction proxy and MCP server that keeps long local-model sessions alive

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, self-hosted, Linux
Runs
Locally
Version
0.16.0
Listing updated
today

Similar MCP servers

About Context Guardian

Context Guardian is an open-source MCP server for ai models and llm tooling. It runs locally on your machine and is started by your AI client.

When a conversation is about to outgrow the model's context window, the proxy summarises older turns, keeps recent ones verbatim and forwards a request that fits. What it folds away is archived on disk, sealed in a hash chain you can verify, and indexed so a model can search it. The README's benchmark against a stub upstream shows a 40-turn session going from 1,130,722 tokens sent to 161,141, and notes that this is not a run against a real model.

It fails open: if a summary fails or anything in the proxy raises, the request goes upstream unchanged. It sits in front of OpenAI-compatible backends such as Ollama, LM Studio, vLLM and LiteLLM, and has a native engine for DeepSeek Harness. For Claude Code, hooks archive each session and this MCP server lets it search what was archived. The seal is described as tamper-evident, not tamper-proof.

It runs locally with no telemetry beyond one optional PyPI version check, and receipts record counts only, never message text. Only Ollama and DeepSeek Harness are marked as tested.

Install

Run in a terminal

claude mcp add context-guardian -- uvx context-guardian

Add to claude_desktop_config.json

{
  "mcpServers": {
    "context-guardian": {
      "command": "uvx",
      "args": [
        "context-guardian"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "context-guardian": {
      "command": "uvx",
      "args": [
        "context-guardian"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "context-guardian": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "context-guardian"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "context-guardian": {
      "command": "uvx",
      "args": [
        "context-guardian"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "context-guardian": {
      "command": "uvx",
      "args": [
        "context-guardian"
      ]
    }
  }
}

Using several servers? Build one config file with the MCP config generator.

Tools this server provides (1)

Taken from the project documentation; the running server may differ.

get_seal_status
Check the archive's hash-chain seal from inside a client.

What it does

Compaction proxy
Summarises old turns so requests fit the context window.
Fails open
Any failure sends the original request upstream untouched.
Sealed archive
Folded-away spans are stored in a verifiable hash chain.
Searchable recall
Find archived originals with a recall command or MCP tools.
Savings receipts
Count tokens kept out of the window without storing text.
Claude Code hooks
Archive Claude Code sessions into the same searchable store.

Good for

  • Stop a local-model coding session dying at the context limit
  • Search what was compacted earlier in a long session
  • Verify an archive has not been tampered with
  • Archive Claude Code sessions for later recall

Pricing

Open source

Free, MIT-licensed

Context Guardian FAQ

Does it send data anywhere?

The README says nothing leaves the machine except your requests to your own backend and one optional PyPI version check.

What happens if summarisation fails?

The request goes upstream exactly as the client sent it.

Which backends are tested?

Ollama and DeepSeek Harness 0.1.2-alpha.2; others are configured from documentation and untested.

How do I run the proxy?

Run pip install context-guardian then context-guardian, and point OPENAI_BASE_URL at http://localhost:8786/v1.

Is Context Guardian free?

Yes. Context Guardian is open source, so you can use and self-host it for free.

How do I add Context Guardian to Claude Code?

Run this command in your terminal: claude mcp add context-guardian -- uvx context-guardian

What are the best alternatives to Context Guardian?

The closest alternatives to Context Guardian are headroom, omniget, next-ai-draw-io, mcp-for-blender and Claude Code Ultimate Guide.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers