Nextjs Cache Handler Mcp

io.github.leejpsdPublished by GitHub account leejpsdv0.1.2Updated Oct 24, 2026

Inspect and operate Next.js Redis caches: health, tag state, SWR simulation, safe invalidation.

Overview

AI-generated overview

Inspects and operates Next.js Redis caches over local stdio, covering health, tag state, SWR simulation and safe invalidation.

What you can do
Check Redis cache health and list what is cached per layer and kind. Search cache keys by pattern and parse a raw Redis key into layer, kind, namespace and key. Decode a single entry to see its kind, age, tags, TTL, compression and sizes. Query whether a tag is invalidated on both cache layers and simulate whether an entry is fresh, stale or expired on read. Invalidate a tag softly or hard, dry-run by default and only executed with explicit confirmation.
When to use it
Use it when a Next.js deployment runs @leejpsd/nextjs-cache-handler on Redis and you need to find out why a page is not updating, whether a tag is invalidated, or how a cache entry will behave on read.
Requirements
Runs locally as an npm package via npx and needs network access to Redis. REDIS_URL is required; DEPLOYMENT_VERSION is recommended to scope the namespace. CACHE_KEY_PREFIX or ISR_KEY_PREFIX are needed only for custom prefixes, and HASH_TAG for Redis Cluster with hashTag. Redis inside a VPC such as ElastiCache needs an SSH tunnel or bastion.
Before you install
Requires a Redis connection string (REDIS_URL), a sensitive credential that should be supplied through the environment and kept private. invalidate_tag changes cache data; it is a dry run by default but will invalidate tags once confirmed. The server connects to your own Redis, so point it at the intended deployment namespace to avoid affecting other environments.

Installation

In SourceWeft

  1. Open Nextjs Cache Handler Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

@leejpsd/nextjs-cache-handler-mcp

MCP (Model Context Protocol) server for @leejpsd/nextjs-cache-handler Redis caches. Lets AI agents (Claude Code, Cursor, …) inspect and operate a running deployment's Next.js cache: "why isn't this page updating?" becomes a tag_state call instead of guesswork.

Setup

Project .mcp.json (Claude Code picks this up automatically):

json
{  "mcpServers": {    "nextjs-cache": {      "command": "npx",      "args": ["-y", "@leejpsd/nextjs-cache-handler-mcp"],      "env": {        "REDIS_URL": "redis://127.0.0.1:6379",        "DEPLOYMENT_VERSION": "your-deploy-id"      }    }  }}

Runs locally over stdio and connects to YOUR Redis — nothing is hosted.

AWS/ElastiCache note: ElastiCache is VPC-internal, so a locally running MCP server needs an SSH tunnel/bastion (point REDIS_URL at the tunnel). Agents running inside the VPC (CI, in-cluster) connect directly. Pair with the AWS agent skills/MCP: they handle the infrastructure, this server handles cache semantics.

Tools

ToolWhat it answersWrites?
cache_healthIs Redis up? What's cached, per layer/kind?no
cache_searchWhich keys match this pattern?no
cache_inspectDecode one entry: kind, age, tags, TTL, compression, sizesno
tag_stateIs this tag invalidated right now, on BOTH cache layers?no
explain_keyParse a raw Redis key into layer/kind/namespace/keyno
simulate_swrWould this entry be fresh / stale / expired, and what happens on read?no
invalidate_tagSoft (SWR) or hard invalidation — dry-run unless confirm: truegated

Env: REDIS_URL (required), DEPLOYMENT_VERSION (recommended — scopes namespace-aware tools), CACHE_KEY_PREFIX / ISR_KEY_PREFIX (only when the handlers use custom prefixes).

Source: mcp/README.md at commit 348ec05

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.2LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts