Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Chat-pasted MCP secrets cannot be saved to the secret store via t3_mcp_server_update and end up plaintext in settings.json #47230

OpenFocus2321(GitHub profile, opens in a new tab) opened this issue 1 comment

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. In a T3 Code thread, ask the agent to add an HTTP MCP server that requires an API token (e.g., an Authorization: Bearer <token> header) and paste the token in the chat message.
  2. Have the agent store the pasted token with request_secret using value and delivery: "secretRef" so it can pass the resulting secretRef into t3_mcp_server_update.
  3. Alternatively, omit delivery: "secretRef" on request_secret with value, then try to configure the MCP server with t3_mcp_server_update.

Expected behavior

When a user pastes an MCP token in chat, the agent should be able to save it into T3 Code's secret store (sensitive: true, valueRedacted: true in settings.json, shown as { stored: true } by t3_mcp_servers_read) without forcing the user to re-enter it in a secret card or falling back to plaintext in settings.json.

Actual behavior

  • Calling request_secret with value and delivery: "secretRef" fails with: A pasted `value` is saved as a file. Leave out `delivery: "secretRef"`.
  • Omitting delivery: "secretRef" saves the secret to the secrets files subdirectory and returns a file path instead of a secretRef.
  • t3_mcp_server_update only accepts a raw string, { secretRef, prefix? }, or { stored: true }, and hardcodes any raw string to sensitive: false (apps/server/src/mcp/toolkits/environment/handlers.ts).
  • Because the agent cannot obtain a secretRef for the pasted token, it falls back to passing the raw string to t3_mcp_server_update, writing the token in plaintext into settings.json (which has 644 permissions) and leaving an unused copy in the secrets files subdirectory. t3_mcp_servers_read then returns the full plaintext token rather than { stored: true }.

Impact

Minor bug or occasional failure

Version or commit

0.1.14-nightly.20261201.5550

Environment

macOS 27.2.1, T3 Code (Nightly) 0.1.14-nightly.20261201.5550

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

Call request_secret without value so the user re-enters the token in the private secret card (returning a secretRef) and pass { secretRef, prefix } to t3_mcp_server_update, or mark the header as sensitive in T3 Code's MCP settings UI.

  1. Focus2321(GitHub profile, opens in a new tab) added labelsneeds-triage

  2. When a user pastes an MCP token in chat, the agent should be able to save it into T3 Code's secret store (sensitive: true, valueRedacted: true in settings.json, shown as { stored: true } by t3_mcp_servers_read) without forcing the user to re-enter it in a secret card or falling back to plaintext in settings.json.

    Why? If you paste it in chat it's already leaked out to plaintext in multiple places. Why do you then feel the need to store it as a sensitive variable?

  3. juliusmarminge removed labelsbug

  4. juliusmarminge removed labelsneeds-triage

  5. juliusmarminge added labelsneeds more info

Sign in to join this conversation.