> ## 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](/agent-resources/mcp) instead.
</Note>

# 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.

<AccordionGroup>
  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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"
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

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.
