Before submitting#
Area#
apps/desktop
Steps to reproduce#
- 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.
- 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.
- 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.
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?