{"id":51617014,"url":"https://github.com/rustkit-ai/mcpkill","last_synced_at":"2026-07-12T14:31:11.678Z","repository":{"id":367463626,"uuid":"1185737819","full_name":"rustkit-ai/mcpkill","owner":"rustkit-ai","description":"Semantic cache proxy for MCP servers — cut Claude's token usage by up to 79%","archived":false,"fork":false,"pushed_at":"2026-03-19T08:41:44.000Z","size":59,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-26T06:15:17.193Z","etag":null,"topics":["ai","caching","claude","cli","developer-tools","llm","mcp","proxy","rust","semantic-cache","token-optimization"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustkit-ai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-18T22:31:17.000Z","updated_at":"2026-05-30T00:52:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rustkit-ai/mcpkill","commit_stats":null,"previous_names":["rustkit-ai/mcpkill"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/rustkit-ai/mcpkill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustkit-ai%2Fmcpkill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustkit-ai%2Fmcpkill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustkit-ai%2Fmcpkill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustkit-ai%2Fmcpkill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustkit-ai","download_url":"https://codeload.github.com/rustkit-ai/mcpkill/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustkit-ai%2Fmcpkill/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35394859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","caching","claude","cli","developer-tools","llm","mcp","proxy","rust","semantic-cache","token-optimization"],"created_at":"2026-07-12T14:31:10.940Z","updated_at":"2026-07-12T14:31:11.669Z","avatar_url":"https://github.com/rustkit-ai.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003ch1\u003emcpkill\u003c/h1\u003e\n\n\u003cp\u003e\u003cstrong\u003eSemantic cache proxy for MCP servers — cut Claude's token usage by up to 79%\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/rustkit-ai/mcpkill/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/rustkit-ai/mcpkill/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/mcpkill\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/mcpkill.svg\" alt=\"crates.io\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"MIT\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.rust-lang.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/built_with-Rust-dea584.svg\" alt=\"Rust\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n  \u003ca href=\"#install\"\u003eInstall\u003c/a\u003e ·\n  \u003ca href=\"#quick-start\"\u003eQuick start\u003c/a\u003e ·\n  \u003ca href=\"#how-it-works\"\u003eHow it works\u003c/a\u003e ·\n  \u003ca href=\"#benchmarks\"\u003eBenchmarks\u003c/a\u003e ·\n  \u003ca href=\"#options\"\u003eOptions\u003c/a\u003e\n\u003c/p\u003e\n\n\u003c/div\u003e\n\n---\n\nEvery time Claude calls an MCP tool — `read_file`, `search_docs`, `list_directory` — the server dumps its **entire** response into the context window. A 500-line file? 500 lines every single call, even if you already asked about it ten minutes ago.\n\n**mcpkill wraps any MCP server and intercepts every response.** It chunks the content, embeds it locally, caches it in SQLite, and sends Claude only the chunks that are actually relevant to the current question. Completely transparent — Claude sees a normal MCP server.\n\n```\nWithout mcpkill                     With mcpkill\n─────────────────────────────────   ─────────────────────────────────────────\nClaude asks about auth middleware    Claude asks about auth middleware\n       ↓                                    ↓\nMCP returns entire 600-line file    mcpkill checks semantic cache (~5 ms)\n       ↓                                    ↓\n2 400 tokens consumed               Cache hit → re-ranks stored chunks\n                                            ↓\n                                    380 tokens consumed  ← same answer\n```\n\n---\n\n## Benchmarks\n\nMeasured on a real session — 5 questions about a Rust codebase using `server-filesystem`:\n\n```\n                           Raw        Filtered    Saved\n  ──────────────────────────────────────────────────────\n  read_file proxy.rs       1 637 t      390 t     − 76%\n  read_file filter.rs      1 504 t      374 t     − 75%\n  read_file cache.rs       2 763 t      348 t     − 87%\n  read_file proxy.rs  ★      same       390 t     − 76%  ← cache hit, 0 ms\n  read_file filter.rs ★      same       374 t     − 75%  ← cache hit, 0 ms\n  ──────────────────────────────────────────────────────\n  Total                    9 045 t    1 876 t     − 79%\n\n  ★ similar follow-up question, served entirely from cache\n```\n\n**80% cache hit rate from the very first session.** The more you work on a codebase, the higher it gets.\n\n\u003e Savings depend on the MCP server. Servers that dump raw content (filesystem, GitHub, search)\n\u003e see 60–90%. Servers that already do smart retrieval (e.g. context7) see 20–35%\n\u003e from chunking alone.\n\n---\n\n## Install\n\n**Script (recommended — auto-detects OS and architecture):**\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/rustkit-ai/mcpkill/main/install.sh | sh\n```\n\n**Cargo:**\n\n```bash\ncargo install mcpkill\n```\n\n**Pre-built binaries** for macOS (Intel + Apple Silicon), Linux (x86_64 + aarch64), and Windows\nare available on the [Releases page](https://github.com/rustkit-ai/mcpkill/releases).\n\n\u003e On first run, the embedding model (~23 MB) downloads automatically to `~/.fastembed_cache`\n\u003e and is reused on every subsequent run. No GPU required.\n\n---\n\n## Quick start\n\n### One command per server\n\n```bash\nmcpkill install filesystem -- npx -y @modelcontextprotocol/server-filesystem ~/projects\nmcpkill install context7   -- npx -y @upstash/context7-mcp\nmcpkill install github     -- npx -y @modelcontextprotocol/server-github\n```\n\nThis pre-warms the embedding model, then registers the server in Claude Code under your user scope.\nRestart Claude — done. Verify with `claude mcp list`.\n\n### Manual config\n\nAdd `mcpkill --` in front of any MCP server command in `.claude/settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"filesystem\": {\n      \"command\": \"mcpkill\",\n      \"args\": [\"--\", \"npx\", \"-y\", \"@modelcontextprotocol/server-filesystem\", \"~/projects\"]\n    },\n    \"context7\": {\n      \"command\": \"mcpkill\",\n      \"args\": [\"--\", \"npx\", \"-y\", \"@upstash/context7-mcp\"]\n    },\n    \"github\": {\n      \"command\": \"mcpkill\",\n      \"args\": [\"--\", \"npx\", \"-y\", \"@modelcontextprotocol/server-github\"]\n    }\n  }\n}\n```\n\n---\n\n## How it works\n\nmcpkill intercepts every `tools/call` response over stdio — Claude never knows it's there.\n\n**First call (cache miss)**\n\n1. MCP server returns a large response\n2. mcpkill splits it into semantic chunks:\n   - Markdown → split by `#` / `##` / `###` headers\n   - JSON array → one chunk per element\n   - JSON object → one chunk per top-level key\n   - Plain text → split by blank lines\n3. Each chunk is embedded locally with `all-MiniLM-L6-v2` (~5 ms total, no network)\n4. The 4 most relevant chunks are returned to Claude\n5. All chunks are stored in `~/.mcpkill.db` (SQLite, no external services)\n\n**Subsequent calls (cache hit)**\n\n1. Query is embedded (~5 ms)\n2. Cosine similarity search across stored query embeddings\n3. If similarity ≥ 0.85 → cache hit\n4. Stored chunks are re-ranked against the new query, top-4 returned instantly\n5. The MCP server's response is discarded before it touches Claude's context\n\n**See your savings at any time:**\n\n```bash\nmcpkill stats\n```\n\n```\n┌─────────────────────────────────────────┐\n│           mcpkill cache stats            │\n├─────────────────────────────────────────┤\n│  Cache entries    47                     │\n│  Stored chunks    312                    │\n│  Cache hits       132  (80%)             │\n├─────────────────────────────────────────┤\n│  Tokens (original)   68 200              │\n│  Tokens (returned)    4 100              │\n│  Tokens saved       ~64 100  (94%)       │\n├─────────────────────────────────────────┤\n│  DB size          1.80 MB                │\n└─────────────────────────────────────────┘\n```\n\n---\n\n## Options\n\n```\nmcpkill [OPTIONS] -- \u003cCMD\u003e [ARGS...]\nmcpkill install \u003cNAME\u003e [--scope user|local|project] -- \u003cCMD\u003e [ARGS...]\nmcpkill stats [--json]\nmcpkill clear [--all | --expired | --older-than \u003cDAYS\u003e]\nmcpkill print-config\n```\n\n| Flag | Default | Description |\n|------|---------|-------------|\n| `--max-chunks` | `4` | Number of chunks returned per response |\n| `--threshold` | `0.85` | Cosine similarity threshold for cache hits |\n| `--ttl-days` | `7` | Evict entries not accessed in N days |\n| `--max-db-mb` | `100` | Max cache size in MB before LRU eviction |\n| `--cache-db` | `~/.mcpkill.db` | Path to the SQLite cache |\n| `--dry-run` | off | Log decisions without modifying responses |\n| `--stats-interval` | `0` | Print stats every N seconds (0 = off) |\n| `-v / --verbose` | off | Show cache hit/miss on stderr |\n\n**Persist settings in `~/.mcpkill.toml`** — CLI flags always win:\n\n```toml\nthreshold  = 0.80   # lower = more cache hits, less precise\nmax_chunks = 6      # more chunks = more context, more tokens\nttl_days   = 14     # increase for stable libraries\nmax_db_mb  = 200    # increase for large codebases\n```\n\n**Tuning guide:**\n\n| Situation | Adjustment |\n|-----------|------------|\n| Hitting cache on unrelated queries | Raise `--threshold` to `0.90` |\n| Missing hits on clearly similar queries | Lower `--threshold` to `0.80` |\n| Losing important detail in responses | Raise `--max-chunks` to `6` |\n| Library changes frequently (e.g. canary docs) | Lower `--ttl-days` to `1` |\n| Debugging unexpected behavior | `--dry-run --verbose` |\n\n---\n\n## Cache management\n\n```bash\nmcpkill clear --expired          # remove entries older than TTL\nmcpkill clear --older-than 14   # remove entries unused for 14+ days\nmcpkill clear --all             # wipe the entire cache\n```\n\n---\n\n## Privacy\n\nEverything runs locally. mcpkill never sends your code, queries, or embeddings anywhere.\nThe only network calls are the normal ones to your MCP servers.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\nMIT · built by [rustkit-ai](https://github.com/rustkit-ai)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustkit-ai%2Fmcpkill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustkit-ai%2Fmcpkill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustkit-ai%2Fmcpkill/lists"}