nextjs-cache-handler-mcp

v0.1.2
io.github.leejpsd/nextjs-cache-handler-mcp Checked 1 hour ago Published 4 months ago

Inspect 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_inspect

Decode a cache entry: kind, timestamps, tags, TTL, sizes, compression. Values are summarized, never dumped in full.

ParameterTypeDescription
key *stringFull 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?'

ParameterTypeDescription
tag *string

explain_key

Parse a Redis key into layer / kind / namespace / cache key.

ParameterTypeDescription
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.

ParameterTypeDescription
expireSec *number0 means 'never hard-expire'
revalidateSec *number
timestampMs *numberentry.timestamp (ms epoch)
nowMsnumber

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.

ParameterTypeDescription
tag *string
confirmboolean
modestring