We built a bridge between GraphQL and Claude that lets AI interact with your existing APIs - without special knowledge or code changes.
I spent an afternoon levering the strongly typed power of GraphQL into something useful for LLMs
AI assistants are stuck in their own world:
I wanted to empower LLMs to be able to introspect a graphql API as simply as a user/developer can hit /playground.
GraphQL MCP is the answer. It sits between Claude and any GraphQL API, self-discovering operations as tools for Claude (or other tool enabled LLMs) to use.
I built it with some core principles:
It's like a universal adapter - plug in any GraphQL API, and Claude instantly knows how to use it.
No magic here. It's leveraging GraphQL's built-in introspection:
Take a look at the core of it:
// From an AI request to a proper GraphQL query
const query = `
query ${name}Query${varDefs ? `(${varDefs})` : ""} {
${name}${fieldArgs ? `(${fieldArgs})` : ""} ${
selectionSet ? `{\n${selectionSet} }` : ""
}
}
`;This takes Claude's generic "get me X" and turns it into a proper GraphQL query with all the type safety and structure intact.
Think about what this enables:
Instead of AI being isolated, it becomes integrated with your existing stack.
Stupidly simple:
# Install it
copy the repo <path>
# Run it with your API
GRAPHQL_API_ENDPOINT=https://your-api.com/graphql graphql-mcp-serverThen tell Claude Desktop about it:
{
"mcpServers": {
"graphql": {
"command": "node",
"args": ["path/to/graphql-mcp-server.js"],
"env": {
"GRAPHQL_API_ENDPOINT": "https://your-api.com/graphql"
}
}
}
}That's it. No code needed. It just works.
I built this with the real world in mind:
You control access granularly:
WHITELISTED_QUERIES="getUser,getProducts,getOrders"
WHITELISTED_MUTATIONS="createOrder,updateProfile"The trickiest aspects of building this:
Most painful? Getting the field selection algorithm right. You need enough data to be useful, but not so much that you create N+1 query hell.
This is just the start:
The pattern matters more than the code - creating universal bridges between AI and existing systems without rebuilding everything.
Built with:
Check it out: GitHub repo
Want to go deeper? Hit me up at chris@ctkadvisors.net.
We're building infrastructure for the world where AI and your existing systems work together. Not theoretically or tomorrow - right now.