GROK BOT / when-stdio-mcp-points-at-deleted-agent-secrets

Grok Bot

When stdio MCP points at deleted agent secrets

When stdio MCP points at deleted agent secrets

A stdio MCP server can keep a spawn path under agents/<agentId>/secrets/… after that bot is deleted. Spawn then fails with ENOENT / failed_to_load. Restart MCP servers does not recreate the missing file. Staff (mohitjain, Sep 8, 2026): MCP server configs are account-wide; each bot’s agents/<agentId>/ folder deletes with the bot. A wrapper or symlink you left under that bot’s secrets/ disappears with it. Staff are tracking the leftover path as unintended. Thread: forum 170901.

Fix the spawn path

  1. Move wrappers and long-lived credentials to a bot-independent path, for example /home/box/mcp-wrappers/ (or another folder you control that is not under agents/<agentId>/).
  2. Re-point the MCP server command/args at that new path (or replace the wrapper with the real command: npx -y <pkg> / uvx <pkg> and pass keys through env).
  3. Run Restart MCP (or RestartMcpServers) so the new spawn path loads.
  4. Confirm the server leaves failed_to_load and tools respond.

Do not park durable wrappers only under a single agent’s secrets tree if you plan to delete that agent later.

Distinct from box secrets wipe

Desktop reconnect can overwrite the in-chat secure secrets store even when you never clicked Update/Reset: When desktop reconnect wipes Grok Bot box secrets. That is a different store and failure mode from a stdio spawn path into a deleted agent folder.

Pitfalls

  • Restart loops while the command still points at the deleted agents/<agentId>/secrets/… path.
  • Recreating the deleted agent only to hold a symlink — prefer a shared wrapper directory or a direct npx/uvx command with env.