ctx-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ctx-mcp — Zero-Dependency In-RAM Context Broker & MCP Server
ctx-mcp (ctx) is a single-binary, zero-dependency Rust std Context Broker and Model Context Protocol (MCP) server for AI coding agents (Google Antigravity, Claude Code, and Codex CLI).
It keeps a shared 64-shard cache-line-padded in-RAM file & structural symbol index across parallel agents (up to 4 GiB LRU), executes batched AVX2-accelerated searches (q: ["Module:pattern", ...]) with automatic .hpp/.cpp/module stem expansion, deduplicates repeated reads per agent session, and enforces strict workspace + secret-file boundaries (.env*, *.pem, *.key).
Dual-licensed under MIT OR Apache-2.0. Zero external Rust crates (Cargo.toml has 0 dependencies).
One-Command Install (No Rust Required)
Paste one command in your terminal. It automatically downloads the verified prebuilt binary for your OS/CPU (or compiles from source in ~2s if rustc is installed and no release asset matches) and opens a lightweight interactive harness selector:
Linux / macOS / WSL2
curl -fsSL https://raw.githubusercontent.com/be0hhh/ctx-mcp/main/setup/install.sh | bashWindows (PowerShell)
irm https://raw.githubusercontent.com/be0hhh/ctx-mcp/main/setup/install.ps1 | iexNode / npx (Cross-Platform)
npx github:be0hhh/ctx-mcpInteractive Setup Menu
When install runs in your terminal, ctx setup scans which AI clients are installed on your machine and opens a quick selector:
ctx-mcp setup — select AI harnesses to configure:
[x] 1. Antigravity (Gemini) [detected] * Recommended (-45% time, -38% new tokens)
[x] 2. Claude Code [detected] * Recommended
[ ] 3. Codex CLI (GPT/Sol) [detected] (off by default: deferred MCP token overhead)
Press Enter to confirm, type 1/2/3 to toggle (or 'all' / 'none' / 'q' to cancel):Non-interactive / CI install:
curl -fsSL https://raw.githubusercontent.com/be0hhh/ctx-mcp/main/setup/install.sh | bash -s -- --targets antigravity,claudeRe-run harness selector anytime:
ctx setupVerify health &
0600security invariants:ctx doctor
Related MCP server: vibe-hnindex
Uninstall
Remove ctx-mcp (stops the background daemon, cleanly removes agent_ctx MCP & hook entries while preserving all other MCP servers/hooks and .bak backups, and deletes ~/.local/bin/ctx):
ctx uninstallDetach from a single harness only (e.g., disable Codex while keeping Antigravity & Claude):
ctx uninstall --targets codexStandalone terminal one-liners if
~/.local/binis not inPATH:Linux / macOS / WSL2:
curl -fsSL https://raw.githubusercontent.com/be0hhh/ctx-mcp/main/setup/uninstall.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/be0hhh/ctx-mcp/main/setup/uninstall.ps1 | iex
Benchmarks: Direct (rg) vs ctx-mcp
Methodology & Transparency: Measured on a ~1,800-file C++26 & Python repository across 5 independent 4-anchor navigation tasks (
20ground-truthfile:linetargets per wave, run in 5-way parallel waves).
Gemini in Antigravity shows a large, consistent improvement across wall-clock time, tool round-trips, payload size, and token consumption.
Codex CLI (
GPT-6.2 Sol) is reported honestly alongside it: whilectx-mcpis slightly faster in wall-clock time and returns-41.9%smaller tool outputs, Codex CLI's deferred MCP loader injects a hiddentool_searchAPI turn (~16k–32kcached tokens), increasing total input tokens on 1-step lookups. For that reason, Codex CLI is unchecked by default inctx setup.The live-model sample is currently compact (
20end-to-end runs + synthetic1–200agent stress waves) and is actively expanding inbenchmarks/.
1. Google Antigravity — Gemini 4 Carbon (Low) (5 Parallel Tasks)
Metric | Direct ( |
| Delta (abs.) | Delta (%) |
Ground-truth |
|
|
|
|
5-task parallel wave wall-clock, s |
|
|
|
|
Task duration (mean), s |
|
|
|
|
Task duration (median), s |
|
|
|
|
Task duration (sum across 5 tasks), s |
|
|
|
|
Tool calls (mean / sum) |
|
|
|
|
Tool execution time (mean), ms |
|
|
|
|
Tool output payload (sum), bytes |
|
|
|
|
Uncached (new) input tokens (sum) |
|
|
|
|
Cached input tokens (sum) |
|
|
|
|
Total input tokens (sum) |
|
|
|
|
Output tokens (sum) |
|
|
|
|
Total tokens (sum across 5 tasks) |
|
|
|
|
2. Codex CLI — GPT-6.2 Sol (Low) (5 Parallel Tasks — Honest Baseline)
Metric | Direct ( |
| Delta (abs.) | Delta (%) |
Ground-truth |
|
|
|
|
5-task parallel wave wall-clock, s |
|
|
|
|
Task duration (mean / median), s |
|
|
|
|
Tool calls (mean / sum) |
|
|
|
|
Median | — (shell) |
| — | — |
Tool output payload (sum), bytes |
|
|
|
|
Uncached (new) input tokens (sum) |
|
|
|
|
Cached input tokens (sum)* |
|
|
|
|
Output tokens (sum) |
|
|
|
|
Total tokens (sum across 5 tasks)* |
|
|
|
|
*Codex CLI loads external MCP schemas through a deferred tool_search round-trip (3 API turns instead of 2 on 1-call tasks), adding ~19k cached tokens per task when compared against raw shell-only codex exec with zero MCP servers configured.
3. Shared Daemon Multi-Agent Load (ctx bench --agents 1,10,50,100,200 --ops 25)
Concurrent Agents | Total Ops | Throughput ( |
|
|
| Isolation / RPC Errors |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ergonomic Batch Format (q + Grouped @symbol Output)
Every ctx_* MCP tool accepts flat string arrays so agents emit minimal output tokens and finish in a single round-trip:
{
"q": [
"PositionTable:applyfill",
"StartupStreamBoundary:userdata|subscrib",
"AccountObservationExtractor:::fetchStartupSnapshotCold"
]
}Bare module stems (
"StartupStreamBoundary") automatically resolve to both.hppand.cppviaWorkspaceFilesstem hashing without path-discovery calls.Fair code-first quota: round-robin slot balancing across matched files ensures header comments never starve
.cppimplementations.Adaptive grouped output: 1 match emits
path:line: code;2+matches print the file path once with compact@symbolsubheaders:src/src/Runtime/Hot/Position/PositionTable.hpp @canApplyFillHot 145: [[nodiscard]] CXET_ALWAYS_INLINE bool canApplyFillHot( @applyFillHot 168: [[nodiscard]] CXET_ALWAYS_INLINE bool applyFillHot( 179: if (bytescan::hftUnlikely(!states_[instId].applyFillHot(
MCP Tools & CLI Reference
MCP Tool | CLI Equivalent | Purpose |
|
| Parallel AVX2/ripgrep search ( |
|
| Batch directory triage ( |
|
| Exact symbol body extraction ( |
|
| Full-file or range read from RAM up to |
|
| Structural |
|
| Shared workspace findings board with automatic |
|
| Host-verified subagent task capsule handoff |
|
| Optional static ELF64 section/symbol audit |
Security & Architecture Guarantees
Strict workspace & secret refusal: symlinks escaping the workspace root and secret files (
.env*,*.pem,*.key, credentials) fail closed withREFUSED.0600metadata-only reboot snapshot (ACTXSNP2): stores file metadata/outlines only — zero raw source code is ever persisted to disk.Data-oriented Rust
stdinternals:0f32/f64floats,64 Bcache-line-aligned shard locks (CachePadded<T>),48 BSymbolSpan,24 Barena-backedIndexedFilewith 64-bit trigram Bloom filter.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Remote MCP server for notes, tasks, kanban boards and docs - the Slates agentic workspace
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Related MCP Servers
- AlicenseBqualityDmaintenanceA local-first MCP server that provides AI agents with safe codebase access through file discovery, hybrid lexical-semantic search, and project introspection. It features durable local memory and semantic indexing while keeping all data and processing entirely on your local machine.7498 npm6MIT
- AlicenseNot gradedqualityBmaintenanceLocal MCP server to index your codebase once and search it across AI sessions with keyword, semantic, or hybrid search, keeping all data on disk.178 npm3MIT
- AlicenseNot gradedqualityAmaintenanceThe fastest, most capable filesystem MCP server built in Rust, giving AI agents superpowers to read, search, edit, and manage files and directories.23Apache 2.0
- AlicenseNot gradedqualityCmaintenanceA zero-dependency MCP server that enables multiple AI agents to share key-value data, append-only timeline notes, and semantic vector memory across sessions and processes.1MIT