nextjs-cache-handler-mcp
v0.1.2Inspect and operate Next.js Redis caches: health, tag state, SWR simulation, safe invalidation.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
cache_health
Ping Redis and summarize cache key counts per layer/kind. First tool to run when debugging cache issues.
cache_search
Scan cache keys by glob pattern (e.g. 'next-incremental:entry:*/blog*'). Returns up to `limit` keys.
| Parameter | Type | Description |
|---|---|---|
pattern * | string | Redis MATCH glob, e.g. next-cache:entry:* |
limit | integer |
cache_inspect
Decode a cache entry: kind, timestamps, tags, TTL, sizes, compression. Values are summarized, never dumped in full.
| Parameter | Type | Description |
|---|---|---|
key * | string | Full Redis key of a cache entry |
tag_state
Show invalidation state for a tag across BOTH cache layers: the ISR tag state (stale/expired timestamps) and the 'use cache' tag-expiration marker. Answers 'is this tag invalidated right now, and since when?'
| Parameter | Type | Description |
|---|---|---|
tag * | string |
explain_key
Parse a Redis key into layer / kind / namespace / cache key.
| Parameter | Type | Description |
|---|---|---|
key * | string |
simulate_swr
Given entry timing values, classify freshness the way the handler does (fresh / stale / expired) and explain what a read would do.
| Parameter | Type | Description |
|---|---|---|
expireSec * | number | 0 means 'never hard-expire' |
revalidateSec * | number | |
timestampMs * | number | entry.timestamp (ms epoch) |
nowMs | number |
invalidate_tag
Invalidate a tag across both layers. DRY-RUN by default: shows exactly what would be written/deleted. Pass confirm=true to execute. mode 'soft' = stale-while-revalidate (revalidateTag(tag,'max') semantics); 'hard' = delete entries now.
| Parameter | Type | Description |
|---|---|---|
tag * | string | |
confirm | boolean | |
mode | string |