1. Conduid
  2. Science
  3. claude-webcache
MCP server · Science

claude-webcache

Cross-session WebFetch cache for Claude Code. SQLite, 7-day TTL, MCP plugin.

Unclaimed science
37Low

Scored 5 months ago · breakdown

About claude-webcache

claude-webcache is an MCP server in the Science category: cross-session WebFetch cache for Claude Code. SQLite, 7-day TTL, MCP plugin.

Install

Claude Code
claude mcp add claude-webcache -- npx -y @theyahia/claude-webcache
npx
npx -y @theyahia/claude-webcache

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Tools (9)

cache_clear`older_than_days?`, `confirm?`

Parameters not published.

cache_invalidate`url`

Parameters not published.

cache_list`limit?`, `offset?`, `global?`

Parameters not published.

cache_refresh`url`, `prompt`

Parameters not published.

cache_stats`global?`

Parameters not published.

cache_store`url`, `prompt`, `output`

Parameters not published.

cache_warm`entries: [{url,prompt}]` or `urls[]+prompt`

Parameters not published.

cached_fetch`url`, `prompt`

Parameters not published.

cached_search`query`

Parameters not published.

Ask AI

✦

Ask AI about claude-webcache

Powered by Claude · Grounded in docs

I know everything about claude-webcache. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

claude-webcache

npm npm downloads license tests

Persistent cross-session WebFetch cache for Claude Code. Cached reads in ~0.05ms — orders of magnitude faster than re-fetching.

Claude Code's built-in cache lasts 15 minutes, within one session. Every new session re-fetches from scratch. claude-webcache persists results across sessions in a local SQLite database — instant cache hits, zero network cost.

Session 1  →  WebFetch("docs.example.com")  →  fetched, auto-cached ✓
Session 2  →  cached_fetch("docs.example.com")  →  instant hit, no network call
Session 7  →  cached_fetch("docs.example.com")  →  still instant, unlimited TTL

v0.1.5+: every WebFetch is automatically saved via PostToolUse hook — nothing to configure.

Install

claude plugin marketplace add theYahia/claude-webcache && claude plugin install claude-webcache@theyahia

Works in: Claude Code CLI · Desktop (Mac/Windows) · VS Code extension · JetBrains plugin — same command everywhere.

Done. Every WebFetch is auto-cached from now on.

Optionally add the usage pattern to ~/.claude/CLAUDE.md to also check the cache before fetching (saves the WebFetch call entirely on repeat URLs).

Plugin TUI not working? There's an open Claude Code bug (#41653) where /plugin install rejects third-party sources with "source type not supported." Use the CLI command above — it bypasses the TUI and works fine.

Fallback (no marketplace):

git clone https://github.com/theYahia/claude-webcache && claude --plugin-dir ./claude-webcache/plugin

Option 2 — npm global

npm i -g @theyahia/claude-webcache

Requires Node.js 22.5+ (uses built-in node:sqlite — no native deps, no install step).

Then register in ~/.claude/settings.json (replace path with output of npm root -g):

{
  "mcpServers": {
    "claude-webcache": {
      "command": "node",
      "args": ["/path/from/npm-root-g/claude-webcache/scripts/mcp-server.cjs"]
    }
  },
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup|clear|compact",
        "hooks": [
          { "type": "command", "command": "node /path/from/npm-root-g/claude-webcache/scripts/hook-stats.cjs" }
        ]
      }
    ]
  }
}

Option 3 — clone (contributors)

See CONTRIBUTING.md.

Usage pattern (optional — for pre-fetch cache checks)

v0.1.5+ auto-caches every WebFetch automatically. The pattern below is optional: add it to ~/.claude/CLAUDE.md to also check the cache before making a WebFetch — this saves the WebFetch call entirely on repeat URLs.

## WebFetch caching (claude-webcache)

Before calling WebFetch, call `cached_fetch(url, prompt)` first.
- If it returns text → use that, do NOT call WebFetch.
- If it returns `[CACHE_MISS] <url>` → call WebFetch as normal (it will be auto-cached for next time).

Same URL + same prompt in any future session = instant hit, zero network cost.

Tools (MCP)

Tool Args Returns
cached_fetch url, prompt cached text, or [CACHE_MISS] <url>
cache_store url, prompt, output stored
cache_stats — { total, hits, last }
cache_list limit? recent URLs (most recent first)

SessionStart hook

Every new session injects a one-liner so Claude knows the cache exists:

webcache: 142 pages cached, 38 hits, last fetch 3h ago

No output if cache is empty.

Storage

SQLite at ~/.webcache/cache.db (WAL mode, concurrent-safe).
Cache key = SHA256(url + "|" + prompt). Default TTL: unlimited (set WEBCACHE_TTL_DAYS=N for N-day expiry).

Field Type
key TEXT PRIMARY KEY
url TEXT
prompt_hash TEXT
output TEXT
cached_at INTEGER (ms epoch)
hit_count INTEGER
last_hit_at INTEGER

Limits

  • Cache key includes the prompt — use consistent prompts to maximize hit rate.
  • Output is whatever WebFetch returns (already summarized). No re-processing.
  • No semantic search. Exact (url, prompt) match only.

Benchmarks

Single-process latency on a populated DB (N=10000 entries, 1KB output each), measured via npm run bench:

Op p50 p95 p99 ops/sec
read_hit 0.05ms 0.08ms 0.13ms 12,300
read_miss 0.01ms 0.03ms 0.05ms 69,700
write 0.06ms 0.12ms 1.30ms 8,100
list(50) 0.08ms 0.13ms 0.40ms 10,600

Storage overhead: ~1.9 KB per entry for a 1 KB payload (extra ≈ key + indexes + WAL).

WebFetch over the network typically takes 1-5 seconds — a cached hit is ~20,000-100,000× faster. Reproduce on your hardware: npm run bench. See bench/README.md for methodology and full results metadata (CPU, RAM, OS, commit) saved per run.

Related

  • claude-mem — persistent memory across sessions (complements claude-webcache: memory vs. web cache)
  • WWmcp — catalog of 120+ MCP servers for non-Western APIs

License

MIT — see LICENSE.

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About claude-webcache

How do I install claude-webcache?

Run claude mcp add claude-webcache -- npx -y @theyahia/claude-webcache, then add the server to your MCP client's configuration.

Is claude-webcache safe to use with an AI agent?

Its trust score is 37 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is claude-webcache still maintained?

Conduid hasn't recorded a commit date for this repository yet. Check the repository directly for recent activity.