Semantic Cache MCP
File cache for coding agents: re-reads cost ~40 tokens, changed files return diffs.
Installation
Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).
semantic-cache-mcpclaude mcp add semantic-cache-mcp -- uvx semantic-cache-mcp==0.7.0
{
"mcpServers": {
"semantic-cache-mcp": {
"command": "uvx",
"args": [
"semantic-cache-mcp==0.7.0"
]
}
}
}
Documentation
Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.
Semantic Cache MCP
Stop paying for the same file twice.
An MCP file cache for AI coding agents: a re-read costs ~40 tokens instead of the whole file.
Coding agents read the same files over and over: before an edit, after an edit, after every context compaction. A built-in Read sends the whole file each time. Semantic Cache MCP knows what your agent already holds. Measured on one 7,891-token file:
| Read | Built-in Read | Semantic Cache MCP |
|---|---|---|
| First read | 7,891 tokens | full file, plus a hash |
| Re-read, file unchanged | 7,891 tokens | 77 tokens |
| Re-read after a one-line edit | 7,891 tokens | 137 tokens (a diff) |
Across a 48-file project it saves 98.7% of re-read tokens, and an unchanged read takes 0.17 ms. It also gives your agent grep, BM25 search and glob over the cache, atomic edits with dry_run, and token-budgeted batch reads. Three runtime dependencies, no API keys, no GPU.
Quick start
You need uv. In Claude Code:
claude mcp add semantic-cache --scope user -- uvx semantic-cache-mcp
Any other client (Cursor, Claude Desktop, and others that take mcpServers JSON):
{
"mcpServers": {
"semantic-cache": {
"command": "uvx",
"args": ["semantic-cache-mcp"]
}
}
}
Configs for VS Code, Codex and OpenCode, and how to turn off the built-in file tools so the agent uses the cache: docs/clients.md.
How it works
Every file the server sends comes with a content_hash. The agent passes it back as known_hash on the next read:
flowchart LR
R["read(path, known_hash)"] --> M{"hash matches<br/>the file now?"}
M -- yes --> U["unchanged<br/>~40 tokens"]
M -- "no, older version" --> D["diff of changed lines"]
M -- "no hash" --> F["full file + content_hash"]
- No stale content. Every read checks the file on disk first.
unchangedonly answers when the hash matches the current bytes. - Forgetting is safe. After a compaction, the agent reads without the hash and gets the full file back.
- Large files become maps. A file over
max_sizereturns an outline of its definitions, not a blind cut. - Everything stays local. The cache is a SQLite file. One background daemon serves every client on your machine.
Tools
read · batch_read · read_image · write · edit · batch_edit · edit_preview · delete · warm · grep · search · glob · stats · clear
Parameters and examples: docs/tools.md.
FAQ
Is the search "semantic" in the embeddings sense? No. search is BM25 keyword ranking and grep is exact. No model to download, no GPU, no API key.
Does it send my code anywhere? No. The only network request is a one-time download of the o200k tokenizer file, checked against a SHA-256 hash.
Does it work on Windows? Yes. CI runs on Linux and macOS.
Documentation
| Guide | Covers |
|---|---|
| Clients | Setup for each client, turning off built-in file tools |
| Tools | Every tool, with parameters and examples |
| Environment Variables | Every setting, with defaults |
| Performance | Benchmarks and methodology |
| Architecture | Storage, algorithms, the shared daemon |
| Security | Threat model, size limits, path handling |
| Troubleshooting | Common issues, debug logging |
| Advanced Usage | Python API |
Contributing
git clone https://github.com/CoderDayton/semantic-cache-mcp.git
cd semantic-cache-mcp
uv sync --extra dev
uv run pytest
See CONTRIBUTING.md. Issues and pull requests are welcome.
License
MIT.
Questions fréquentes
Qu'est-ce que Semantic Cache MCP ?
File cache for coding agents: re-reads cost ~40 tokens, changed files return diffs.
Comment installer Semantic Cache MCP ?
Il s'exécute sur votre machine. Dans Claude Code : claude mcp add semantic-cache-mcp -- uvx semantic-cache-mcp==0.7.0. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.
Faut-il une clé API pour Semantic Cache MCP ?
Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.
Semantic Cache MCP est-il open source ?
Oui. Son code est sur GitHub sous licence MIT.
Qui maintient Semantic Cache MCP ?
Il est publié par CoderDayton. AI.tn le référence sans le maintenir ni le recommander.
Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.