fix: list only granted MCP servers on the agent gateway
Draft
MF
2d ago+131+131+012345678901234567890123456789-68-68-01234567890123456789
Fixes DNO-1456
Why
An agent's gateway (/agent-mcp/{agentID}) listed every public MCP server in the organization, including ones nobody selected for the agent. The agent identity wizard says the agent "can reach nothing else".
Discussion
From the team thread:
- "Public" only skips Speakeasy sign-in. Most public servers need per-user upstream OAuth, so an agent can call one only with its own attached connection. Listing ungranted ones showed tools it could not use.
- The selection is stored as RBAC
mcp:connectgrants. So a key can now exclude a server with no upstream auth, which anyone can call. Slightly counterintuitive, but it matches the wizard. - Open question: how people keep an agent's selection current after setup.
What changed
Before: Public servers skipped the mcp:connect check on every gateway.
After:
admitMetaMemberstakespublicNeedsGrant. Only the agent gateway sets it, so organization and stored gateways still include public servers.- An ungranted public server is gone from
list_serversand returns "unknown server" on drill-down. - The admission shadow records each member's real visibility.
- Test fixtures add granted and ungranted public servers.
Agents that used an ungranted public server lose it.
š¤ Generated with Claude Code