Redis Mcp

io.github.upstash由 GitHub 账号 upstash 发布v0.1.1更新于 Oct 24, 2026

Run Redis commands and look up Upstash Redis Search docs against Upstash Redis over HTTP or TCP.

已验证STDIO仅桌面数据库知识与记忆

概览

AI 生成的概览

一个本地 MCP 服务器,让助手通过 HTTP 或 TCP 在 Upstash Redis 上执行 Redis 命令,并查询 Upstash Redis 文档。

可以做什么
执行任意 Redis 命令(GET、SET、SCAN、ZADD、EVAL、SEARCH.* 等),可作为管道或原子 MULTI/EXEC 事务,通过 HTTP/REST 或 TCP 作用于一个或多个命名数据库。实时检索 Upstash Redis 文档并返回最相关的页面,包括 Upstash 特有的 SEARCH.* 功能。
适用场景
当助手需要读取或修改 Upstash Redis 数据库中的数据时使用;也适合在对话中直接获得 Redis 命令和 Upstash 特有搜索功能的帮助。
运行要求
通过 npx(Node.js)以 stdio 进程在本地运行。需要一个 Upstash Redis 数据库:HTTP 方式需 UPSTASH_REDIS_REST_URL 和 UPSTASH_REDIS_REST_TOKEN,TCP 方式需 UPSTASH_REDIS_TCP_URL(rediss://);可通过环境变量或命令行参数配置多个命名数据库。文档搜索使用 Context7 免费额度,无需密钥。需要网络访问。
安装前请注意
REST token 和 TCP 连接字符串属于凭据;优先使用环境变量或命令行参数,而不是在每次调用中内联传入,因为内联值会经过模型上下文。命令可能写入、修改或删除数据;只读标志只是尽力而为,真正的保护应使用服务端只读 REST token。HTTP 请求默认发送 Upstash 遥测头,除非禁用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Redis Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Upstash Redis MCP

[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

Claude Code

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

bash
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
Cursor

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.

json
{  "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>"      }    }  }}
VS Code

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

json
{  "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>"      }    }  }}
Codex

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

toml
[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>" }
OpenCode

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

json
{  "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>"      }    }  }}

[!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.

jsonc
{  "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.

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

⚙️ Configuration

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

Single database

TransportEnvironmentCLI
HTTPUPSTASH_REDIS_REST_URL + UPSTASH_REDIS_REST_TOKEN--rest-url <url> --rest-token <token>
TCPUPSTASH_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:

bash
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:

bash
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

FlagEnvDefaultPurpose
--transport <stdio|http>stdioServer transport
--port <n>3000Port for the http transport
--readonlyUPSTASH_REDIS_READONLYoffBest-effort: reject write commands on both transports. Server-side read-only REST tokens remain the robust option.
--disable-telemetryUPSTASH_DISABLE_TELEMETRYoffStop sending Upstash-Telemetry-* headers on HTTP requests
--debugoffVerbose 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

bash
bun installbun run build                 # emits dist/index.jscp .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

bash
bun installbun run buildbun testbun run lint

📄 License

MIT © Upstash

来源:README.md,提交 9bbfcfa

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分