A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/redis/mcp-redis/ below:

redis/mcp-redis: The official Redis MCP Server is a natural language interface designed for agentic applications to manage and search data in Redis efficiently

The Redis MCP Server is a natural language interface designed for agentic applications to efficiently manage and search data in Redis. It integrates seamlessly with MCP (Model Content Protocol) clients, enabling AI-driven workflows to interact with structured and unstructured data in Redis. Using this MCP Server, you can ask questions like:

This MCP Server provides tools to manage the data stored in Redis.

Additional tools.

The Redis MCP Server supports the stdio transport. Support to the stremable-http transport will be added in the future.

No PyPi package is available at the moment.

The easiest way to use the Redis MCP Server is with uvx, which allows you to run it directly from GitHub (from a branch, or use a tagged release). It is recommended to use a tagged release, the main branch is under active development and may contain breaking changes. As an example, you can execute the following command to run the 0.2.0 release:

uvx --from git+https://github.com/redis/mcp-redis.git@0.2.0 redis-mcp-server --url redis://localhost:6379/0

Check the release notes for the latest version in the Releases section. Additional examples are provided below.

# Run with Redis URI
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server --url redis://localhost:6379/0

# Run with Redis URI and SSL 
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server --url "rediss://<USERNAME>:<PASSWORD>@<HOST>:<PORT>?ssl_cert_reqs=required&ssl_ca_certs=<PATH_TO_CERT>"

# Run with individual parameters
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server --host localhost --port 6379 --password mypassword

# See all options
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server --help

For development or if you prefer to clone the repository:

# Clone the repository
git clone https://github.com/redis/mcp-redis.git
cd mcp-redis

# Install dependencies using uv
uv venv
source .venv/bin/activate
uv sync

# Run with CLI interface
uv run redis-mcp-server --help

# Or run the main file directly (uses environment variables)
uv run src/main.py

Once you cloned the repository, installed the dependencies and verified you can run the server, you can configure Claude Desktop or any other MCP Client to use this MCP Server running the main file directly (it uses environment variables). This is usually preferred for development. The following example is for Claude Desktop, but the same applies to any other MCP Client.

  1. Specify your Redis credentials and TLS configuration
  2. Retrieve your uv command full path (e.g. which uv)
  3. Edit the claude_desktop_config.json configuration file
{
    "mcpServers": {
        "redis": {
            "command": "<full_path_uv_command>",
            "args": [
                "--directory",
                "<your_mcp_server_directory>",
                "run",
                "src/main.py"
            ],
            "env": {
                "REDIS_HOST": "<your_redis_database_hostname>",
                "REDIS_PORT": "<your_redis_database_port>",
                "REDIS_PWD": "<your_redis_database_password>",
                "REDIS_SSL": True|False,
                "REDIS_CA_PATH": "<your_redis_ca_path>",
                "REDIS_CLUSTER_MODE": True|False
            }
        }
    }
}

You can troubleshoot problems by tailing the log file.

tail -f ~/Library/Logs/Claude/mcp-server-redis.log

You can use a dockerized deployment of this server. You can either build your own image or use the official Redis MCP Docker image.

If you'd like to build your own image, the Redis MCP Server provides a Dockerfile. Build this server's image with:

docker build -t mcp-redis .

Finally, configure the client to create the container at start-up. An example for Claude Desktop is provided below. Edit the claude_desktop_config.json and add:

{
  "mcpServers": {
    "redis": {
      "command": "docker",
      "args": ["run",
                "--rm",
                "--name",
                "redis-mcp-server",
                "-i",
                "-e", "REDIS_HOST=<redis_hostname>",
                "-e", "REDIS_PORT=<redis_port>",
                "-e", "REDIS_USERNAME=<redis_username>",
                "-e", "REDIS_PWD=<redis_password>",
                "mcp-redis"]
    }
  }
}

To use the official Redis MCP Docker image, just replace your image name (mcp-redis in the example above) with mcp/redis.

The Redis MCP Server can be configured in two ways: via command line arguments or via environment variables. The precedence is: command line arguments > environment variables > default values.

You can configure Redis ACL to restrict the access to the Redis database. For example, to create a read-only user:

127.0.0.1:6379> ACL SETUSER readonlyuser on >mypassword ~* +@read -@write

Configure the user via command line arguments or environment variables.

Configuration via command line arguments

When using the CLI interface, you can configure the server with command line arguments:

# Basic Redis connection
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server \
  --host localhost \
  --port 6379 \
  --password mypassword

# Using Redis URI (simpler)
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server \
  --url redis://user:pass@localhost:6379/0

# SSL connection
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server \
  --url rediss://user:pass@redis.example.com:6379/0

# See all available options
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server --help

Available CLI Options:

Configuration via Environment Variables

If desired, you can use environment variables. Defaults are provided for all variables.

