llmcache MCP server

llmcache MCP server

llmcache-site•bysp98

An MCP server that caches compact summaries of source files so clients can reuse understanding across sessions instead of re-reading full files.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Serves cached file summaries through MCP tools, returning a compact summary on a cache hit and generating a fresh summary on a miss.
  • •Invalidates cached summaries when a file's git hash changes.
  • •Exposes tools for file summaries, package-level overviews, extracting a specific function or type, and listing cached summaries.
  • •Stores its cache locally in SQLite and reports savings through CLI stats commands.

BEST FOR

  • •Reducing token costs when a coding assistant repeatedly consults the same source files across a session.
  • •Pre-warming a cache for a repository so the first session starts with summaries available.
  • •Getting package-level overviews of a directory in a single MCP call.

ABOUT LLMCACHE-SITE

llmcache MCP server is cataloged as an MCP server attributed to sp98. An MCP server that caches compact summaries of source files so clients can reuse understanding across sessions instead of re-reading full files. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for llmcache MCP server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does llmcache decide when a cached summary is stale?

It compares the file's git hash; if the hash no longer matches, summaries are automatically invalidated.

Where is the cache stored?

The cache is stored locally in SQLite, with a configurable database path.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 1f67e3191d42 · 采集于 2026-11-13 11:46:47 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

llmcache

Stop paying Claude to understand the same code it already understood yesterday.

llmcache is an MCP server that caches AI-generated understanding of your source code. Claude reads each file once and every session after that starts from cached understanding, saving you tokens and money.

Why It Matters

Claude Code uses a stateless API. On every turn, the entire conversation history, including every file Claude has read, is re-sent as input tokens. A 1,000-token file read on turn 1 costs you 1,000 input tokens on every subsequent turn for the rest of the session.

llmcache replaces that 1,000-token file with a 50-token summary. You save 950 tokens on every turn, not just once.

On top of that, Claude generates output tokens to process each file. With a cached summary, Claude skips that work entirely. Output tokens cost 5x more than input tokens.

Without llmcache:
  Turn 1: prompt + file.go (1,000 tokens)        > you pay for 1,000
  Turn 5: prompt + file.go still in history       > you pay for 1,000 again
  Turn 10: still carrying it                      > and again

With llmcache:
  Turn 1: prompt + summary (50 tokens)            > you pay for 50
  Turn 5: summary still in history                > you pay for 50
  Turn 10: still just 50 tokens                   > 95% smaller

Prerequisites

  • Claude Code (only supported client)
  • Git (used for cache invalidation)
  • One of:
    • Anthropic API key (ANTHROPIC_API_KEY)
    • GCP project with Vertex AI API enabled + gcloud auth application-default login

Install

Download the binary for your platform:

# macOS (Apple Silicon)
curl -L -o llmcache https://github.com/sp98/llmcache-site/releases/latest/download/llmcache-darwin-arm64

# macOS (Intel)
curl -L -o llmcache https://github.com/sp98/llmcache-site/releases/latest/download/llmcache-darwin-amd64

# Linux (x86_64)
curl -L -o llmcache https://github.com/sp98/llmcache-site/releases/latest/download/llmcache-linux-amd64
chmod +x llmcache
sudo mv llmcache /usr/local/bin/

How It Works

  1. Claude Code calls understand_file (via MCP) instead of Read
  2. llmcache checks if a cached summary exists and is still fresh (git hash match)
  3. Cache hit: returns the compact summary (typically 90%+ smaller than the full file)
  4. Cache miss: calls Claude Haiku to generate a summary, caches it, returns it

Summaries auto-invalidate when the file's git hash changes.

Setup

Local cache stored in SQLite. No server, no license key needed.

1. Add the MCP server

claude mcp add --transport stdio llmcache -- llmcache mcp

For Vertex AI users, pass the region:

claude mcp add \
  --env CLOUD_ML_REGION=us-east5 \
  --transport stdio llmcache -- llmcache mcp

2. Add the Read hook

This hook tells Claude to use understand_file instead of reading source files directly. Add to ~/.claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Read",
        "hooks": [
          {
            "type": "command",
            "command": "F=$(cat | grep -o '\"file_path\":\"[^\"]*\"' | head -1 | cut -d'\"' -f4); B=${F##*/}; E=${F##*.}; case \"$B\" in Makefile|makefile|GNUmakefile) echo '{\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Use understand_file from llmcache instead.\"}';; *) case \"$E\" in go|py|js|ts|tsx|jsx|rs|java|c|cpp|cc|h|hpp|rb|sh|proto|sql|md) echo '{\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Use understand_file or understand_package from llmcache instead.\"}';; esac;; esac"
          }
        ]
      }
    ]
  }
}

3. Add the CLAUDE.md instruction

Append to ~/.claude/CLAUDE.md:

MANDATORY: ALWAYS use understand_file or understand_package from the
llmcache MCP server instead of Read to understand source files.
Only use Read when you need exact line numbers for editing.

4. Verify

Restart Claude Code, use it on a project, then check savings:

llmcache stats
llmcache stats --detail    # per-file breakdown
llmcache stats --monthly   # month-by-month

Configuration

Optional settings via env vars or ~/.llmcache/config.yaml:

Env VarDefaultDescription
LLMCACHE_DB~/.llmcache/data.dbSQLite database path
LLMCACHE_LOG_DIR~/.llmcache/Log directory
LLMCACHE_SUMMARY_MODELclaude-haiku-4-5@20251001Model for generating summaries

Team Mode (Coming Soon)

In Solo mode, each developer builds their own cache from scratch. When developer A understands a file, developer B still pays full tokens to understand the same file. With Team mode, summaries are shared: one developer pays the generation cost, everyone else gets instant cache hits. The more developers on the team, the faster the cache warms up and the greater the savings.

CLI Commands

CommandDescription
llmcache mcpStart the MCP server (spawned automatically by Claude Code).
llmcache statsShow cache hits, input/output tokens saved. Use --detail for per-file breakdown, --monthly for trends.
llmcache index <repo>Pre-index a repository so the first session starts with a warm cache. Use -w 10 for parallel workers, --include "*.go" to filter.
llmcache gcRemove stale summaries. Use --max-age 720h to set retention, --dry-run to preview.

MCP Tools (used by Claude Code automatically)

ToolDescription
understand_fileReturns a cached summary of a source file. If the file has changed (git hash mismatch), generates a fresh summary. If uncommitted, tells Claude to read directly.
understand_packageSummarizes all source files in a directory, giving Claude a package-level overview in one call.
get_file_detailExtracts a specific function or type from a file. Uses Go AST for Go files, pattern search for others.
list_summariesLists all cached summaries for a repository with hit counts and freshness.

Bugs & Feedback

Found a bug or have a feature request? Open an issue on GitHub.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for llmcache MCP server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/llmcache-site)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools