# claude-webcache [Health: Active]

**Category:** 🔎 Search & Data Extraction  
**Repository:** https://github.com/theYahia/claude-webcache  
**GitHub Stars:** 1  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/claude-webcache

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

## Tools
Capabilities this server exposes over MCP:

- **cached_fetch** — cached text, or `[CACHE_MISS] <url>
- **cached_search** — cached WebSearch results, or `[CACHE_MISS] <query>` (websearch namespace, short TTL)
- **cache_store** — stored
- **cache_stats** — { namespace, total, hits, misses, hit_rate, last, db_size_bytes, evicted, oversize_skipped, last_hook_error_at, top_urls, ... }
- **cache_list** — recent URLs (most recent first)
- **cache_invalidate** — { deleted: N }` — drops every entry for that URL in current namespace
- **cache_clear** — { deleted: N }` — partial wipe by age, or full wipe with `confirm:"YES"
- **cache_warm** — { hits, misses, invalid }` — bulk pre-flight in one call
- **cache_refresh** — [CACHE_MISS] <url>` — invalidates and signals re-fetch

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/theYahia/claude-webcache), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

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

## Documentation

## What claude-webcache MCP server does

The claude-webcache MCP server provides a persistent cache for Claude Code web retrievals. It stores fetched output with the requested URL and prompt, allowing later sessions to reuse matching results instead of fetching the same content again. WebSearch results use a separate namespace and a shorter default lifetime than ordinary fetch entries.

The cache is stored locally at `~/.webcache/cache.db`. Entries can be inspected, invalidated, refreshed, or removed through MCP tools and the package CLI. Projects can use separate namespaces so entries from one project are not returned to another.

## How it works

A pre-tool hook checks the cache before `WebFetch` and `WebSearch`. On a matching entry, the cached content is returned and the network operation is skipped. On a miss, the normal operation runs, and a post-tool hook stores its output for future sessions. Automatic reads can be disabled with `WEBCACHE_AUTOREAD=0`.

Manual calls are also available. `cached_fetch` and `cached_search` return cached content when present, or a `[CACHE_MISS]` marker when no matching entry exists. `cache_warm` checks multiple URLs or URL-and-prompt pairs in one operation, while `cache_refresh` invalidates an entry and signals that it should be fetched again.

## Setup and configuration

The plugin can be installed through the Claude marketplace, loaded from a local clone, or installed globally from npm. The npm installation requires Node.js 22.5 or newer and uses the built-in `node:sqlite`, so it does not require native dependencies.

The claude-webcache MCP server supports Claude Code CLI, Claude Desktop on Mac and Windows, the VS Code extension, and the JetBrains plugin. The package also includes a command-line binary and a local dashboard available through `claude-webcache dashboard`.

Useful settings include `WEBCACHE_TTL_DAYS` for a global expiration period, `WEBCACHE_DOMAIN_TTL` for domain-specific expiration, and `WEBCACHE_NAMESPACE` for project isolation. `WEBCACHE_MAX_SIZE_MB` enables size-based eviction, while `WEBCACHE_MAX_OUTPUT_MB` skips responses above a configured size. Compression, debug output, quiet hooks, and search-specific expiration are also configurable.

## Tools and capabilities

Available MCP tools include:

- `cached_fetch` and `cached_search` for reading cached fetches and searches.
- `cache_store` for explicitly saving output.
- `cache_stats` and `cache_list` for usage statistics and recent URLs.
- `cache_invalidate` for deleting entries for one URL.
- `cache_clear` for age-based deletion or a confirmed full wipe.
- `cache_warm` for bulk cache checks.
- `cache_refresh` for invalidating a URL and requesting a new fetch.

The CLI adds namespace inspection, metadata export, per-domain statistics, pagination, log cleanup, and dashboard access.

## Limitations and notes

Stored URLs are redacted for display by default when they contain obvious credentials or sensitive query parameter names, but the cache key still uses the original URL. `WEBCACHE_STRICT_REDACT=1` makes the key use the redacted URL; this can cause different token values to share one entry and is unsafe for personalized endpoints. Header-based authentication is preferred, and the local database should not be committed to source control.

Cache misses still require the normal WebFetch or WebSearch operation, and entries may be skipped when they exceed the configured output limit.

_Full upstream README: https://allmcps.com/mcp/claude-webcache/readme_

