What is Graphql To Mcp?
Graphql To Mcp turns any GraphQL API into MCP (Model Context Protocol) tools with zero configuration. By pointing it at a GraphQL endpoint, it automatically discovers all queries and mutations via introspection and generates one MCP tool per operation. It works with Claude Desktop, Cursor, Windsurf, and any MCP client.
How to use Graphql To Mcp?
Run it directly with npx graphql-to-mcp <graphql-endpoint-url> (no install needed) or add it to a Claude Desktop or Cursor config file under mcpServers. Optional flags include --bearer, --api-key, --include, --exclude, --prefix, --timeout, --max-retries, and --transport. It can also be used programmatically via the createServer function.
Key features of Graphql To Mcp
- Zero configuration – just provide a GraphQL endpoint URL
- Auto-introspection discovers all queries and mutations
- Flat parameter schemas improve LLM accuracy
- Smart truncation handles large responses (array slicing, depth limiting, character cap)
- Auth support: Bearer tokens, API keys, and custom headers
- Include/exclude filters to control which operations are exposed
Use cases of Graphql To Mcp
- Give an LLM like Claude access to query and mutate a GraphQL API
- Combine multiple GraphQL APIs in one MCP client using the
--prefix option
- Pair with
mcp-openapi to expose both GraphQL and REST endpoints to the same LLM
- Securely expose a subset of operations to an AI assistant using include/exclude filters
评论