The Cosmo Router MCP Gateway lets you expose federated GraphQL schemas to AI agents as reviewed, OAuth-scoped MCP tools. Two configuration flags control posture: expose_schema and enable_arbitrary_operations. In development, both are open so agents can explore and draft queries; in production, both are closed and agents can only execute pre-approved .graphql operation files. Each safelisted operation becomes a discrete MCP tool with typed inputs, validated against the composed schema at load time and on hot reload. OAuth 2.1 with JWT enforcement and @requiresScopes directives provide per-operation, per-agent authorization. Additive schema changes require no operation updates; breaking changes cause the affected operation to be skipped and logged. This approach avoids building a parallel AI-safe API by encoding the AI-facing surface as standard GraphQL persisted documents on existing infrastructure.

8m read timeFrom wundergraph.com
Post cover image
Table of contents
One MCP server, two posturesHow it worksDevelopment: design against the live schemaThe promotion boundary: operations become software artifactsProduction: collapse to the safelistOAuth: per-operation authorizationSchema evolution does not become operation maintenanceWhy not build a separate AI-safe API?Get started
111 Impressions