Prerequisites
- A running Cosmo Router with a configured GraphQL schema (see Router Introduction)
- An AI tool that supports MCP (Claude Desktop, Cursor, Windsurf, VS Code, or similar)
Step 1: Create an Operations Directory
Create a directory to store the GraphQL operations that will be exposed to AI models:Step 2: Add Your First Operation
Create a fileoperations/getUsers.graphql with a named GraphQL operation. The description string becomes the tool description that AI models see:
Replace the operation above with a query that matches your actual GraphQL schema. The operation must be valid against your schema.
Step 3: Configure the Router
Add the MCP configuration to yourconfig.yaml:
Step 4: Start the Router
Start (or restart) your Cosmo Router. You should see a log message indicating the MCP server is listening:Step 5: Connect Your AI Tool
Choose your AI tool and add the MCP server configuration:- Cursor
- Claude Desktop
- VS Code
- Windsurf
Go to Settings > Tools & Integrations > MCP Servers and add:
Requires Cursor v0.48.0+ for Streamable HTTP support.
Step 6: Test It
In your AI tool, try a prompt like:GetUsers operation (exposed as execute_operation_get_users) and be able to describe it. Then try:
execute_operation_get_users tool and return the results.
What’s Next?
Create More Operations
Learn how to write effective operations with descriptions, handle mutations, and organize your operations directory.
Full Configuration
Explore all configuration options including session handling, storage providers, and advanced settings.
Secure with OAuth
Add OAuth 2.1 authorization with JWT validation and multi-level scope enforcement.
IDE Setup
Detailed setup guides for each AI tool, including header forwarding and authentication.