The dashboard kept its MCP server cards in its own database, read with
find({}): every tenant saw, deleted and re-keyed the same cards, and a card
added by one tenant (with its mongodb_uri) showed to all (#432).
The cards now live in each tenant's database at the agent, behind
/api/v1/mcp-servers (list, create, delete, regenerate token), like the MCP
tokens. Tenant resolution, the role gate and support access apply as for
every agent route; the access tokens go only to roles that may change
things. A tenant without cards gets the three default cards on its first
listing (by name, so two listings at once do not create them twice), for
the dashboard's MCP_ENDPOINT_URL.
The dashboard's server functions call the agent; the health status is
probed live on each listing (concurrently, 3 s) instead of being written
back, so a read-only role no longer writes. At start the dashboard drops
its old shared collection, whose cards cannot be attributed to a tenant.
Closes#432.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p