> ## Documentation Index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Upstash Redis MCP

The Upstash Redis MCP server connects your agent directly to a Redis database. It is lightweight and ships with just two tools:

* **`redis_run_commands`**: run any Redis command (including the `SEARCH.*` family), as a pipeline or an atomic transaction.
* **`redis_search_docs`**: search the Upstash Redis docs live, so the agent can look up commands and features on demand.

Find the GitHub repository [here](https://github.com/upstash/redis-mcp).

> [!NOTE]
>
> To manage your whole Upstash account (create databases, read QStash and Workflow logs, drive Upstash Box), use the [Upstash MCP server](https://upstash.com/docs/agent-resources/mcp.md) instead.

# Installation

Grab your database's REST URL and token from the [Upstash Console](https://console.upstash.com) (open your Redis database and copy `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from the **REST API** section), then add the server to your MCP client.

To connect over TCP instead, set `UPSTASH_REDIS_TCP_URL` to your `rediss://` connection string in place of the two REST variables.

> [accordion] Claude Code
>
> ```sh theme={"system"}
> 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
> ```

> [accordion] Cursor
>
> [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/install-mcp?name=upstash-redis\&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB1cHN0YXNoL3JlZGlzLW1jcCJdfQ==)
>
> ```json theme={"system"}
> {
>   "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"
>       }
>     }
>   }
> }
> ```

> [accordion] VS Code
>
> ```json theme={"system"}
> {
>   "servers": {
>     "upstash-redis": {
>       "type": "stdio",
>       "command": "npx",
>       "args": ["-y", "@upstash/redis-mcp"],
>       "env": {
>         "UPSTASH_REDIS_REST_URL": "https://YOUR_DB.upstash.io",
>         "UPSTASH_REDIS_REST_TOKEN": "YOUR_REST_TOKEN"
>       }
>     }
>   }
> }
> ```

> [accordion] OpenAI Codex
>
> ```toml theme={"system"}
> [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" }
> ```

> [accordion] OpenCode
>
> ```json theme={"system"}
> {
>   "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"
>       }
>     }
>   }
> }
> ```

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.


## Related topics

- [MCP Server](https://upstash.com/docs/agent-resources/mcp.md)
- [Upstash Redis Getting Started](https://upstash.com/docs/redis/overall/getstarted.md)
- [MCP Events with Redis and QStash](https://upstash.com/docs/redis/sdks/agentkit/mcp-events.md)
- [Long-Running MCP Tools with Redis and QStash](https://upstash.com/docs/redis/sdks/agentkit/mcp-tasks.md)
- [Connect with @upstash/redis](https://upstash.com/docs/redis/howto/connect-with-upstash-redis.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.