@futuretea/redis-mcp-server 0.2.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 +106 -133
- 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.
|
|
18
|
-
|
|
19
|
-
The catalog contains `redis_key`, `redis_string`, `redis_hash`, `redis_list`, `redis_set`, `redis_sorted_set`, `redis_stream`, and `redis_observe`. Write-mode additionally registers the corresponding seven `*_write` tools; there is no raw-command tool and no `redis_observe_write`.
|
|
9
|
+
## Install 0.2.0
|
|
20
10
|
|
|
21
|
-
|
|
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.
|
|
22
12
|
|
|
23
|
-
|
|
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,168 +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
|
-
|
|
69
|
-
|
|
70
|
-
## Configuration
|
|
71
|
-
|
|
72
|
-
Redis topology is explicit. Password is read only from `MCP_REDIS_PASSWORD`; do not place it in YAML.
|
|
82
|
+
The container waits on stdio the same way `npx` does. To run `version` or `tools`, replace the entrypoint:
|
|
73
83
|
|
|
74
|
-
```
|
|
75
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
Use `sentinel_master` for Sentinel. `addresses` lists cluster seeds for Cluster and Sentinel endpoints for Sentinel.
|
|
88
|
-
|
|
89
|
-
### Service account
|
|
89
|
+
The container command above was checked against the published image config. It was not executed here because this environment has no Docker daemon.
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
### Build from a checkout
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
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
|
|
100
|
-
|
|
101
|
-
These probe commands are not a rejection by themselves: `ACL WHOAMI`, `ACL GETUSER`, and `ACL CAT`. `ACL GETUSER` cannot be limited to the current username, so this account can also read every user's ACL password hash. That probe disclosure is separate from key names returned by `RANDOMKEY` or `SCAN`. Startup calls `ACL GETUSER` only for the authenticated user and does not log or return that reply. Cluster discovery commands such as `CLUSTER SLOTS`, `CLUSTER NODES`, and `CLUSTER SHARDS` are not a rejection, and neither is `MEMORY USAGE` or `CLIENT SETNAME`. The account must be allowed to run the probe, or startup fails with `[redis_privilege_probe_failed]` even when the opt-out is set. A refused connection fails with `[redis_connection_failed]` and is not skipped by the opt-out.
|
|
102
|
-
|
|
103
|
-
An account limited to the read commands it needs, plus the probe commands, starts with the default configuration. No opt-out is required. `@read` includes `RANDOMKEY` and `SCAN`, so the read account also needs `-randomkey` and `-scan`. On Redis 6.2, `@read` includes `memory`, and `MEMORY PURGE` is not its own ACL name, so that account also needs `-memory`. The same shape works for a business account that grants the data categories and then revokes the global operations. `+@write` includes `FLUSHALL` and, on Redis 7, `FUNCTION FLUSH`, `FUNCTION DELETE`, `FUNCTION LOAD`, and `FUNCTION RESTORE`. On Redis 8 it also includes `TRIMSLOTS`. `+@connection` includes `CLIENT KILL`. `+@slow` and `+@scripting` include `EVAL` and `SCRIPT DEBUG`. Grant the broad category first, then revoke `@admin`, `@dangerous`, and `@scripting`, then revoke `RANDOMKEY`, `SCAN`, and the other individual global commands, then add the probe commands back. Redis 6.2 rejects unknown names such as `-function` and `-memory|purge`. Use `-memory` and `-@scripting` there. `-randomkey` and `-scan` are valid on Redis 6.2.
|
|
104
|
-
|
|
105
|
-
```redis
|
|
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
|
-
```
|
|
118
|
-
|
|
119
|
-
```redis
|
|
120
|
-
ACL SETUSER mcp-app on >strong-password ~app:* resetchannels &
|
|
121
|
-
-@all
|
|
122
|
-
+@read +@write +@string +@hash +@list +@set +@sortedset +@stream +@fast +@keyspace +@connection
|
|
123
|
-
-@admin -@dangerous -@scripting
|
|
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
|
|
93
|
+
```bash
|
|
94
|
+
make build
|
|
95
|
+
./bin/redis-mcp-server version
|
|
96
|
+
./bin/redis-mcp-server tools list --config config.example.yaml
|
|
128
97
|
```
|
|
129
98
|
|
|
130
|
-
`
|
|
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).
|
|
131
100
|
|
|
132
|
-
|
|
101
|
+
## Configure Redis
|
|
133
102
|
|
|
134
|
-
|
|
103
|
+
Keep the password in `MCP_REDIS_PASSWORD`. Do not add it to YAML. A `password` key in YAML is ignored.
|
|
135
104
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
```yaml
|
|
139
|
-
masking:
|
|
140
|
-
enabled: true
|
|
141
|
-
placeholder: "[masked]"
|
|
142
|
-
names: ["synthetic_field"]
|
|
143
|
-
name_patterns: ["token_.+"]
|
|
144
|
-
values: ["synthetic-token-value"]
|
|
145
|
-
value_patterns: ["sk_live_[0-9]+"]
|
|
146
|
-
```
|
|
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:
|
|
147
106
|
|
|
148
107
|
```bash
|
|
149
|
-
export
|
|
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
|
|
150
112
|
```
|
|
151
113
|
|
|
152
|
-
|
|
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.
|
|
153
115
|
|
|
154
|
-
|
|
116
|
+
Precedence, TLS, database 0, and the rest of the fields are in the [reference](docs/reference.md).
|
|
155
117
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
+
```
|
|
167
136
|
|
|
168
|
-
|
|
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.
|
|
169
138
|
|
|
170
|
-
|
|
139
|
+
## Call a tool
|
|
171
140
|
|
|
172
|
-
|
|
141
|
+
`tools describe` prints the schema and does not connect.
|
|
173
142
|
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
disabled_tools:
|
|
179
|
-
- redis_key
|
|
180
|
-
- 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"}}'
|
|
181
147
|
```
|
|
182
148
|
|
|
183
|
-
|
|
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.
|
|
184
152
|
|
|
185
|
-
|
|
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.
|
|
186
154
|
|
|
187
|
-
|
|
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.
|
|
188
156
|
|
|
189
|
-
|
|
157
|
+
## Choose stdio or HTTP
|
|
190
158
|
|
|
191
|
-
|
|
159
|
+
Prefer stdio for a local client. The `npx` and `docker run` commands above are stdio.
|
|
192
160
|
|
|
193
|
-
|
|
161
|
+
For HTTP, set a port. The default listen address is `127.0.0.1`.
|
|
194
162
|
|
|
195
163
|
```bash
|
|
196
|
-
./bin/redis-mcp-server
|
|
164
|
+
./bin/redis-mcp-server mcp --config redis-mcp.yaml --port 8080
|
|
197
165
|
```
|
|
198
166
|
|
|
199
|
-
|
|
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.
|
|
200
168
|
|
|
201
|
-
|
|
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.
|
|
202
170
|
|
|
203
171
|
```bash
|
|
204
|
-
|
|
205
|
-
|
|
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
|
|
206
180
|
```
|
|
207
181
|
|
|
208
|
-
|
|
182
|
+
Put TLS and authentication in front of any listener that other machines can reach.
|
|
183
|
+
|
|
184
|
+
## Enable masking
|
|
209
185
|
|
|
210
|
-
|
|
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.
|
|
211
187
|
|
|
212
188
|
```bash
|
|
213
|
-
|
|
214
|
-
make lint
|
|
215
|
-
make build
|
|
216
|
-
make integration
|
|
189
|
+
export MCP_MASKING_JSON='{"enabled":true,"names":["synthetic_field"],"values":["synthetic-token-value"]}'
|
|
217
190
|
```
|
|
218
191
|
|
|
219
|
-
|
|
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.2.
|
|
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.2.
|
|
11
|
-
"@futuretea/redis-mcp-server-darwin-arm64": "0.2.
|
|
12
|
-
"@futuretea/redis-mcp-server-linux-amd64": "0.2.
|
|
13
|
-
"@futuretea/redis-mcp-server-linux-arm64": "0.2.
|
|
14
|
-
"@futuretea/redis-mcp-server-windows-amd64": "0.2.
|
|
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",
|