Upstash MCP Server: Manage Redis with Natural Language
Manage Redis on Upstash with natural language using the MCP server to run commands, monitor data, and streamline database administration.
npx -y @upstash/mcp-serverOverview
The Upstash MCP Server provides an MCP (Model Context Protocol) compliant API that lets developers manage Upstash Redis instances using natural language and programmatic tool calls. It exposes a small HTTP service that maps high-level requests into Redis operations, and can be used by LLM-based agents or directly by tooling to run commands, inspect keys, and monitor data without embedding Redis credentials in many places.
For developers building chatops, admin dashboards, or AI assistants, the server simplifies Redis administration: it registers a set of Redis-focused tools (get/set/scan/execute/statistics), describes them in an MCP format, and executes them securely against your Upstash database. This reduces friction when integrating Redis into model-driven workflows and helps surface database state to models in a controlled way.
Features
- MCP-compliant HTTP API that exposes Redis operations as tools
- Natural language support (optional LLM integration) to translate conversational requests to Redis commands
- Built-in tool set: get, set, delete, scan, keys, execute (arbitrary Redis commands), and basic stats
- Works with Upstash Redis via REST credentials (TLS + token-based auth)
- Docker-ready and simple local development (Node.js)
- Access control and auditing hooks to limit and log operations
Installation / Configuration
Prerequisites:
- Node.js 18+ or Docker
- Upstash Redis REST URL and token
- Optional: an LLM API key (e.g., OpenAI) to enable natural language translation
Clone and install dependencies:
Create a .env file in the project root with your Upstash credentials and server options:
PORT=8080
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=your_upstash_token_here
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4o-mini
Start the server locally:
# or for production
Run with Docker:
By default the server listens on PORT (8080). Configure environment variables to match your deployment.
Available Tools / Resources
The server exposes a set of Redis-focused tools in MCP form. Common tool names and behaviors:
| Tool Name | Purpose |
|---|---|
| redis.get | Retrieve the value of a key |
| redis.set | Set the value of a key (with optional TTL) |
| redis.del | Delete a key |
| redis.scan | Incrementally scan for keys (cursor-based) |
| redis.exec | Execute an arbitrary Redis command (use with care) |
| redis.info | Fetch server stats and info |
| redis.monitor | Lightweight monitoring / tail of recent commands (if enabled) |
Typical MCP endpoints (defaults; check your deployment):
- GET /mcp/tools — list available tools and their input/output schemas
- POST /mcp/run — execute a named tool with JSON arguments
Example: fetch tool list
Example: run a tool (GET key “user:123”)
If you enable LLM integration, you can also POST a natural language prompt and let the server translate it to tool invocations:
(Implementation depends on whether you supply OPENAI_API_KEY; the server will call your LLM and map the response to tool executions.)
Use Cases
- ChatOps for Redis: connect a Slack bot or internal chat assistant to the MCP Server so engineers can query keys, inspect counters, or clear caches with natural language.
- Safe LLM-assisted administration: allow an LLM agent to run read-only exploration (scan/get/info) and limited write operations (set/del) under an auditable gateway rather than giving the model direct database credentials.
- Data exploration and debugging: developers can ask for recent keys, sample values, or usage stats during incident response without switching clients.
- Automation