What it doesBasics
- Per-session identity tagging
- Registry auto-start
- Reconnect with cached discovery
- Tool-list change notifications
- Environment forwarding for desktop-capable tools
First useBasics
- Verify a known read through the supplied connection.
- Let the stub connect or start the registry.
- Refresh discovery explicitly when needed after upstream recovery.
Everyday tasksEveryday use
Keep a client attached across registry restarts
A long-running agent session must continue through an upstream registry restart.
- Start the stub with one reviewed upstream endpoint.
- Initialize the downstream client and discover tools.
- Restart the upstream, allow reconnect, then refresh discovery explicitly when the client needs the current catalog.
What you getThe client keeps one stdio connection and its last catalog, and execution resumes after recovery.
How to check: Connection tracing confirms recovery, and a list-change notification can signal catalog changes.
Add authorized tools mid-session
A registry backend becomes available only after user authorization.
- Connect the agent through the stub to the registry.
- Complete the registry authorization while the session remains open.
- Receive the upstream tool-list change and refresh discovery.
What you getNewly authorized tools appear without restarting the agent client.
How to check: Relayed list-change notification and refreshed tool list demonstrate the transition.
Settings to decideAdvanced
- Upstream selection
- Configure exactly one Unix socket or HTTP upstream; avoid ambiguous simultaneous selections.
- Registry auto-start
- Enable auto-start only when the stub should own registry launch. The documented forwarding set is the default; MCP_STUB_FORWARD_ENV replaces it, while MCP_STUB_REGISTRY_ENV adds explicit values and wins on duplicate keys.
- Session identity
- Set stable, non-secret tags when registry-side attribution is useful. Labels aid diagnosis. Upstream, the stub reports itself as MCP Stub:session=<tag>;identity=<tag>.
- Notification relay
- Keep relay enabled when clients need signals about changing tools, resources, prompts, or backend-specific events. Refresh explicitly when current discovery matters.
CommandsAdvanced
Problems and fixesHelp
Good to knowHelp
- The tool list stays discoverable while the upstream reconnects.
- Inspect the destination before repeating a change whose result is unclear.
- Connection and identity labels support diagnosis and per-agent attribution.