Upstash Redis MCP

Upstash Redis MCP

Lightweight MCP server for Redis that allows running any Redis command and searching Redis documentation. Supports multiple named databases with HTTP/REST or TCP transport.

Category
访问服务器

README

<div align="center">

Upstash Redis MCP

</div>

Add to Cursor

Lightweight MCP server for Redis with only two tools:

  • 🧪 redis_run_commands: run one or more Redis commands over HTTP/REST or TCP, as a pipeline or an atomic transaction.
  • 📚 redis_search_docs: search the Redis docs using Context7 public api.

One server can hold multiple named databases. Configuration is pure environment variables and CLI flags.

🔌 Quickstart

<details> <summary><b>Claude Code</b></summary>

Run this in your terminal. See the Claude Code MCP docs for more.

claude mcp add upstash-redis \
  -e UPSTASH_REDIS_REST_URL=https://<your-db>.upstash.io \
  -e UPSTASH_REDIS_REST_TOKEN=<your-rest-token> \
  -- npx -y @upstash/redis-mcp

</details>

<details> <summary><b>Cursor</b></summary>

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project), or go to Settings → MCP → Add new MCP server. See the Cursor MCP docs.

{
  "mcpServers": {
    "upstash-redis": {
      "command": "npx",
      "args": ["-y", "@upstash/redis-mcp"],
      "env": {
        "UPSTASH_REDIS_REST_URL": "https://<your-db>.upstash.io",
        "UPSTASH_REDIS_REST_TOKEN": "<your-rest-token>"
      }
    }
  }
}

</details>

<details> <summary><b>VS Code</b></summary>

Add to .vscode/mcp.json (per-project) or your user mcp settings. See the VS Code MCP docs.

{
  "servers": {
    "upstash-redis": {
      "command": "npx",
      "args": ["-y", "@upstash/redis-mcp"],
      "env": {
        "UPSTASH_REDIS_REST_URL": "https://<your-db>.upstash.io",
        "UPSTASH_REDIS_REST_TOKEN": "<your-rest-token>"
      }
    }
  }
}

</details>

<details> <summary><b>Codex</b></summary>

Add to ~/.codex/config.toml (or a project-level .codex/config.toml). See the Codex MCP docs.

[mcp_servers.upstash-redis]
command = "npx"
args = ["-y", "@upstash/redis-mcp"]
env = { UPSTASH_REDIS_REST_URL = "https://<your-db>.upstash.io", UPSTASH_REDIS_REST_TOKEN = "<your-rest-token>" }

</details>

<details> <summary><b>OpenCode</b></summary>

Add to opencode.json (project) or ~/.config/opencode/opencode.json (global). See the OpenCode MCP docs.

{
  "mcp": {
    "upstash-redis": {
      "type": "local",
      "command": ["npx", "-y", "@upstash/redis-mcp"],
      "environment": {
        "UPSTASH_REDIS_REST_URL": "https://<your-db>.upstash.io",
        "UPSTASH_REDIS_REST_TOKEN": "<your-rest-token>"
      }
    }
  }
}

</details>

[!TIP] Any MCP-compatible client works. If yours isn't listed, add a stdio server that runs npx -y @upstash/redis-mcp with the two env vars above.

🧰 Tools

🧪 redis_run_commands

Run any Redis command: GET, SET, SCAN, ZADD, EVAL, the SEARCH.* family, and everything else. Each command is an array of args (numbers are accepted and coerced to strings). By default multiple commands run as a pipeline: each returns its own result/error, aligned to the input, and one failure doesn't abort the rest. Set transaction: true for an atomic MULTI/EXEC.

{
  "commands": [
    ["SET", "visits", 0],
    ["INCR", "visits"],
    ["GET", "visits"],
  ],
  "transaction": false, // optional: true => atomic MULTI/EXEC
  // "database": "prod"       // only when more than one database is configured
  // raw credential overrides (optional):
  // "rest_url", "rest_token" // HTTP
  // "connection_string"      // TCP, rediss://
}

The transport (HTTP vs TCP) is determined by how the target database is configured; the agent never picks it.

📚 redis_search_docs

Searches the Upstash Redis documentation live and returns the most relevant pages. Reach for it whenever you're unsure about a command or feature, especially Upstash-specific ones like the SEARCH.* full-text search family. It's powered by Context7's free tier, so no API key or extra setup is required.

{ "query": "SEARCH.AGGREGATE date histogram" }

⚙️ Configuration

Everything is set through environment variables and CLI flags; there are no config files.

Single database

Transport Environment CLI
HTTP UPSTASH_REDIS_REST_URL + UPSTASH_REDIS_REST_TOKEN --rest-url <url> --rest-token <token>
TCP UPSTASH_REDIS_TCP_URL (or REDIS_URL) --url <rediss://…>

Multiple databases

Give each database a name. The name becomes a selectable database value in redis_run_commands.

Environment: insert a <NAME> segment:

UPSTASH_REDIS_PROD_REST_URL="https://prod-db.upstash.io"
UPSTASH_REDIS_PROD_REST_TOKEN="<prod-rest-token>"
UPSTASH_REDIS_CACHE_TCP_URL="rediss://default:<password>@cache-db.upstash.io:6379"

CLI: repeat --database to start each group:

npx -y @upstash/redis-mcp \
  --database prod  --rest-url https://prod-db.upstash.io --rest-token <prod-rest-token> \
  --database cache --url rediss://default:<password>@cache-db.upstash.io:6379

[!NOTE] Raw credentials per call. A redis_run_commands call may also pass rest_url + rest_token (HTTP) or connection_string (TCP) inline; these override the registry and work even with no configured database. They flow through the model's context, so prefer env/CLI for anything sensitive.

Flags & options

Flag Env Default Purpose
--transport <stdio|http> stdio Server transport
--port <n> 3000 Port for the http transport
--readonly UPSTASH_REDIS_READONLY off Best-effort: reject write commands on both transports. Server-side read-only REST tokens remain the robust option.
--disable-telemetry UPSTASH_DISABLE_TELEMETRY off Stop sending Upstash-Telemetry-* headers on HTTP requests
--debug off Verbose logging to stderr + redis-mcp-debug.log

📡 Telemetry

HTTP/REST requests carry Upstash-Telemetry-{Sdk,Platform,Runtime} headers. Disable with --disable-telemetry or UPSTASH_DISABLE_TELEMETRY=true.

🏃 Run it locally

bun install
bun run build                 # emits dist/index.js
cp .env.example .env          # add UPSTASH_REDIS_REST_URL + UPSTASH_REDIS_REST_TOKEN

node dist/index.js                          # stdio (what clients spawn)
node dist/index.js --transport http --port 3000   # HTTP: endpoint /mcp, health /ping

The server auto-loads .env. To point a client at your local build, swap npx -y @upstash/redis-mcp in any Quickstart config for node /absolute/path/to/redis-mcp/dist/index.js.

🛠️ Development

bun install
bun run build
bun test
bun run lint

📄 License

MIT © Upstash

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选