Part of epic #3306.
Problem
We already run an MCP server at api/mcp.ts (routed publicly at https://worldmonitor.app/mcp via vercel.json rewrite). Protocol version 2025-03-26, server name worldmonitor, version 1.0, auth via PRO API key Bearer, 60 req/min per-key rate-limited.
What's missing is the discovery manifest — SEP-1649 MCP Server Card at /.well-known/mcp/server-card.json. Without it, MCP clients can't discover our endpoint from the origin; users must paste the /mcp URL manually.
Fix
Publish a static card at public/.well-known/mcp/server-card.json:
{
"$schema": "https://modelcontextprotocol.io/schemas/server-card.json",
"serverInfo": {
"name": "worldmonitor",
"version": "1.0"
},
"transport": {
"type": "streamableHttp",
"endpoint": "https://worldmonitor.app/mcp"
},
"capabilities": {
"tools": true,
"resources": false,
"prompts": false
},
"authentication": {
"type": "oauth2",
"authorization_servers": ["https://api.worldmonitor.app"],
"resource": "https://api.worldmonitor.app",
"scopes": ["mcp"]
}
}
Important — align with existing OAuth metadata. public/.well-known/oauth-protected-resource (already live) declares:
resource: "https://api.worldmonitor.app"
authorization_servers: ["https://api.worldmonitor.app"]
scopes_supported: ["mcp"]
The MCP card MUST match these values exactly. We self-host OAuth at api/oauth/{authorize,token,register}.js; we do not delegate to Clerk for MCP auth.
Fields to confirm at implementation
transport.type — our server is Vercel edge + streamable HTTP; validate against the SEP-1649 schema at landing time (spec still moving).
capabilities — enumerate from the tool registry in api/mcp.ts (tools only today; no resources/prompts).
Implementation
Dependencies
Acceptance criteria
References
Part of epic #3306.
Problem
We already run an MCP server at
api/mcp.ts(routed publicly athttps://worldmonitor.app/mcpviavercel.jsonrewrite). Protocol version2025-03-26, server nameworldmonitor, version1.0, auth via PRO API key Bearer, 60 req/min per-key rate-limited.What's missing is the discovery manifest — SEP-1649 MCP Server Card at
/.well-known/mcp/server-card.json. Without it, MCP clients can't discover our endpoint from the origin; users must paste the/mcpURL manually.Fix
Publish a static card at
public/.well-known/mcp/server-card.json:{ "$schema": "https://modelcontextprotocol.io/schemas/server-card.json", "serverInfo": { "name": "worldmonitor", "version": "1.0" }, "transport": { "type": "streamableHttp", "endpoint": "https://worldmonitor.app/mcp" }, "capabilities": { "tools": true, "resources": false, "prompts": false }, "authentication": { "type": "oauth2", "authorization_servers": ["https://api.worldmonitor.app"], "resource": "https://api.worldmonitor.app", "scopes": ["mcp"] } }Important — align with existing OAuth metadata.
public/.well-known/oauth-protected-resource(already live) declares:resource: "https://api.worldmonitor.app"authorization_servers: ["https://api.worldmonitor.app"]scopes_supported: ["mcp"]The MCP card MUST match these values exactly. We self-host OAuth at
api/oauth/{authorize,token,register}.js; we do not delegate to Clerk for MCP auth.Fields to confirm at implementation
transport.type— our server is Vercel edge + streamable HTTP; validate against the SEP-1649 schema at landing time (spec still moving).capabilities— enumerate from the tool registry inapi/mcp.ts(tools only today; no resources/prompts).Implementation
public/.well-known/mcp/server-card.json.Content-Type: application/json.vercel.jsonalready has/.well-known/(.*)rewrites — verify it doesn't get stripped.middleware.tsshort-UA guard: confirm.well-knownpaths aren't 403'd for Node/undici clients (memory:feedback_middleware_short_ua_gate_blocks_node_fetch).Dependencies
scopes_supportedinoauth-protected-resource, bump it here in the same PR.capabilitieshere.Acceptance criteria
curl -s https://worldmonitor.app/.well-known/mcp/server-card.jsonreturns valid JSON.transport.endpointresponds to MCPinitializeRPC.authentication.authorization_servers+resource+scopesmatch/.well-known/oauth-protected-resourcebyte-for-byte on those fields.isitagentready.com"MCP Server Card" check passes.References
api/mcp.ts(public at/mcpviavercel.jsonrewrite)api/oauth/{authorize,token,register}.js, advertised at/.well-known/oauth-{protected-resource,authorization-server}