Skip to content

Commit 5d08398

Browse files
committed
Add uvx CLI support for easy installation and usage
- Add comprehensive CLI interface using Click with Redis URI and individual parameter support - Add console script entry point for global installation via uvx/pip - Update package metadata in pyproject.toml with proper classifiers and URLs - Fix all imports to use absolute paths for proper package installation - Update README with uvx installation instructions and MCP client configurations - Support running directly from GitHub without PyPI publication - Enable single-command usage: uvx redis-mcp-server --redis-uri redis://localhost:6379/0 - Add support for SSL connections, authentication, and cluster mode via CLI - Maintain backward compatibility with existing installation methods
1 parent dfccb64 commit 5d08398

24 files changed

+485
-47
lines changed

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/AugmentWebviewStateStore.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/mcp-redis.iml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,27 @@ Additional tools.
3939

4040
## Installation
4141

42-
Follow these instructions to install the server.
42+
### Quick Start with uvx (Recommended)
43+
44+
The easiest way to use the Redis MCP Server is with `uvx`, which allows you to run it directly without installation:
45+
46+
```sh
47+
# Run with Redis URI
48+
uvx redis-mcp-server --redis-uri redis://localhost:6379/0
49+
50+
# Run with individual parameters
51+
uvx redis-mcp-server --redis-host localhost --redis-port 6379 --redis-password mypassword
52+
53+
# Run with SSL
54+
uvx redis-mcp-server --redis-uri rediss://user:[email protected]:6380/0
55+
56+
# See all options
57+
uvx redis-mcp-server --help
58+
```
59+
60+
### Development Installation
61+
62+
For development or if you prefer to clone the repository:
4363

4464
```sh
4565
# Clone the repository
@@ -50,6 +70,27 @@ cd mcp-redis
5070
uv venv
5171
source .venv/bin/activate
5272
uv sync
73+
74+
# Run locally during development
75+
uv run redis-mcp-server --help
76+
```
77+
78+
### Publishing to PyPI
79+
80+
To publish the package to PyPI for global `uvx` usage:
81+
82+
```sh
83+
# Build the package
84+
uv build
85+
86+
# Publish to PyPI (requires PyPI credentials)
87+
uv publish
88+
```
89+
90+
Once published, users can run it globally with:
91+
92+
```sh
93+
uvx redis-mcp-server --redis-uri redis://localhost:6379/0
5394
```
5495

5596
## Configuration
@@ -190,6 +231,67 @@ python3.13 redis_assistant.py
190231

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

234+
## Integration with MCP Clients
235+
236+
### Using uvx (Recommended)
237+
238+
The simplest way to configure MCP clients is using `uvx`. Here are examples for popular clients:
239+
240+
#### Claude Desktop
241+
242+
Add this to your `claude_desktop_config.json`:
243+
244+
```json
245+
{
246+
"mcpServers": {
247+
"redis": {
248+
"command": "uvx",
249+
"args": [
250+
"redis-mcp-server",
251+
"--redis-uri", "redis://localhost:6379/0"
252+
]
253+
}
254+
}
255+
}
256+
```
257+
258+
Or with individual parameters:
259+
260+
```json
261+
{
262+
"mcpServers": {
263+
"redis": {
264+
"command": "uvx",
265+
"args": [
266+
"redis-mcp-server",
267+
"--redis-host", "your-redis-host",
268+
"--redis-port", "6379",
269+
"--redis-password", "your-password"
270+
]
271+
}
272+
}
273+
}
274+
```
275+
276+
#### VS Code with GitHub Copilot
277+
278+
Add this to your `.vscode/mcp.json`:
279+
280+
```json
281+
{
282+
"servers": {
283+
"redis": {
284+
"type": "stdio",
285+
"command": "uvx",
286+
"args": [
287+
"redis-mcp-server",
288+
"--redis-uri", "redis://localhost:6379/0"
289+
]
290+
}
291+
}
292+
}
293+
```
294+
193295
## Integration with Claude Desktop
194296

195297
### Via Smithery

pyproject.toml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,46 @@
11
[project]
22
name = "redis-mcp-server"
3-
version = "0.2.0-alpha"
4-
description = "Redis MCP Server, by Redis"
3+
version = "0.2.0"
4+
description = "Redis MCP Server - Model Context Protocol server for Redis"
55
readme = "README.md"
6-
requires-python = ">=3.13"
6+
requires-python = ">=3.10"
7+
license = {text = "MIT"}
8+
authors = [
9+
{name = "Redis", email = "[email protected]"}
10+
]
11+
keywords = ["redis", "mcp", "model-context-protocol", "ai", "llm"]
12+
classifiers = [
13+
"Development Status :: 4 - Beta",
14+
"Intended Audience :: Developers",
15+
"License :: OSI Approved :: MIT License",
16+
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3.10",
18+
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3.13",
21+
"Topic :: Database",
22+
"Topic :: Software Development :: Libraries :: Python Modules",
23+
]
724
dependencies = [
825
"mcp[cli]>=1.9.4",
926
"redis>=6.0.0",
1027
"dotenv>=0.9.9",
1128
"numpy>=2.2.4",
29+
"click>=8.0.0",
1230
]
31+
32+
[project.scripts]
33+
redis-mcp-server = "src.main:cli"
34+
35+
[project.urls]
36+
Homepage = "https://github.com/redis/mcp-redis"
37+
Repository = "https://github.com/redis/mcp-redis"
38+
Issues = "https://github.com/redis/mcp-redis/issues"
39+
40+
[build-system]
41+
requires = ["setuptools>=45", "wheel"]
42+
build-backend = "setuptools.build_meta"
43+
44+
[tool.setuptools.packages.find]
45+
where = ["."]
46+
include = ["src*"]

src/common/connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import sys
2-
from version import __version__
2+
from src.version import __version__
33
import redis
44
from redis import Redis
55
from redis.cluster import RedisCluster
66
from typing import Optional, Type, Union
7-
from common.config import REDIS_CFG
7+
from src.common.config import REDIS_CFG
88

9-
from common.config import generate_redis_uri
9+
from src.common.config import generate_redis_uri
1010

1111

1212
class RedisConnectionManager:

0 commit comments

Comments
 (0)