Reduces token costs for AI coding agents by providing a local file cache that returns diffs or minimal updates instead of full file re-reads.
Also known as CoderDayton/semantic-cache-mcp, semantic-cache-mcp
- Stars
- 3
- Tools
- —
- Downloads, 30 days
- 480
- Latest version
- 0.7.0
- Last commit
- Oct 23, 2026
- License
- MIT
What is Semantic Cache MCP?
Semantic Cache reduces token costs for AI coding agents by providing a local file cache that returns diffs or minimal updates instead of full file re-reads.
Summary generated from the project's README
About Semantic Cache MCP server
Reducing token costs for AI coding agents is the primary goal of Semantic Cache MCP. It provides a local file cache that allows agents to retrieve minimal updates or diffs instead of re-reading entire files. This is particularly useful for developers using agents like Claude Code or Cursor that frequently access the same files during context compaction or after edits. By using a content hash system, the server identifies if a file has changed and only sends the necessary differences, which can reduce re-read costs from thousands of tokens to just a few dozen.
The server runs locally using a SQLite file and a background daemon that serves all clients on your machine. It requires no API keys, no GPU, and no external model downloads, ensuring your code stays private. You can set it up using uvx or by adding it to your mcpServers JSON configuration. The toolset includes specialized commands such as read, batch_read, edit, grep, and BM25 search to help agents navigate projects efficiently without exhausting token budgets.
What you can do with it
- 1Perform efficient codebase searchesDevelopers can instruct an agent to find specific patterns or keywords across the cached files using specialized search tools.
- 2Manage large file contextWhen dealing with massive files, the server provides an outline of definitions rather than a full text dump.
- 3Execute safe code modificationsAn agent can test file changes using a dry run before committing them to the disk.
Written from the project's README. Every use case is checked against a quote from it.
How to install Semantic Cache MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Semantic Cache MCP in Claude Code
$ claude mcp add semantic-cache-mcp -- uvx semantic-cache-mcpInstall Semantic Cache MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"semantic-cache-mcp": {
"command": "uvx",
"args": [
"semantic-cache-mcp"
]
}
}
}Install Semantic Cache MCP in VS Code
.vscode/mcp.json
{
"servers": {
"semantic-cache-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"semantic-cache-mcp"
]
}
}
}Install Semantic Cache MCP in VS Code CLI
$ code --add-mcp '{"name":"semantic-cache-mcp","type":"stdio","command":"uvx","args":["semantic-cache-mcp"]}'Install Semantic Cache MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"semantic-cache-mcp": {
"command": "uvx",
"args": [
"semantic-cache-mcp"
]
}
}
}Install Semantic Cache MCP in Codex
$ codex mcp add semantic-cache-mcp -- uvx semantic-cache-mcpInstall Semantic Cache MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.semantic-cache-mcp] command = "uvx" args = ["semantic-cache-mcp"]
Install Semantic Cache MCP in Gemini CLI
$ gemini mcp add -s user semantic-cache-mcp uvx -- semantic-cache-mcpInstall Semantic Cache MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"semantic-cache-mcp": {
"command": "uvx",
"args": [
"semantic-cache-mcp"
]
}
}
}Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablecoderdayton/semantic-cache-mcp is public and reachablegithub.com/coderdayton/semantic-cache-mcp ↗Pass
- Package names this repository as its sourcesemantic-cache-mcp names coderdayton/semantic-cache-mcp as sourcepypi.org/project/semantic-cache-mcp/ ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for semantic-cache-mcppypi.org/project/semantic-cache-mcp/ ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-10-23github.com/coderdayton/semantic-cache-mcp ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from semantic-cache-mcpPass
- No critical advisory in the package or its dependencies65 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubCoding 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.
Semantic Cache MCP questions
How do I add Semantic Cache MCP to Claude Code?
Run claude mcp add semantic-cache-mcp -- uvx semantic-cache-mcp in your terminal. Add --scope user to make it available in every project.
How do I add Semantic Cache MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
Is the search semantic using embeddings?
No, the search functionality uses BM25 keyword ranking and grep for exact matches, requiring no model downloads or GPUs.
Does this server send my code to an external service?
No, everything stays local using a SQLite file. The only network request is a one-time download of the o200k tokenizer file.
Does it work on Windows?
Yes, the server is compatible with Windows.