Skip to content

fix(mcp): keep MCP server credentials out of responses and workspace files - #547

Draft
FelipeRamos-neuro wants to merge 2 commits into
plmbr:mainfrom
FelipeRamos-neuro:fix/mask-mcp-credentials
Draft

FelipeRamos-neuro wants to merge 2 commits into
plmbr:mainfrom
FelipeRamos-neuro:fix/mask-mcp-credentials

Conversation

@FelipeRamos-neuro

Copy link
Copy Markdown
Contributor

Stacked on #546. Until that merges, this diff includes its commit; review the last commit only.

Summary

 Claude MCP panel  (list / add / get / disable)
-  server.env / server.headers   real values
+  server.env / server.headers   "********" (every value; the panel shows names only)

 NBI MCP editor  (GET writes nbi.mcp.temp.json into the workspace)
-  env / headers   real values
+  credential-named env / headers values masked
 POST
+  mask -> restored by (server, field, key) from the stored config
+  mask with nothing stored -> 400, names the values, nothing saved
  • Credential names match TOKEN, SECRET, PASSWORD, API_KEY, KEY, PASS and similar, case-insensitive with - read as _.
  • args and url are not masked.
  • The 400 message is translated; the .pot gains one string.

Evidence

  • Before: the Claude panel list and the editor's workspace copy contain Authorization and *_TOKEN values.
  • After: both carry ********. The masked document round-trips to the original, an edited value replaces the stored one, and a renamed server's mask is refused.

pytest tests/ 2531 passed, i18n check and Prettier clean.

Merge Danger

Door: two-way

The editor shows ******** for credential-named values. A user who saves a different value types it over the mask.

Blast Radius: MCP settings tabs and the MCP config file API

Closes #543

A key stored in config.json was sent to the browser in clear text and
filled a plain input. The capabilities response now carries a mask in
its place (model lists, stored chat_model and inline_completion_model
entries, claude_settings and acp_settings), ConfigHandler maps a posted
mask back to the stored key, and the key inputs are password fields.
LLMProviderProperty gains an opt-in `secret` flag.

Closes plmbr#542
…files

The Claude-mode server list masks every env and headers value. The NBI
MCP editor masks credential-named values in the temp copy it writes to
the workspace and restores them on save; a mask with nothing stored
behind it is refused with a 400.

Closes plmbr#543

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP server credentials are sent to the browser and written to the workspace in clear text

1 participant