{
  "markdown": "<div align=\"center\">\n\n# Upstash Redis MCP\n\n</div>\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/install-mcp?name=upstash-redis&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB1cHN0YXNoL3JlZGlzLW1jcCJdfQ==)\n\nLightweight MCP server for Redis with only two tools:\n\n- 🧪 **`redis_run_commands`**: run one or more Redis commands over **HTTP/REST** or **TCP**, as a pipeline or an atomic transaction.\n- 📚 **`redis_search_docs`**: search the Redis docs using [Context7](https://context7.com) public api.\n\nOne server can hold multiple named databases. Configuration is pure environment variables and CLI flags.\n\n## 🔌 Quickstart\n\n<details>\n<summary><b>Claude Code</b></summary>\n\nRun this in your terminal. See the [Claude Code MCP docs](https://docs.anthropic.com/en/docs/claude-code/mcp) for more.\n\n```bash\nclaude mcp add upstash-redis \\\n  -e UPSTASH_REDIS_REST_URL=https://<your-db>.upstash.io \\\n  -e UPSTASH_REDIS_REST_TOKEN=<your-rest-token> \\\n  -- npx -y @upstash/redis-mcp\n```\n\n</details>\n\n<details>\n<summary><b>Cursor</b></summary>\n\nAdd 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](https://docs.cursor.com/context/model-context-protocol).\n\n```json\n{\n  \"mcpServers\": {\n    \"upstash-redis\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@upstash/redis-mcp\"],\n      \"env\": {\n        \"UPSTASH_REDIS_REST_URL\": \"https://<your-db>.upstash.io\",\n        \"UPSTASH_REDIS_REST_TOKEN\": \"<your-rest-token>\"\n      }\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><b>VS Code</b></summary>\n\nAdd to `.vscode/mcp.json` (per-project) or your user `mcp` settings. See the [VS Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).\n\n```json\n{\n  \"servers\": {\n    \"upstash-redis\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@upstash/redis-mcp\"],\n      \"env\": {\n        \"UPSTASH_REDIS_REST_URL\": \"https://<your-db>.upstash.io\",\n        \"UPSTASH_REDIS_REST_TOKEN\": \"<your-rest-token>\"\n      }\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><b>Codex</b></summary>\n\nAdd to `~/.codex/config.toml` (or a project-level `.codex/config.toml`). See the [Codex MCP docs](https://developers.openai.com/codex/mcp).\n\n```toml\n[mcp_servers.upstash-redis]\ncommand = \"npx\"\nargs = [\"-y\", \"@upstash/redis-mcp\"]\nenv = { UPSTASH_REDIS_REST_URL = \"https://<your-db>.upstash.io\", UPSTASH_REDIS_REST_TOKEN = \"<your-rest-token>\" }\n```\n\n</details>\n\n<details>\n<summary><b>OpenCode</b></summary>\n\nAdd to `opencode.json` (project) or `~/.config/opencode/opencode.json` (global). See the [OpenCode MCP docs](https://opencode.ai/docs/mcp-servers).\n\n```json\n{\n  \"mcp\": {\n    \"upstash-redis\": {\n      \"type\": \"local\",\n      \"command\": [\"npx\", \"-y\", \"@upstash/redis-mcp\"],\n      \"environment\": {\n        \"UPSTASH_REDIS_REST_URL\": \"https://<your-db>.upstash.io\",\n        \"UPSTASH_REDIS_REST_TOKEN\": \"<your-rest-token>\"\n      }\n    }\n  }\n}\n```\n\n</details>\n\n> [!TIP]\n> 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.\n\n## 🧰 Tools\n\n### 🧪 `redis_run_commands`\n\nRun 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`.\n\n```jsonc\n{\n  \"commands\": [\n    [\"SET\", \"visits\", 0],\n    [\"INCR\", \"visits\"],\n    [\"GET\", \"visits\"],\n  ],\n  \"transaction\": false, // optional: true => atomic MULTI/EXEC\n  // \"database\": \"prod\"       // only when more than one database is configured\n  // raw credential overrides (optional):\n  // \"rest_url\", \"rest_token\" // HTTP\n  // \"connection_string\"      // TCP, rediss://\n}\n```\n\nThe transport (HTTP vs TCP) is determined by how the target database is configured; the agent never picks it.\n\n### 📚 `redis_search_docs`\n\nSearches 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](https://context7.com)'s free tier, so no API key or extra setup is required.\n\n```jsonc\n{ \"query\": \"SEARCH.AGGREGATE date histogram\" }\n```\n\n## ⚙️ Configuration\n\nEverything is set through environment variables and CLI flags; there are no config files.\n\n### Single database\n\n| Transport | Environment                                           | CLI                                     |\n| --------- | ----------------------------------------------------- | --------------------------------------- |\n| HTTP      | `UPSTASH_REDIS_REST_URL` + `UPSTASH_REDIS_REST_TOKEN` | `--rest-url <url> --rest-token <token>` |\n| TCP       | `UPSTASH_REDIS_TCP_URL` (or `REDIS_URL`)              | `--url <rediss://…>`                    |\n\n### Multiple databases\n\nGive each database a name. The name becomes a selectable `database` value in `redis_run_commands`.\n\n**Environment**: insert a `<NAME>` segment:\n\n```bash\nUPSTASH_REDIS_PROD_REST_URL=\"https://prod-db.upstash.io\"\nUPSTASH_REDIS_PROD_REST_TOKEN=\"<prod-rest-token>\"\nUPSTASH_REDIS_CACHE_TCP_URL=\"rediss://default:<password>@cache-db.upstash.io:6379\"\n```\n\n**CLI**: repeat `--database` to start each group:\n\n```bash\nnpx -y @upstash/redis-mcp \\\n  --database prod  --rest-url https://prod-db.upstash.io --rest-token <prod-rest-token> \\\n  --database cache --url rediss://default:<password>@cache-db.upstash.io:6379\n```\n\n> [!NOTE]\n> **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.\n\n### Flags & options\n\n| Flag                        | Env                         | Default | Purpose                                                                                                            |\n| --------------------------- | --------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------ |\n| `--transport <stdio\\|http>` |                             | `stdio` | Server transport                                                                                                   |\n| `--port <n>`                |                             | `3000`  | Port for the `http` transport                                                                                      |\n| `--readonly`                | `UPSTASH_REDIS_READONLY`    | off     | Best-effort: reject write commands on both transports. Server-side read-only REST tokens remain the robust option. |\n| `--disable-telemetry`       | `UPSTASH_DISABLE_TELEMETRY` | off     | Stop sending `Upstash-Telemetry-*` headers on HTTP requests                                                        |\n| `--debug`                   |                             | off     | Verbose logging to stderr + `redis-mcp-debug.log`                                                                  |\n\n## 📡 Telemetry\n\nHTTP/REST requests carry `Upstash-Telemetry-{Sdk,Platform,Runtime}` headers. Disable with `--disable-telemetry` or `UPSTASH_DISABLE_TELEMETRY=true`.\n\n## 🏃 Run it locally\n\n```bash\nbun install\nbun run build                 # emits dist/index.js\ncp .env.example .env          # add UPSTASH_REDIS_REST_URL + UPSTASH_REDIS_REST_TOKEN\n\nnode dist/index.js                          # stdio (what clients spawn)\nnode dist/index.js --transport http --port 3000   # HTTP: endpoint /mcp, health /ping\n```\n\nThe server auto-loads `.env`. To point a client at your local build, swap `npx -y @upstash/redis-mcp` in any [Quickstart](#-quickstart) config for `node /absolute/path/to/redis-mcp/dist/index.js`.\n\n## 🛠️ Development\n\n```bash\nbun install\nbun run build\nbun test\nbun run lint\n```\n\n## 📄 License\n\n[MIT](./LICENSE) © Upstash\n",
  "bytes": 8173,
  "sha": "af9c214f39ba618ada7990e52f1ec00246412e2f12a628c046a7c0f33a982039",
  "repo_slug": "upstash/redis-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_upstash_redis_mcp_3952c02d/readme"
}