feat(mcp): public read-only demo endpoint at /mcp/demo (unblocks directory crawlers, no tenant exposure)#346
Merged
Conversation
…crawlers Our per-tenant MCP endpoints return 401 to anonymous callers (by design), so directory crawlers (Glama, Smithery, mcp.so) and curious agents can't introspect a working server — which blocks listings and the Glama quality score. Add a public, anonymous, STATIC demo MCP server at the exact path /mcp/demo: - Exposes only self-describing info tools (overview, get-started, connect-client, list-connectors) that return text about AnythingMCP. It NEVER resolves a serverId, queries the database, or touches connectors/tenant data — so it has nothing to leak. - Declared before the :serverId routes so the static segment wins matching. - The combined auth guard exempts ONLY the exact path /mcp/demo; every /mcp/:serverId stays fail-closed. Tenant isolation is unchanged. - Rate-limited (60/min) since it's public; makes zero outbound calls. Tests: guard exempts exact /mcp/demo (incl. trailing slash) but denies real server ids and look-alikes (/mcp/demo-evil); controller demo handler never calls findById/getConnectorIds/isUserInOrganization. 16/16 pass. Use this URL in directory listings and as a Glama "connectors" entry so the hosted endpoint introspects cleanly without exposing the multi-tenant cloud.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Our MCP endpoints (
/mcp,/mcp/:serverId) return 401 to anonymous callers — correct for a multi-tenant product, but it means directory crawlers (Glama, Smithery, mcp.so) and curious agents can't introspect a working MCP server. That blocks listings and the Glama quality score (which gates the awesome-mcp-servers PR, 89k★).What
A public, anonymous, static demo MCP server at the exact path
/mcp/demo:anythingmcp_overview,anythingmcp_get_started,anythingmcp_connect_client,anythingmcp_list_connectors— that return text about the product. It never resolves a serverId, queries the DB, or touches connectors/tenant data, so it has nothing to leak.:serverIdroutes so the static segment wins route matching./mcp/demo; every/mcp/:serverIdstays fail-closed. Tenant isolation is unchanged.Multi-tenant safety
/mcp/demo./mcp/demo(and trailing slash) but denies real server ids and look-alikes like/mcp/demo-evil;findById/getConnectorIds/isUserInOrganization.Tests
tscclean; guard + controller specs 16/16 pass.Follow-up
Point directory listings (Smithery, mcp.so) and a Glama "connectors" entry at
https://cloud.anythingmcp.com/mcp/demoso the hosted endpoint introspects cleanly.