WunderGraph
Read post

Safelist GraphQL Operations for AI Agents | Cosmo MCP Gateway

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.

    #ai-agents#graphql#mcp#oauth
Jun 12•8m read time•From 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
WunderGraph's image
WunderGraph

Wundergraph is a blog or publication focused on GraphQL, a query language and runtime for APIs. Thro...

34 Followers

•

437 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard