@futuretea/redis-mcp-server 0.1.0 → 0.2.0

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.
Files changed (2) hide show
  1. package/README.md +28 -0
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -131,6 +131,34 @@ ACL SETUSER mcp-app on >strong-password ~app:* resetchannels &
131
131
 
132
132
  The warning is logged at warn level. HTTP mode shows it at the default `info` log level. Stdio mode keeps logs disabled so MCP output stays intact. Do not use the Redis `default` user. A standard server grants that user `+@all`.
133
133
 
134
+ ## Output masking
135
+
136
+ Masking is off when the `masking` object is absent, when `enabled` is omitted, or when `enabled` is false. Tool results, CLI output, and errors then keep their current JSON. Set `enabled` to true and at least one rule to remove configured field names and values from output. `MCP_MASKING_JSON` replaces the whole YAML object when the variable is present. An empty value is rejected. Unset leaves the YAML object in place.
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
+ ```
147
+
148
+ ```bash
149
+ export MCP_MASKING_JSON='{"enabled":true,"names":["synthetic_field"],"values":["synthetic-token-value"]}'
150
+ ```
151
+
152
+ Name rules match a whole dynamic object key, hash field, or other data string. Value rules are substring matches on the original text, including one-character literals. They run once and do not search the placeholder. A matched string becomes the placeholder. A matched number, bool, or other non-string becomes JSON `null`. An existing null stays `null`, so null can be a missing Redis value or a redacted value, and the JSON type can change.
153
+
154
+ Redis binary cells are masked from the original bytes, then both `utf8` and `base64` are written again from that result. A pair whose siblings disagree is rejected. Invalid UTF-8 stays in `base64` only. JSON objects and arrays stored as text are read as JSON, including escaped keys. `redis_key` `dump` is opaque. With an active policy it returns `[redis_masking_failed] result was not returned` and no payload. With masking off, `DUMP` is unchanged. `metadata.next_cursor` is a 16-byte continuation reference, not the stored key. If a rule matches that token, the page fails instead of returning a raw or rewritten cursor.
155
+
156
+ Invalid masking configuration, including `enabled: true` with no rules, stops startup with `invalid masking config` and does not echo the document. Bounds, duplicate keys, and key collisions use the same fixed failure and no partial payload. The Redis command and its arguments are unchanged. HTTP debug logs record a route class (`mcp`, `sse`, `message`, or `other`) instead of the raw path or query.
157
+
158
+ This covers the server's known Redis result shapes. It does not detect every private value, compressed payload, unknown encoding, or arbitrary PII.
159
+
160
+ The copied engine is mysql-mcp-server commit `6c6f58a343ff61e5f1e220b5cbdff7899afd886d`. This server does not patch those rules. Name patterns are parsed on their own and then anchored in the syntax tree. `a)|(b` is invalid. `(?:a)|(b)` matches only the whole names `a` and `b`. One budget is shared across a whole Redis result. A base64 cell longer than the input cap is rejected before it is decoded, and the paired `utf8` sibling is not returned. A value-rule hit on a native number or bool replaces that whole value with JSON `null`. A JSON value is counted again as its container, so it can exhaust the budget before a plain string of the same size. RE2 returns the leftmost-first match and does not search a longer alternative after a shorter one matches. Those two are limits. Masking still does not detect every private value, compressed payload, unknown encoding, or arbitrary PII.
161
+
134
162
  ## Production safety guide
135
163
 
136
164
  This server reduces the Redis capabilities exposed to an AI client; it is not an authentication gateway or a complete data-access policy. Read-only mode prevents mutations, but reads can still disclose data or consume Redis capacity.
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@futuretea/redis-mcp-server",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
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.0",
11
- "@futuretea/redis-mcp-server-darwin-arm64": "0.1.0",
12
- "@futuretea/redis-mcp-server-linux-amd64": "0.1.0",
13
- "@futuretea/redis-mcp-server-linux-arm64": "0.1.0",
14
- "@futuretea/redis-mcp-server-windows-amd64": "0.1.0"
10
+ "@futuretea/redis-mcp-server-darwin-amd64": "0.2.0",
11
+ "@futuretea/redis-mcp-server-darwin-arm64": "0.2.0",
12
+ "@futuretea/redis-mcp-server-linux-amd64": "0.2.0",
13
+ "@futuretea/redis-mcp-server-linux-arm64": "0.2.0",
14
+ "@futuretea/redis-mcp-server-windows-amd64": "0.2.0"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",