cache-mcp
Provides tools to get, set, and delete key-value entries in a Redis-compatible cache, with TTL support, per-user key namespacing, and optional global prefixes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cache-mcpcache 'hello world' under key greeting for user alice with a 1 hour TTL"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cache-mcp
MCP server that exposes a key-value cache (Valkey / Redis compatible) as tools over the Model Context Protocol.
Features
Three MCP tools:
cache_get,cache_set,cache_deletePer-user key namespacing via
user_idOptional global prefix (
CACHE_PREFIX) to avoid collisions when sharing a Redis instanceTTL support on
cache_setTwo transports: SSE (
/sse+/messages) and direct HTTP (/mcp,/)Health check at
/healthStateless — bring your own Redis
Related MCP server: Recall Select
Installation
Docker (recommended)
docker pull ghcr.io/dolphin2702/cache-mcp:latest
From source (uv / uvx)
uvx --from "git+https://github.com/dolphin2702/cache-mcp.git@v0.1.0" cache-mcp
From source (pip)
pip install "git+https://github.com/dolphin2702/cache-mcp.git@v0.1.0" cache-mcp
Configuration
Variable | Default | Description |
|
| Cache backend host |
|
| Cache backend port |
|
| Redis DB index |
|
| Prefix added to every key. Useful when sharing a Redis instance with other apps (e.g. Mailu). |
|
| Bind address |
|
| HTTP port |
Deployment examples
Scenario File Connect to an existing Redis examples/docker-compose.external-redis.yml Bundled Redis (quick try-out) examples/docker-compose.bundled-redis.yml Share Redis with Mailu examples/docker-compose.mailu-redis.yml Sharing Redis with another app? Set CACHE_PREFIX=cachemcp: or use a separate CACHE_DB to avoid key collisions.
MCP Client Configuration
SSE transport
{ "mcpServers": { "cache-mcp": { "url": "http://localhost:3002/sse" } } }
stdio via uvx
{ "mcpServers": { "cache-mcp": { "command": "uvx", "args": ["--from", "git+https://github.com/dolphin2702/cache-mcp.git@v0.1.0", "cache-mcp"], "env": { "CACHE_HOST": "192.168.203.2", "CACHE_PORT": "6379", "CACHE_PREFIX": "cachemcp:" } } } }
Tools
cache_get
Get a value from cache.
Arguments:
key (string, required)
user_id (string, default "default") Returns: value or "null".
cache_set
Store a value with TTL.
Arguments:
key (string, required)
value (string, required)
ttl (integer, default 3600 seconds)
user_id (string, default "default") Returns: "ok".
cache_delete
Delete a key.
Arguments:
key (string, required)
user_id (string, default "default") Returns: "ok".
HTTP API
Variable | Default | Description |
|
| Cache backend host |
|
| Cache backend port |
|
| Redis DB index |
|
| Prefix added to every key. Useful when sharing a Redis instance with other apps (e.g. Mailu). |
|
| Bind address |
|
| HTTP port |
Key format
Final Redis key:
{CACHE_PREFIX}{user_id}:{key}
Example with CACHE_PREFIX=cachemcp:, user_id=alice, key=session:
cachemcp:alice:session
Development
git clone git@github.com:dolphin2702/cache-mcp.git cd cache-mcp python3 -m venv .venv source .venv/bin/activate pip install -e . cache-mcp
License
MIT
Related MCP Connectors
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
MCP-first toolbox for agents: KV storage, auth, queue, and utility tools. Free in early access.
Cross-tool persistent memory and context for AI assistants over MCP.
- JustOnceOAuthai.justonce
Persistent memory for AI assistants — one shared, OAuth-secured vault for every MCP client.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables key-value storage operations using multiple backends (memory, filesystem, redis, MongoDB, HTTP) via MCP tools like get, set, and list.22 npm1MIT
- AlicenseNot gradedqualityBmaintenanceProvides long-term memory for AI agents via MCP tools to store, recall, and delete memories, with per-user scoping and usage limits.AGPL 3.0
- AlicenseNot gradedqualityAmaintenanceDurable, user-keyed state management for stateless MCP servers. Enables agents to persist and resume state across conversations, clients, and devices.MIT
- AlicenseBqualityBmaintenanceProvides owner-bound secure storage and retrieval of tool outputs via MCP tools, enabling trusted persistence for agents like Claude Code, Codex CLI, and OpenCode.2MIT