From 9bc131bdb54e3961abdf3b3151ab4d3365402a1d Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Fri, 16 May 2025 16:19:09 +0100 Subject: [PATCH 1/6] DOC-5254 started MCP docs --- content/integrate/redis-mcp/_index.md | 37 +++++++ content/integrate/redis-mcp/ciient-conf.md | 99 ++++++++++++++++++ content/integrate/redis-mcp/install.md | 115 +++++++++++++++++++++ 3 files changed, 251 insertions(+) create mode 100644 content/integrate/redis-mcp/_index.md create mode 100644 content/integrate/redis-mcp/ciient-conf.md create mode 100644 content/integrate/redis-mcp/install.md diff --git a/content/integrate/redis-mcp/_index.md b/content/integrate/redis-mcp/_index.md new file mode 100644 index 000000000..61c07e6de --- /dev/null +++ b/content/integrate/redis-mcp/_index.md @@ -0,0 +1,37 @@ +--- +Title: Redis MCP +alwaysopen: false +categories: +- docs +- integrate +- rs +description: Access a Redis server using any MCP client. +group: service +hideListLinks: false +linkTitle: Redis MCP +summary: Redis MCP server lets MCP clients access the features of Redis. +type: integration +weight: 1 +--- + +The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) +is a standard that lets AI agents access data and perform actions. Using MCP, +your server can publish a set of commands that are usable by any MCP-compatible +client app (such as [Claude Desktop](https://claude.ai/download) or +[VSCode](https://code.visualstudio.com/)). These commands can retrieve +whatever data you wish to provide and you can also let the agent make +changes to the data. For example, you could publish a feed of news items that +an agent can use in its responses, and also let the agent add the user's +comments to those items. + +Redis MCP is a general-purpose implementation that lets agents read, write, and +query data in Redis and also has some basic commands to manage the Redis +server. With this enabled, you can use an LLM client as a very high-level +interface to Redis. Add, query, and analyze any Redis data set directly from +an LLM chat: + +- "Store the entire conversation in the 'recent_chats' stream" +- "Cache this item" +- "How many keys does my database have?" +- "What is user:1's email?" + diff --git a/content/integrate/redis-mcp/ciient-conf.md b/content/integrate/redis-mcp/ciient-conf.md new file mode 100644 index 000000000..ad7f2fc64 --- /dev/null +++ b/content/integrate/redis-mcp/ciient-conf.md @@ -0,0 +1,99 @@ +--- +Title: Configure client apps +alwaysopen: false +categories: +- docs +- integrate +- rs +summary: Access a Redis server using any MCP client. +group: service +linkTitle: Configure client apps +description: Configure client apps to use the Redis MCP server. +type: integration +weight: 20 +--- + +When you have [installed]({{< relref "/integrate/redis-mcp/install" >}}) +the Redis MCP server, you must also configure your client app to use it. +The sections below describe the ways you can do this. + +## Smithery + +Smithery provides a searchable repository of scripts that add configurations +for many MCP services to client apps. +The easiest way to configure your client is to use the +[Smithery tool for Redis MCP](https://smithery.ai/server/@redis/mcp-redis). + +When you select your client from the **Install** bar on the Redis MCP page, +you will see a command line that you can copy and paste into a terminal. +Running this command will configure your client app to use Redis MCP. (Note +that you need to have [Node.js](https://nodejs.org/en) installed to run +the Smithery scripts.) For example, the command line for +[Claude Desktop](https://claude.ai/download) is + +```bash +npx -y @smithery/cli@latest install @redis/mcp-redis --client claude +``` + +The script will prompt you for the information required to connect to +your Redis database. + +## Manual configuration + +You can also add the configuration for Redis MCP to your client app +manually. The exact method varies from client to client but the +basic approach is similar in each case. + +For a locally-running MCP server, you need to edit the configuration +file to add the command that launches the server, along with its +arguments. For example, with Claude Desktop, you can locate the +file by selecting **Settings** from the menu, then selecting the +**Developer** tab, and then clicking the **Edit Config** button. +When you open this JSON file, you should add your settings as +shown below: + +```json +{ + "mcpServers": { + . + . + "redis": { + "command": ">", + "args": [ + "--directory", + "/mcp-redis", + "run", + "src/main.py" + ] + } + }, + . + . + } +``` + +You can find the path to the `uv` command using `which uv`, or +the equivalent. You can also optionally set the environment for +the command shell here in the `env` section: + +```json +"redis": { + "command": ">", + "args": [ + "--directory", + "/mcp-redis", + "run", + "src/main.py" + ], + "env": { + "REDIS_HOST": "", + "REDIS_PORT": "", + "REDIS_PWD": "", + "REDIS_SSL": True|False, + "REDIS_CA_PATH": "", + "REDIS_CLUSTER_MODE": True|False + } +} +``` + + diff --git a/content/integrate/redis-mcp/install.md b/content/integrate/redis-mcp/install.md new file mode 100644 index 000000000..1202bfcb5 --- /dev/null +++ b/content/integrate/redis-mcp/install.md @@ -0,0 +1,115 @@ +--- +Title: Install +alwaysopen: false +categories: +- docs +- integrate +- rs +summary: Access a Redis server using any MCP client. +group: service +linkTitle: Install +description: Install and configure the Redis MCP server. +type: integration +weight: 10 +--- + +The MCP server runs separately from Redis, so you will need a +Redis server to access. See [Redis Cloud]({{< relref "/operate/rc" >}}) +or [Redis Open Source]({{< relref "/operate/oss_and_stack" >}}) to learn +how to get a test server active within minutes. + +## Install the server from source + +When you have a Redis server, you can clone Redis MCP from the +[Github repository](https://github.com/redis/mcp-redis) using the following +command: + +```bash +git clone https://github.com/redis/mcp-redis.git +``` + +You will also need the [`uv`](https://github.com/astral-sh/uv) packaging +tool to set up the server. See the `uv` +[installation instructions](https://github.com/astral-sh/uv?tab=readme-ov-file#installation) +for more information. + +When you have `uv`, go into the `mcp-redis` folder that you cloned and +enter the following commands to initialize the MCP server code: + +```bash +cd mcp-redis + +uv venv +source .venv/bin/activate +uv sync +``` + +## Install using Docker + +You can use the [`mcp/redis`](https://hub.docker.com/r/mcp/redis) +image (or build your own image from the source using the `Dockerfile`) to +run Redis MCP with [Docker](https://www.docker.com/). Use the following +command to download `mcp/redis` from [DockerHub](https://hub.docker.com/): + +``` +docker build -t mcp-redis . +``` + +## Configuration + +The default settings for MCP assume a Redis server is running on the +local machine, with the default port and no security arrangements. +To change these settings, use the environment variables shown in the +table below. For example, for a `bash` shell, use + +```bash +export REDIS_USERNAME="my_username" +``` + +from the command line or the `.bashrc` file to set the username you want +to connect with. + + +| Name | Description | Default Value | +|----------------------|-----------------------------------------------------------|---------------| +| `REDIS_HOST` | Redis IP or hostname | `"127.0.0.1"` | +| `REDIS_PORT` | Redis port | `6379` | +| `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` | +| `MCP_TRANSPORT` | Use the `stdio` or `sse` transport | `stdio` | + +### Making MCP visible externally + +{{< note >}}The configuration for an MCP client includes the commands +to start a local server, so you can ignore this section if you don't +want your Redis MCP to be externally accessible. +{{< /note >}} + +The default configuration assumes you only want to use the MCP server +locally, but you can make it externally available by setting +`MCP_TRANSPORT` to `sse`: + +```bash +export MCP_TRANSPORT="sse" +``` + +Then, start the server with the following command: + +```bash +uv run src/main.py +``` + +You can test the server is responding with the [`curl`](https://curl.se/) +tool: + +```bash +curl -i http://127.0.0.1:8000/sse +HTTP/1.1 200 OK +``` From 67d58b004ee25f503e26bcb5388b9bd48f43d338 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Mon, 19 May 2025 14:22:42 +0100 Subject: [PATCH 2/6] DOC-5254 rounded out install and client config details --- content/integrate/redis-mcp/_index.md | 3 +- .../{ciient-conf.md => client-conf.md} | 70 +++++++++++++++++-- content/integrate/redis-mcp/install.md | 25 +++++-- 3 files changed, 84 insertions(+), 14 deletions(-) rename content/integrate/redis-mcp/{ciient-conf.md => client-conf.md} (54%) diff --git a/content/integrate/redis-mcp/_index.md b/content/integrate/redis-mcp/_index.md index 61c07e6de..1076bcfe4 100644 --- a/content/integrate/redis-mcp/_index.md +++ b/content/integrate/redis-mcp/_index.md @@ -28,10 +28,11 @@ Redis MCP is a general-purpose implementation that lets agents read, write, and query data in Redis and also has some basic commands to manage the Redis server. With this enabled, you can use an LLM client as a very high-level interface to Redis. Add, query, and analyze any Redis data set directly from -an LLM chat: +an LLM chat using instructions and questions like the following: - "Store the entire conversation in the 'recent_chats' stream" - "Cache this item" - "How many keys does my database have?" - "What is user:1's email?" +See the other pages in this section to learn how to set up and use Redis MCP: diff --git a/content/integrate/redis-mcp/ciient-conf.md b/content/integrate/redis-mcp/client-conf.md similarity index 54% rename from content/integrate/redis-mcp/ciient-conf.md rename to content/integrate/redis-mcp/client-conf.md index ad7f2fc64..c620cd0f6 100644 --- a/content/integrate/redis-mcp/ciient-conf.md +++ b/content/integrate/redis-mcp/client-conf.md @@ -19,15 +19,15 @@ The sections below describe the ways you can do this. ## Smithery -Smithery provides a searchable repository of scripts that add configurations -for many MCP services to client apps. +[Smithery](https://smithery.ai/) provides a searchable repository of scripts +that add configurations for many MCP services to client apps. The easiest way to configure your client is to use the [Smithery tool for Redis MCP](https://smithery.ai/server/@redis/mcp-redis). When you select your client from the **Install** bar on the Redis MCP page, you will see a command line that you can copy and paste into a terminal. Running this command will configure your client app to use Redis MCP. (Note -that you need to have [Node.js](https://nodejs.org/en) installed to run +that you must have [Node.js](https://nodejs.org/en) installed to run the Smithery scripts.) For example, the command line for [Claude Desktop](https://claude.ai/download) is @@ -42,14 +42,21 @@ your Redis database. You can also add the configuration for Redis MCP to your client app manually. The exact method varies from client to client but the -basic approach is similar in each case. +basic approach is similar in each case. The pages listed below +give the general configuration details for some common MCP client tools: + +- [Claude Desktop](https://modelcontextprotocol.io/quickstart/user) +- [Github Copilot for VSCode](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) +- [OpenAI](https://openai.github.io/openai-agents-python/mcp/) + +### Local servers For a locally-running MCP server, you need to edit the configuration file to add the command that launches the server, along with its arguments. For example, with Claude Desktop, you can locate the file by selecting **Settings** from the menu, then selecting the **Developer** tab, and then clicking the **Edit Config** button. -When you open this JSON file, you should add your settings as +Open this JSON file and add your settings as shown below: ```json @@ -58,7 +65,7 @@ shown below: . . "redis": { - "command": ">", + "command": "", "args": [ "--directory", "/mcp-redis", @@ -96,4 +103,55 @@ the command shell here in the `env` section: } ``` +If you are using +[Docker]({{< relref "/integrate/redis-mcp/install#install-using-docker" >}}) +to deploy the server, change the `command` and `args` sections of the +configuration as shown below: + +```json +"redis": { + "command": "docker", + "args": ["run", + "--rm", + "--name", + "redis-mcp-server", + "-i", + "-e", "REDIS_HOST=", + "-e", "REDIS_PORT=", + "-e", "REDIS_USERNAME=", + "-e", "REDIS_PWD=", + "mcp-redis"] +} +``` + +### Remote servers + +If you set up an +[externally visible]({{< relref "/integrate/redis-mcp/install#making-mcp-visible-externally" >}}) +MCP server, you may be able to configure it directly from the app (but +if you can't, then see [Using a gateway](#using-a-gateway) for an alternative approach). For +example, the following `JSON` element configures +[Github Copilot for VSCode](https://code.visualstudio.com/docs/copilot/overview) +to use an `sse` type server running at `127.0.0.1`: + +```json + . + . +"mcp": { + "servers": { + "redis-mcp": { + "type": "sse", + "url": "http://127.0.0.1:8000/sse" + }, + } +}, + . + . +``` + +### Using a gateway +Apps that don't currently support external MCP servers directly, such as Claude +Desktop, can still access them using a *gateway*. See +[MCP server gateway](https://github.com/lightconetech/mcp-gateway) +for more information. diff --git a/content/integrate/redis-mcp/install.md b/content/integrate/redis-mcp/install.md index 1202bfcb5..cdd30259a 100644 --- a/content/integrate/redis-mcp/install.md +++ b/content/integrate/redis-mcp/install.md @@ -7,20 +7,23 @@ categories: - rs summary: Access a Redis server using any MCP client. group: service -linkTitle: Install +linkTitle: Install the server description: Install and configure the Redis MCP server. type: integration weight: 10 --- The MCP server runs separately from Redis, so you will need a -Redis server to access. See [Redis Cloud]({{< relref "/operate/rc" >}}) +Redis server for it to connect to. See [Redis Cloud]({{< relref "/operate/rc" >}}) or [Redis Open Source]({{< relref "/operate/oss_and_stack" >}}) to learn how to get a test server active within minutes. +When you have a Redis server available, use the instructions below to install and +configure the Redis MCP server. + ## Install the server from source -When you have a Redis server, you can clone Redis MCP from the +Clone Redis MCP from the [Github repository](https://github.com/redis/mcp-redis) using the following command: @@ -33,7 +36,7 @@ tool to set up the server. See the `uv` [installation instructions](https://github.com/astral-sh/uv?tab=readme-ov-file#installation) for more information. -When you have `uv`, go into the `mcp-redis` folder that you cloned and +When you have installed `uv`, go to the `mcp-redis` folder that you cloned and enter the following commands to initialize the MCP server code: ```bash @@ -47,9 +50,10 @@ uv sync ## Install using Docker You can use the [`mcp/redis`](https://hub.docker.com/r/mcp/redis) -image (or build your own image from the source using the `Dockerfile`) to -run Redis MCP with [Docker](https://www.docker.com/). Use the following -command to download `mcp/redis` from [DockerHub](https://hub.docker.com/): +image to run Redis MCP with [Docker](https://www.docker.com/). +Alternatively, use the following +command to build the Docker image with the `Dockerfile` in the +`mcp/redis` folder: ``` docker build -t mcp-redis . @@ -113,3 +117,10 @@ tool: curl -i http://127.0.0.1:8000/sse HTTP/1.1 200 OK ``` + +## Next steps + +When you have installed the server, you will need a MCP client to +connect to it and use its services. See +[Configure client apps]({{< relref "/integrate/redis-mcp/client-conf" >}}) +for more information. From 9a786f34bdd71c4e8234fcc424aca2c5795e782f Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Mon, 19 May 2025 14:53:35 +0100 Subject: [PATCH 3/6] DOC-5254 added Github link --- content/integrate/redis-mcp/_index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/integrate/redis-mcp/_index.md b/content/integrate/redis-mcp/_index.md index 1076bcfe4..da8d05cc8 100644 --- a/content/integrate/redis-mcp/_index.md +++ b/content/integrate/redis-mcp/_index.md @@ -35,4 +35,6 @@ an LLM chat using instructions and questions like the following: - "How many keys does my database have?" - "What is user:1's email?" -See the other pages in this section to learn how to set up and use Redis MCP: +See the other pages in this section to learn how to set up and use Redis MCP. +See also the [Github repository](https://github.com/redis/mcp-redis) for +the latest changes. From 8246f7b9aaeccd0a5e11faee39b521cac9c2d493 Mon Sep 17 00:00:00 2001 From: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com> Date: Mon, 19 May 2025 15:51:49 +0100 Subject: [PATCH 4/6] Apply suggestions from code review Co-authored-by: David Dougherty --- content/integrate/redis-mcp/_index.md | 4 ++-- content/integrate/redis-mcp/client-conf.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/integrate/redis-mcp/_index.md b/content/integrate/redis-mcp/_index.md index da8d05cc8..705ca4c93 100644 --- a/content/integrate/redis-mcp/_index.md +++ b/content/integrate/redis-mcp/_index.md @@ -18,7 +18,7 @@ The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) is a standard that lets AI agents access data and perform actions. Using MCP, your server can publish a set of commands that are usable by any MCP-compatible client app (such as [Claude Desktop](https://claude.ai/download) or -[VSCode](https://code.visualstudio.com/)). These commands can retrieve +[VS Code](https://code.visualstudio.com/)). These commands can retrieve whatever data you wish to provide and you can also let the agent make changes to the data. For example, you could publish a feed of news items that an agent can use in its responses, and also let the agent add the user's @@ -36,5 +36,5 @@ an LLM chat using instructions and questions like the following: - "What is user:1's email?" See the other pages in this section to learn how to set up and use Redis MCP. -See also the [Github repository](https://github.com/redis/mcp-redis) for +See also the [GitHub repository](https://github.com/redis/mcp-redis) for the latest changes. diff --git a/content/integrate/redis-mcp/client-conf.md b/content/integrate/redis-mcp/client-conf.md index c620cd0f6..b419dbb18 100644 --- a/content/integrate/redis-mcp/client-conf.md +++ b/content/integrate/redis-mcp/client-conf.md @@ -46,7 +46,7 @@ basic approach is similar in each case. The pages listed below give the general configuration details for some common MCP client tools: - [Claude Desktop](https://modelcontextprotocol.io/quickstart/user) -- [Github Copilot for VSCode](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) +- [GitHub Copilot for VS Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) - [OpenAI](https://openai.github.io/openai-agents-python/mcp/) ### Local servers @@ -131,7 +131,7 @@ If you set up an MCP server, you may be able to configure it directly from the app (but if you can't, then see [Using a gateway](#using-a-gateway) for an alternative approach). For example, the following `JSON` element configures -[Github Copilot for VSCode](https://code.visualstudio.com/docs/copilot/overview) +[GitHub Copilot for VS Code](https://code.visualstudio.com/docs/copilot/overview) to use an `sse` type server running at `127.0.0.1`: ```json From ab515bb31dea25f6366fa4c1d52f20d2a73d7659 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Tue, 20 May 2025 10:38:35 +0100 Subject: [PATCH 5/6] DOC-5254 updated config properties --- content/integrate/redis-mcp/install.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/integrate/redis-mcp/install.md b/content/integrate/redis-mcp/install.md index cdd30259a..ffa1566a3 100644 --- a/content/integrate/redis-mcp/install.md +++ b/content/integrate/redis-mcp/install.md @@ -78,8 +78,9 @@ to connect with. |----------------------|-----------------------------------------------------------|---------------| | `REDIS_HOST` | Redis IP or hostname | `"127.0.0.1"` | | `REDIS_PORT` | Redis port | `6379` | -| `REDIS_USERNAME` | Default database username | `"default"` | -| `REDIS_PWD` | Default database password | "" | +| `REDIS_DB` | Database | 0 | +| `REDIS_USERNAME` | Database username | `"default"` | +| `REDIS_PWD` | 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 | From d62b14b28307de34b85cff7f8fa6aa473a0b9e91 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Tue, 20 May 2025 14:57:07 +0100 Subject: [PATCH 6/6] DOC-5254 added details for Redis Cloud MCP --- content/integrate/redis-mcp/client-conf.md | 50 ++++++++++++++++++++++ content/integrate/redis-mcp/install.md | 36 ++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/content/integrate/redis-mcp/client-conf.md b/content/integrate/redis-mcp/client-conf.md index b419dbb18..bf1f88fef 100644 --- a/content/integrate/redis-mcp/client-conf.md +++ b/content/integrate/redis-mcp/client-conf.md @@ -155,3 +155,53 @@ Apps that don't currently support external MCP servers directly, such as Claude Desktop, can still access them using a *gateway*. See [MCP server gateway](https://github.com/lightconetech/mcp-gateway) for more information. + +## Redis Cloud MCP + +If you are using +[Redis Cloud MCP]({{< relref "/integrate/redis-mcp/install#redis-cloud-mcp" >}}), +the configuration is similar to [basic MCP](#manual-configuration), but with a +few differences. Set the client to run the server using the `node` command, as shown +in the example for Claude Desktop below: + +```json +{ + "mcpServers": { + "mcp-redis-cloud": { + "command": "node", + "args": ["--experimental-fetch", "/dist/index.js"], + "env": { + "API_KEY": "", + "SECRET_KEY": "" + } + } + } +} +``` + +Here, the environment includes the Redis Cloud API key and API secret key +(see [Redis Cloud REST API]({{< relref "/operate/rc/api" >}}) for more +information). + +If you are deploying Redis Cloud MCP with Docker, use a configuration like +the following to launch the server with the `docker` command: + +```json +{ + "mcpServers": { + "redis-cloud": { + "command": "docker", + "args": [ + "run", + "-i", + "--rm", + "-e", + "API_KEY=", + "-e", + "SECRET_KEY=", + "mcp/redis-cloud" + ] + } + } +} +``` diff --git a/content/integrate/redis-mcp/install.md b/content/integrate/redis-mcp/install.md index ffa1566a3..2e0cafaff 100644 --- a/content/integrate/redis-mcp/install.md +++ b/content/integrate/redis-mcp/install.md @@ -119,6 +119,42 @@ curl -i http://127.0.0.1:8000/sse HTTP/1.1 200 OK ``` +## Redis Cloud MCP + +A separate version of the MCP server is available for +[Redis Cloud]({{< relref "/operate/rc" >}}). This has the same main +functionality as the basic MCP server but also has some features +specific to Redis Cloud, including subscription management and +billing details. For example, you can use questions and instructions +like the following: + +- "Create a new Redis database in AWS" +- "What are my current subscriptions?" +- "Help me choose the right Redis database for my e-commerce application" + +You will need [Node.js](https://nodejs.org/en) installed to run Redis Cloud MCP. +Clone the GitHub repository using the following command: + +```bash +git clone https://github.com/redis/mcp-redis-cloud.git +``` + +Go into the `mcp-redis-cloud` folder and install the dependencies: + +```bash +npm run build +``` + +The server is now ready for use. + +You can also deploy Redis Cloud MCP using Docker. Build the image +using the `Dockerfile` in the repository folder with the following +command: + +```bash +docker build -t mcp/redis-cloud . +``` + ## Next steps When you have installed the server, you will need a MCP client to