Name Description Default Value REDIS_HOST Redis IP or hostname "127.0.0.1" REDIS_PORT Redis port 6379 REDIS_DB Database 0 REDIS_USERNAME Default database username "default" REDIS_PWD Default database password "" REDIS_SSL Enables or disables SSL/TLS False REDIS_CA_PATH CA certificate for verifying server None REDIS_SSL_KEYFILE Client's private key file for client authentication None REDIS_SSL_CERTFILE Client's certificate file for client authentication None REDIS_CERT_REQS Whether the client should verify the server's certificate "required" REDIS_CA_CERTS Path to the trusted CA certificates file None REDIS_CLUSTER_MODE Enable Redis Cluster mode False

There are several ways to set environment variables:

  1. Using a .env File:
    Place a .env file in your project directory with key-value pairs for each environment variable. Tools like python-dotenv, pipenv, and uv can automatically load these variables when running your application. This is a convenient and secure way to manage configuration, as it keeps sensitive data out of your shell history and version control (if .env is in .gitignore). For example, create a .env file with the following content from the .env.example file provided in the repository:

Then edit the .env file to set your Redis configuration:

OR,

  1. Setting Variables in the Shell:
    You can export environment variables directly in your shell before running your application. For example:
export REDIS_HOST=your_redis_host
export REDIS_PORT=6379
# Other variables will be set similarly...

This method is useful for temporary overrides or quick testing.

Integrating this MCP Server to development frameworks like OpenAI Agents SDK, or with tools like Claude Desktop, VS Code, or Augment is described in the following sections.

Integrate this MCP Server with the OpenAI Agents SDK. Read the documents to learn more about the integration of the SDK with MCP.

Install the Python SDK.

pip install openai-agents

Configure the OpenAI token:

export OPENAI_API_KEY="<openai_token>"

And run the application.

python3.13 redis_assistant.py

You can troubleshoot your agent workflows using the OpenAI dashboard.

You can configure the Redis MCP Server in Augment by importing the server via JSON:

{
  "mcpServers": {
    "Redis MCP Server": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/redis/mcp-redis.git",
        "redis-mcp-server",
        "--url",
        "redis://localhost:6379/0"
      ]
    }
  }
}

The simplest way to configure MCP clients is using uvx. Add the following JSON to your claude_desktop_config.json, remember to provide the full path to uvx.

{
    "mcpServers": {
        "redis-mcp-server": {
            "type": "stdio",
            "command": "/Users/mortensi/.local/bin/uvx",
            "args": [
                "--from", "git+https://github.com/redis/mcp-redis.git",
                "redis-mcp-server",
                "--url", "redis://localhost:6379/0"
            ]
        }
    }
}

If you'd like to test the Redis MCP Server via Smithery, you can configure Claude Desktop automatically:

npx -y @smithery/cli install @redis/mcp-redis --client claude

Follow the prompt and provide the details to configure the server and connect to Redis (e.g. using a Redis Cloud database). The procedure will create the proper configuration in the claude_desktop_config.json configuration file.

VS Code with GitHub Copilot

To use the Redis MCP Server with VS Code, you must nable the agent mode tools. Add the following to your settings.json:

{
  "chat.agent.enabled": true
}

You can start the GitHub desired version of the Redis MCP server using uvx by adding the following JSON to your settings.json:

"mcp": {
    "servers": {
        "Redis MCP Server": {
        "type": "stdio",
        "command": "uvx", 
        "args": [
            "--from", "git+https://github.com/redis/mcp-redis.git",
            "redis-mcp-server",
            "--url", "redis://localhost:6379/0"
        ]
        },
    }
},

Alternatively, you can start the server using uv and configure your mcp.json or settings.json. This is usually desired for development.

{
  "servers": {
    "redis": {
      "type": "stdio",
      "command": "<full_path_uv_command>",
      "args": [
        "--directory",
        "<your_mcp_server_directory>",
        "run",
        "src/main.py"
      ],
      "env": {
        "REDIS_HOST": "<your_redis_database_hostname>",
        "REDIS_PORT": "<your_redis_database_port>",
        "REDIS_USERNAME": "<your_redis_database_username>",
        "REDIS_PWD": "<your_redis_database_password>",
      }
    }
  }
}
{
  "mcp": {
    "servers": {
      "redis": {
        "type": "stdio",
        "command": "<full_path_uv_command>",
        "args": [
          "--directory",
          "<your_mcp_server_directory>",
          "run",
          "src/main.py"
        ],
        "env": {
          "REDIS_HOST": "<your_redis_database_hostname>",
          "REDIS_PORT": "<your_redis_database_port>",
          "REDIS_USERNAME": "<your_redis_database_username>",
          "REDIS_PWD": "<your_redis_database_password>",
        }
      }
    }
  }
}

For more information, see the VS Code documentation.

You can use the MCP Inspector for visual debugging of this MCP Server.

npx @modelcontextprotocol/inspector uv run src/main.py
  1. Fork the repo
  2. Create a new branch (feature-branch)
  3. Commit your changes
  4. Push to your branch and submit a PR!

This project is licensed under the MIT License.

For questions or support, reach out via GitHub Issues.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4