@futuretea/redis-mcp-server 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -107
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -2,36 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
[中文文档](README.zh.md)
|
|
4
4
|
|
|
5
|
-
Redis MCP Server exposes a closed
|
|
5
|
+
Redis MCP Server exposes a closed Redis catalog over MCP. The default catalog is read-only. Write tools are registered only when `redis.write_enabled` is true. The process does not authenticate clients, and output masking stays off until you enable it.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The current release is npm `0.2.0`, container tag `v0.2.0`, and git tag `v0.2.0`. Field lists, errors, and the tool catalog are in the [reference](docs/reference.md). Build and release layout are in [development and release](docs/development.md).
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
make build
|
|
11
|
-
./bin/redis-mcp-server tools list --config config.example.yaml
|
|
12
|
-
./bin/redis-mcp-server tools describe redis_string --config config.example.yaml
|
|
13
|
-
./bin/redis-mcp-server tools call redis_string --config config.example.yaml \
|
|
14
|
-
--params '{"operation":"get","args":{"key":"sample"}}'
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
`tools list` and `tools describe` do not connect to Redis. `tools call` and `mcp` connect, then reject an account that can run administrative commands unless `allow_unsafe_database_role` is set. See Service account.
|
|
9
|
+
## Install 0.2.0
|
|
18
10
|
|
|
19
|
-
The
|
|
11
|
+
The npm package and the container image are the program builds. The [v0.2.0 GitHub release](https://github.com/futuretea/redis-mcp-server/releases/tag/v0.2.0) has notes and GitHub's source archive. It does not attach a `redis-mcp-server` binary. Do not look for a binary download on that page.
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## Use a release
|
|
24
|
-
|
|
25
|
-
Stable releases use tags in the form `vX.Y.Z`. npm uses `X.Y.Z`; Docker uses `vX.Y.Z`. npm packages support macOS (Intel and Apple Silicon), Linux (x64 and ARM64), and Windows x64. Docker images support Linux `amd64` and `arm64`.
|
|
13
|
+
The npm tarball for 0.2.0 contains the README from that publish. This file is the updated guide. The Chinese guide is [README.zh.md](README.zh.md) in the repository. The npm tarball does not include it.
|
|
26
14
|
|
|
27
15
|
### npm
|
|
28
16
|
|
|
17
|
+
Copy [config.example.yaml](config.example.yaml) to the path you will pass to `--config`. The tracked file is the whole configuration. A shorter file with only the `redis` keys is a different document.
|
|
18
|
+
|
|
29
19
|
```bash
|
|
20
|
+
cp config.example.yaml redis-mcp.yaml
|
|
30
21
|
export MCP_REDIS_PASSWORD='your-redis-password'
|
|
31
|
-
npx -y @futuretea/redis-mcp-server@
|
|
22
|
+
npx -y @futuretea/redis-mcp-server@0.2.0 --config "$PWD/redis-mcp.yaml"
|
|
32
23
|
```
|
|
33
24
|
|
|
34
|
-
|
|
25
|
+
`npx` starts `redis-mcp-server mcp`. The process speaks MCP on stdin and stdout. It connects to Redis before it serves. With the example addresses and no Redis on `127.0.0.1:6379`, the process exits non-zero and writes `[redis_connection_failed] connection failed` to stderr. Stdout stays empty.
|
|
26
|
+
|
|
27
|
+
A stdio client uses the same command. Give the client an absolute configuration path.
|
|
35
28
|
|
|
36
29
|
```json
|
|
37
30
|
{
|
|
@@ -40,7 +33,7 @@ Configure an MCP client that supports stdio with the same version and configurat
|
|
|
40
33
|
"command": "npx",
|
|
41
34
|
"args": [
|
|
42
35
|
"-y",
|
|
43
|
-
"@futuretea/redis-mcp-server@
|
|
36
|
+
"@futuretea/redis-mcp-server@0.2.0",
|
|
44
37
|
"--config",
|
|
45
38
|
"/absolute/path/to/redis-mcp.yaml"
|
|
46
39
|
],
|
|
@@ -52,140 +45,148 @@ Configure an MCP client that supports stdio with the same version and configurat
|
|
|
52
45
|
}
|
|
53
46
|
```
|
|
54
47
|
|
|
48
|
+
The wrapper always inserts the `mcp` subcommand. `npx -y @futuretea/redis-mcp-server@0.2.0 version` does not print the version. It starts `mcp` and then fails if topology is missing. After `npm install @futuretea/redis-mcp-server@0.2.0`, run the platform binary for `version`, `tools`, and `completion`.
|
|
49
|
+
|
|
50
|
+
| Host | Package | Binary |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| macOS Intel | `@futuretea/redis-mcp-server-darwin-amd64` | `bin/redis-mcp-server` |
|
|
53
|
+
| macOS Apple Silicon | `@futuretea/redis-mcp-server-darwin-arm64` | `bin/redis-mcp-server` |
|
|
54
|
+
| Linux x64 | `@futuretea/redis-mcp-server-linux-amd64` | `bin/redis-mcp-server` |
|
|
55
|
+
| Linux ARM64 | `@futuretea/redis-mcp-server-linux-arm64` | `bin/redis-mcp-server` |
|
|
56
|
+
| Windows x64 | `@futuretea/redis-mcp-server-windows-amd64` | `bin/redis-mcp-server.exe` |
|
|
57
|
+
|
|
58
|
+
The linux/amd64 binary from 0.2.0 prints:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
redis-mcp-server version=0.2.0 commit=b519d1d9c7430c96abd07eea736d01c3e5f69676 date=2026-11-15T00:38:32-08:00
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Other platform packages are published at the same version. This check executed the linux/amd64 binary only.
|
|
65
|
+
|
|
55
66
|
### Docker
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
The image entrypoint is `/usr/local/bin/redis-mcp-server mcp` and the user is `mcp`. `v0.2.0` contains runnable `linux/amd64` and `linux/arm64` images. The release workflow also tags that image as `latest` until a later stable tag moves `latest`.
|
|
69
|
+
|
|
70
|
+
Mount the copy of `config.example.yaml`. The repository does not contain `redis-mcp.yaml`.
|
|
58
71
|
|
|
59
72
|
```bash
|
|
73
|
+
cp config.example.yaml redis-mcp.yaml
|
|
60
74
|
export MCP_REDIS_PASSWORD='your-redis-password'
|
|
61
75
|
docker run --rm -i \
|
|
62
76
|
--env MCP_REDIS_PASSWORD \
|
|
63
77
|
--mount type=bind,src="$PWD/redis-mcp.yaml",dst=/etc/redis-mcp-server/config.yaml,readonly \
|
|
64
|
-
ghcr.io/futuretea/redis-mcp-server:
|
|
78
|
+
ghcr.io/futuretea/redis-mcp-server:v0.2.0 \
|
|
65
79
|
--config /etc/redis-mcp-server/config.yaml
|
|
66
80
|
```
|
|
67
81
|
|
|
68
|
-
|
|
82
|
+
The container waits on stdio the same way `npx` does. To run `version` or `tools`, replace the entrypoint:
|
|
69
83
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
```yaml
|
|
75
|
-
allow_unsafe_database_role: false
|
|
76
|
-
redis:
|
|
77
|
-
topology: standalone # standalone | cluster | sentinel
|
|
78
|
-
addresses: ["127.0.0.1:6379"]
|
|
79
|
-
username: ""
|
|
80
|
-
tls: false
|
|
81
|
-
sentinel_master: ""
|
|
82
|
-
write_enabled: false
|
|
84
|
+
```bash
|
|
85
|
+
docker run --rm --entrypoint /usr/local/bin/redis-mcp-server \
|
|
86
|
+
ghcr.io/futuretea/redis-mcp-server:v0.2.0 version
|
|
83
87
|
```
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
The container command above was checked against the published image config. It was not executed here because this environment has no Docker daemon.
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
### Build from a checkout
|
|
88
92
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
```bash
|
|
94
|
+
make build
|
|
95
|
+
./bin/redis-mcp-server version
|
|
96
|
+
./bin/redis-mcp-server tools list --config config.example.yaml
|
|
97
|
+
```
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
- `FLUSHALL`, `FLUSHDB`, `SWAPDB`, or `MIGRATE`
|
|
95
|
-
- server-side code and global function or script control: `@scripting`, including `EVAL`, `EVALSHA`, `FCALL`, `SCRIPT DEBUG`, `SCRIPT FLUSH`, `SCRIPT LOAD`, `SCRIPT KILL`, `FUNCTION FLUSH`, `FUNCTION DELETE`, `FUNCTION LOAD`, `FUNCTION RESTORE`, and `FUNCTION KILL`
|
|
96
|
-
- `MEMORY PURGE`
|
|
97
|
-
- every command in that server's `@dangerous` category. Redis 8 adds `TRIMSLOTS` and `BACKUP` there. They are not in `@admin` or `@scripting`, and `@write` and `@keyspace` grant `TRIMSLOTS`
|
|
98
|
-
- `RANDOMKEY` and `SCAN`. Both return key names and do not take a key argument, so a key pattern does not apply to them
|
|
99
|
-
- the whole `ACL`, `CLIENT`, `CLUSTER`, `FUNCTION`, `SCRIPT`, or `MEMORY` command
|
|
99
|
+
`tools list` does not connect to Redis. The table includes `redis_string` and omits `redis_string_write` while `write_enabled` is false. The version line from `make build` comes from `git describe` and can differ from `0.2.0`. Go, test, and release details are in [development and release](docs/development.md).
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
## Configure Redis
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
Keep the password in `MCP_REDIS_PASSWORD`. Do not add it to YAML. A `password` key in YAML is ignored.
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
ACL SETUSER mcp-reader on >strong-password ~app:* resetchannels &
|
|
107
|
-
-@all
|
|
108
|
-
+@read
|
|
109
|
-
-@admin
|
|
110
|
-
-@dangerous
|
|
111
|
-
-randomkey
|
|
112
|
-
-scan
|
|
113
|
-
+ping
|
|
114
|
-
+acl|whoami
|
|
115
|
-
+acl|getuser
|
|
116
|
-
+acl|cat
|
|
117
|
-
```
|
|
105
|
+
`config.example.yaml` is a valid file. Copy it, then change `redis.addresses`. You can skip the file when the environment supplies topology and addresses:
|
|
118
106
|
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
-flushall -flushdb -swapdb -migrate -memory|purge
|
|
125
|
-
-randomkey -scan
|
|
126
|
-
+ping +acl|whoami +acl|getuser +acl|cat
|
|
127
|
-
+cluster|slots +cluster|nodes +cluster|shards
|
|
107
|
+
```bash
|
|
108
|
+
export MCP_REDIS_TOPOLOGY=standalone
|
|
109
|
+
export MCP_REDIS_ADDRESSES=127.0.0.1:6379
|
|
110
|
+
export MCP_REDIS_PASSWORD='your-redis-password'
|
|
111
|
+
npx -y @futuretea/redis-mcp-server@0.2.0
|
|
128
112
|
```
|
|
129
113
|
|
|
130
|
-
|
|
114
|
+
For Sentinel, also set `MCP_REDIS_SENTINEL_MASTER`. Separate several addresses with a comma. A space does not split an address. `127.0.0.1:6379, 10.0.0.2:6379` is two addresses. `standalone` uses the first address. `cluster` uses every address as a seed. `sentinel` uses every address as a Sentinel endpoint.
|
|
131
115
|
|
|
132
|
-
|
|
116
|
+
Precedence, TLS, database 0, and the rest of the fields are in the [reference](docs/reference.md).
|
|
133
117
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
118
|
+
```yaml
|
|
119
|
+
port: 0
|
|
120
|
+
listen: 127.0.0.1
|
|
121
|
+
sse_base_url: ""
|
|
122
|
+
log_level: info
|
|
123
|
+
enabled_tools: []
|
|
124
|
+
disabled_tools: []
|
|
125
|
+
enabled_domains: []
|
|
126
|
+
disabled_domains: []
|
|
127
|
+
allow_unsafe_database_role: false
|
|
128
|
+
redis:
|
|
129
|
+
topology: standalone
|
|
130
|
+
addresses: ["127.0.0.1:6379"]
|
|
131
|
+
username: ""
|
|
132
|
+
tls: false
|
|
133
|
+
sentinel_master: ""
|
|
134
|
+
write_enabled: false
|
|
135
|
+
```
|
|
139
136
|
|
|
140
|
-
|
|
137
|
+
The block above is the values in [config.example.yaml](config.example.yaml). The tracked file also has comments for the environment names and for the commented-out `masking` object. Masking stays off while that object is commented out.
|
|
141
138
|
|
|
142
|
-
|
|
139
|
+
## Call a tool
|
|
143
140
|
|
|
144
|
-
|
|
141
|
+
`tools describe` prints the schema and does not connect.
|
|
145
142
|
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
disabled_tools:
|
|
151
|
-
- redis_key
|
|
152
|
-
- redis_observe
|
|
143
|
+
```bash
|
|
144
|
+
./bin/redis-mcp-server tools describe redis_string --config config.example.yaml
|
|
145
|
+
./bin/redis-mcp-server tools call redis_string --config config.example.yaml \
|
|
146
|
+
--params '{"operation":"get","args":{"key":"sample"}}'
|
|
153
147
|
```
|
|
154
148
|
|
|
155
|
-
|
|
149
|
+
`tools call` connects. With no Redis at the example address, it exits non-zero and writes `[redis_connection_failed] connection failed` to stderr.
|
|
150
|
+
|
|
151
|
+
Write tools appear only after `redis.write_enabled` is true or `MCP_REDIS_WRITE_ENABLED=true`. Enabling writes registers delete and trim operations. It is not a per-call approval step. Leave it false for a general-purpose client.
|
|
156
152
|
|
|
157
|
-
|
|
153
|
+
`enabled_tools` selects whole tools. Enabling `redis_string` exposes every read operation of that tool, not one operation. Leave `redis_key` and `redis_observe` out of the list unless the client needs key names or keyspace metadata. `RANDOMKEY` and `SCAN` return key names from the whole keyspace.
|
|
158
154
|
|
|
159
|
-
|
|
155
|
+
Use a Redis ACL account that can run the catalog and the startup probe, and that cannot run admin, flush, script, or keyless enumeration commands. The rejection list and the account shapes used by the startup test are in the [reference](docs/reference.md). `allow_unsafe_database_role` defaults to false. Set it only when you cannot create that account and you control the Redis instance.
|
|
160
156
|
|
|
161
|
-
|
|
157
|
+
## Choose stdio or HTTP
|
|
162
158
|
|
|
163
|
-
|
|
159
|
+
Prefer stdio for a local client. The `npx` and `docker run` commands above are stdio.
|
|
164
160
|
|
|
165
|
-
|
|
161
|
+
For HTTP, set a port. The default listen address is `127.0.0.1`.
|
|
166
162
|
|
|
167
163
|
```bash
|
|
168
|
-
./bin/redis-mcp-server
|
|
164
|
+
./bin/redis-mcp-server mcp --config redis-mcp.yaml --port 8080
|
|
169
165
|
```
|
|
170
166
|
|
|
171
|
-
|
|
167
|
+
Streamable HTTP is `http://127.0.0.1:8080/mcp`. SSE is `http://127.0.0.1:8080/sse`. `GET http://127.0.0.1:8080/healthz` returns the body `healthy` after startup. `HEAD` returns `200` and no body. The process does not check an `Authorization` header.
|
|
172
168
|
|
|
173
|
-
|
|
169
|
+
Inside a container, `127.0.0.1` is the container loopback. To publish the port, set `--listen 0.0.0.0` and publish it only on a network that should reach an unauthenticated process.
|
|
174
170
|
|
|
175
171
|
```bash
|
|
176
|
-
|
|
177
|
-
|
|
172
|
+
docker run --rm -i \
|
|
173
|
+
-p 127.0.0.1:8080:8080 \
|
|
174
|
+
--env MCP_REDIS_PASSWORD \
|
|
175
|
+
--mount type=bind,src="$PWD/redis-mcp.yaml",dst=/etc/redis-mcp-server/config.yaml,readonly \
|
|
176
|
+
ghcr.io/futuretea/redis-mcp-server:v0.2.0 \
|
|
177
|
+
--config /etc/redis-mcp-server/config.yaml \
|
|
178
|
+
--port 8080 \
|
|
179
|
+
--listen 0.0.0.0
|
|
178
180
|
```
|
|
179
181
|
|
|
180
|
-
|
|
182
|
+
Put TLS and authentication in front of any listener that other machines can reach.
|
|
183
|
+
|
|
184
|
+
## Enable masking
|
|
181
185
|
|
|
182
|
-
|
|
186
|
+
Masking is off in the example file. To turn it on, set `enabled` to true and at least one rule. `MCP_MASKING_JSON` replaces the whole YAML object when the variable is set.
|
|
183
187
|
|
|
184
188
|
```bash
|
|
185
|
-
|
|
186
|
-
make lint
|
|
187
|
-
make build
|
|
188
|
-
make integration
|
|
189
|
+
export MCP_MASKING_JSON='{"enabled":true,"names":["synthetic_field"],"values":["synthetic-token-value"]}'
|
|
189
190
|
```
|
|
190
191
|
|
|
191
|
-
|
|
192
|
+
Names, patterns, placeholder, limits, and the Redis cases that fail closed are in the [reference](docs/reference.md). Masking does not find every private value.
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futuretea/redis-mcp-server",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Redis Model Context Protocol server",
|
|
5
5
|
"main": "./bin/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"redis-mcp-server": "bin/index.js"
|
|
8
8
|
},
|
|
9
9
|
"optionalDependencies": {
|
|
10
|
-
"@futuretea/redis-mcp-server-darwin-amd64": "0.1
|
|
11
|
-
"@futuretea/redis-mcp-server-darwin-arm64": "0.1
|
|
12
|
-
"@futuretea/redis-mcp-server-linux-amd64": "0.1
|
|
13
|
-
"@futuretea/redis-mcp-server-linux-arm64": "0.1
|
|
14
|
-
"@futuretea/redis-mcp-server-windows-amd64": "0.1
|
|
10
|
+
"@futuretea/redis-mcp-server-darwin-amd64": "0.2.1",
|
|
11
|
+
"@futuretea/redis-mcp-server-darwin-arm64": "0.2.1",
|
|
12
|
+
"@futuretea/redis-mcp-server-linux-amd64": "0.2.1",
|
|
13
|
+
"@futuretea/redis-mcp-server-linux-arm64": "0.2.1",
|
|
14
|
+
"@futuretea/redis-mcp-server-windows-amd64": "0.2.1"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|