Skip to content

Commit 0704c8f

Browse files
committed
README reorganized
1 parent 357eb05 commit 0704c8f

File tree

2 files changed

+141
-146
lines changed

2 files changed

+141
-146
lines changed

README.md

Lines changed: 140 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ The Redis MCP Server is a **natural language interface** designed for agentic ap
1717
- [Features](#features)
1818
- [Tools](#tools)
1919
- [Installation](#installation)
20-
- [Quick Start with uvx (Recommended)](#quick-start-with-uvx-recommended)
20+
- [Quick Start with uvx](#quick-start-with-uvx)
2121
- [Development Installation](#development-installation)
22+
- [With Docker](#with-docker)
2223
- [Configuration](#configuration)
23-
- [Configuration via Command Line (Recommended)](#configuration-via-command-line-recommended)
24+
- [Configuration via command line arguments](#configuration-via-command-line-arguments)
2425
- [Configuration via Environment Variables](#configuration-via-environment-variables)
25-
- [Integration with OpenAI Agents SDK](#integration-with-openai-agents-sdk)
26-
- [Integration with MCP Clients](#integration-with-mcp-clients)
27-
- [Using uvx (Recommended)](#using-uvx-recommended)
28-
- [With Docker](#with-docker)
26+
- [Integrations](#integrations)
27+
- [OpenAI Agents SDK](#openai-agents-sdk)
28+
- [Augment](#augment)
2929
- [Claude Desktop](#claude-desktop)
3030
- [VS Code with GitHub Copilot](#vs-code-with-github-copilot)
31-
- [Augment](#augment)
31+
- [Testing](#testing)
32+
- [Example Use Cases](#example-use-cases)
3233
- [Contributing](#contributing)
3334
- [License](#license)
3435
- [Badges](#badges)
@@ -62,9 +63,11 @@ Additional tools.
6263

6364
## Installation
6465

65-
### Quick Start with uvx (Recommended)
66+
### Quick Start with uvx
6667

67-
The easiest way to use the Redis MCP Server is with `uvx`, which allows you to run it directly from GitHub without installation on the MCP Client side:
68+
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).
69+
70+
> No PyPi package is available at the moment.
6871
6972
```sh
7073
# Run with Redis URI
@@ -94,18 +97,91 @@ uv venv
9497
source .venv/bin/activate
9598
uv sync
9699

97-
# Run with CLI interface (recommended)
100+
# Run with CLI interface
98101
uv run redis-mcp-server --help
99102

100103
# Or run the main file directly (uses environment variables)
101104
uv run src/main.py
102105
```
103106

107+
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.
108+
The following example is for Claude Desktop, but the same applies to any other MCP Client.
109+
110+
1. Specify your Redis credentials and TLS configuration
111+
2. Retrieve your `uv` command full path (e.g. `which uv`)
112+
3. Edit the `claude_desktop_config.json` configuration file
113+
- on a MacOS, at `~/Library/Application\ Support/Claude/`
114+
115+
```json
116+
{
117+
"mcpServers": {
118+
"redis": {
119+
"command": "<full_path_uv_command>",
120+
"args": [
121+
"--directory",
122+
"<your_mcp_server_directory>",
123+
"run",
124+
"src/main.py"
125+
],
126+
"env": {
127+
"REDIS_HOST": "<your_redis_database_hostname>",
128+
"REDIS_PORT": "<your_redis_database_port>",
129+
"REDIS_PWD": "<your_redis_database_password>",
130+
"REDIS_SSL": True|False,
131+
"REDIS_CA_PATH": "<your_redis_ca_path>",
132+
"REDIS_CLUSTER_MODE": True|False
133+
}
134+
}
135+
}
136+
}
137+
```
138+
139+
You can troubleshoot problems by tailing the log file.
140+
141+
```commandline
142+
tail -f ~/Library/Logs/Claude/mcp-server-redis.log
143+
```
144+
145+
### With Docker
146+
147+
You can use a dockerized deployment of this server. You can either build your own image or use the official [Redis MCP Docker](https://hub.docker.com/r/mcp/redis) image.
148+
149+
If you'd like to build your own image, the Redis MCP Server provides a Dockerfile. Build this server's image with:
150+
151+
```commandline
152+
docker build -t mcp-redis .
153+
```
154+
155+
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:
156+
157+
```json
158+
{
159+
"mcpServers": {
160+
"redis": {
161+
"command": "docker",
162+
"args": ["run",
163+
"--rm",
164+
"--name",
165+
"redis-mcp-server",
166+
"-i",
167+
"-e", "REDIS_HOST=<redis_hostname>",
168+
"-e", "REDIS_PORT=<redis_port>",
169+
"-e", "REDIS_USERNAME=<redis_username>",
170+
"-e", "REDIS_PWD=<redis_password>",
171+
"mcp-redis"]
172+
}
173+
}
174+
}
175+
```
176+
177+
To use the official [Redis MCP Docker](https://hub.docker.com/r/mcp/redis) image, just replace your image name (`mcp-redis` in the example above) with `mcp/redis`.
178+
104179
## Configuration
105180

106-
The Redis MCP Server can be configured in two ways: via command line arguments (recommended) or environment variables.
181+
The Redis MCP Server can be configured in two ways: via command line arguments or via environment variables.
182+
The precedence is: command line arguments > environment variables > default values.
107183

108-
### Configuration via Command Line (Recommended)
184+
### Configuration via command line arguments
109185

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

@@ -139,11 +215,13 @@ uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server --help
139215
- `--ssl-ca-path` - Path to CA certificate file
140216
- `--ssl-keyfile` - Path to SSL key file
141217
- `--ssl-certfile` - Path to SSL certificate file
218+
- `--ssl-cert-reqs` - SSL certificate requirements (default: required)
219+
- `--ssl-ca-certs` - Path to CA certificates file
142220
- `--cluster-mode` - Enable Redis cluster mode
143221

144222
### Configuration via Environment Variables
145223

146-
When running the server directly (`uv run src/main.py`) or for legacy compatibility, you can use environment variables:
224+
If desired, you can use environment variables. Defaults are provided for all variables.
147225

148226
| Name | Description | Default Value |
149227
|----------------------|-----------------------------------------------------------|---------------|
@@ -161,34 +239,37 @@ When running the server directly (`uv run src/main.py`) or for legacy compatibil
161239
| `REDIS_CLUSTER_MODE` | Enable Redis Cluster mode | `False` |
162240

163241

164-
165242
There are several ways to set environment variables:
166243

167244
1. **Using a `.env` File**:
168-
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`).
169-
245+
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`).
170246
For example, create a `.env` file with the following content from the `.env.example` file provided in the repository:
171247

172-
```bash
248+
```bash
173249
cp .env.example .env
174-
```
175-
250+
```
176251

177-
Then edit the `.env` file to set your Redis configuration:
252+
Then edit the `.env` file to set your Redis configuration:
178253

179254
OR,
180255

181256
2. **Setting Variables in the Shell**:
182-
You can export environment variables directly in your shell before running your application. For example:
183-
```sh
184-
export REDIS_HOST=your_redis_host
185-
export REDIS_PORT=6379
186-
# Other variables will be set similarly...
187-
```
188-
This method is useful for temporary overrides or quick testing.
257+
You can export environment variables directly in your shell before running your application. For example:
258+
259+
```sh
260+
export REDIS_HOST=your_redis_host
261+
export REDIS_PORT=6379
262+
# Other variables will be set similarly...
263+
```
264+
265+
This method is useful for temporary overrides or quick testing.
266+
267+
268+
## Integrations
189269

270+
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.
190271

191-
## Integration with OpenAI Agents SDK
272+
### OpenAI Agents SDK
192273

193274
Integrate this MCP Server with the OpenAI Agents SDK. Read the [documents](https://openai.github.io/openai-agents-python/mcp/) to learn more about the integration of the SDK with MCP.
194275

@@ -212,15 +293,30 @@ python3.13 redis_assistant.py
212293

213294
You can troubleshoot your agent workflows using the [OpenAI dashboard](https://platform.openai.com/traces/).
214295

215-
## Integration with MCP Clients
296+
### Augment
216297

217-
### Using uvx (Recommended)
298+
You can configure the Redis MCP Server in Augment by importing the server via JSON:
218299

219-
The simplest way to configure MCP clients is using `uvx`. Here are examples for popular clients:
300+
```json
301+
{
302+
"mcpServers": {
303+
"Redis MCP Server": {
304+
"command": "uvx",
305+
"args": [
306+
"--from",
307+
"git+https://github.com/redis/mcp-redis.git",
308+
"redis-mcp-server",
309+
"--url",
310+
"redis://localhost:6379/0"
311+
]
312+
}
313+
}
314+
}
315+
```
220316

221-
#### Claude Desktop
317+
### Claude Desktop
222318

223-
Add this to your `claude_desktop_config.json`, remember to provide the full path to `uvx`.
319+
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`.
224320

225321
```json
226322
{
@@ -247,9 +343,17 @@ npx -y @smithery/cli install @redis/mcp-redis --client claude
247343
Follow the prompt and provide the details to configure the server and connect to Redis (e.g. using a Redis Cloud database).
248344
The procedure will create the proper configuration in the `claude_desktop_config.json` configuration file.
249345

250-
#### VS Code with GitHub Copilot
346+
### VS Code with GitHub Copilot
347+
348+
To use the Redis MCP Server with VS Code, you must nable the [agent mode](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode) tools. Add the following to your `settings.json`:
349+
350+
```json
351+
{
352+
"chat.agent.enabled": true
353+
}
354+
```
251355

252-
Add this to your `settings.json`:
356+
You can start the GitHub desired version of the Redis MCP server using `uvx` by adding the following JSON to your `settings.json`:
253357

254358
```json
255359
"mcp": {
@@ -267,117 +371,7 @@ Add this to your `settings.json`:
267371
},
268372
```
269373

270-
#### Augment
271-
272-
Import the server via JSON:
273-
274-
```json
275-
{
276-
"mcpServers": {
277-
"Redis MCP Server": {
278-
"command": "uvx",
279-
"args": [
280-
"--from",
281-
"git+https://github.com/redis/mcp-redis.git",
282-
"redis-mcp-server",
283-
"--url",
284-
"redis://localhost:6379/0"
285-
]
286-
}
287-
}
288-
}
289-
```
290-
291-
292-
### Manual configuration
293-
294-
You can configure Claude Desktop or any other MCP Client to use this MCP Server running the main file directly (it uses environment variables).
295-
The following example is for Claude Desktop, but the same applies to any other MCP Client.
296-
297-
1. Specify your Redis credentials and TLS configuration
298-
2. Retrieve your `uv` command full path (e.g. `which uv`)
299-
3. Edit the `claude_desktop_config.json` configuration file
300-
- on a MacOS, at `~/Library/Application\ Support/Claude/`
301-
302-
```json
303-
{
304-
"mcpServers": {
305-
"redis": {
306-
"command": "<full_path_uv_command>",
307-
"args": [
308-
"--directory",
309-
"<your_mcp_server_directory>",
310-
"run",
311-
"src/main.py"
312-
],
313-
"env": {
314-
"REDIS_HOST": "<your_redis_database_hostname>",
315-
"REDIS_PORT": "<your_redis_database_port>",
316-
"REDIS_PWD": "<your_redis_database_password>",
317-
"REDIS_SSL": True|False,
318-
"REDIS_CA_PATH": "<your_redis_ca_path>",
319-
"REDIS_CLUSTER_MODE": True|False
320-
}
321-
}
322-
}
323-
}
324-
```
325-
326-
### With Docker
327-
328-
You can use a dockerized deployment of this server. You can either build your own image or use the official [Redis MCP Docker](https://hub.docker.com/r/mcp/redis) image.
329-
330-
If you'd like to build your own image, the Redis MCP Server provides a Dockerfile. Build this server's image with:
331-
332-
```commandline
333-
docker build -t mcp-redis .
334-
```
335-
336-
Finally, configure Claude Desktop to create the container at start-up. Edit the `claude_desktop_config.json` and add:
337-
338-
```json
339-
{
340-
"mcpServers": {
341-
"redis": {
342-
"command": "docker",
343-
"args": ["run",
344-
"--rm",
345-
"--name",
346-
"redis-mcp-server",
347-
"-i",
348-
"-e", "REDIS_HOST=<redis_hostname>",
349-
"-e", "REDIS_PORT=<redis_port>",
350-
"-e", "REDIS_USERNAME=<redis_username>",
351-
"-e", "REDIS_PWD=<redis_password>",
352-
"mcp-redis"]
353-
}
354-
}
355-
}
356-
```
357-
358-
To use the official [Redis MCP Docker](https://hub.docker.com/r/mcp/redis) image, just replace your image name (`mcp-redis` in the example above) with `mcp/redis`.
359-
360-
### Troubleshooting
361-
362-
You can troubleshoot problems by tailing the log file.
363-
364-
```commandline
365-
tail -f ~/Library/Logs/Claude/mcp-server-redis.log
366-
```
367-
368-
## Integration with VS Code
369-
370-
To use the Redis MCP Server with VS Code, you need:
371-
372-
1. Enable the [agent mode](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode) tools. Add the following to your `settings.json`:
373-
374-
```json
375-
{
376-
"chat.agent.enabled": true
377-
}
378-
```
379-
380-
2. Add the Redis MCP Server configuration to your `mcp.json` or `settings.json`:
374+
Alternatively, you can start the server using `uv` and configure your `mcp.json` or `settings.json`. This is usually desired for development.
381375

382376
```json
383377
{

src/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def cli(url, host, port, db, username, password,
7878

7979
set_redis_config_from_cli(config)
8080

81+
# Test the connection
8182
RedisConnectionManager.get_connection().ping()
8283

8384
# Start the server

0 commit comments

Comments
 (0)