graphql -bridge
A bridge implementation connecting GraphQL APIs with the Model Context Protocol (MCP), enabling seamless integration between GraphQL services and MCP-compatible AI systems. This tool facilitates data exchange and API communication by translating GraphQL operations into MCP-compatible formats.
claude mcp add --transport stdio pshaddel-graphql-mcp-bridge node path/to/server.js \ --env HOST="Host to bind to (default 0.0.0.0)" \ --env PORT="Port the MCP server should listen on (default 3000)"
How to use
The GraphQL MCP Bridge turns a GraphQL schema into a set of MCP tools that are validated and type-safe at runtime. It preserves GraphQL field descriptions as tool descriptions and supports flexible configuration to control which operations are generated and how they’re named. You can feed a GraphQL schema into the bridge, obtain MCP-compatible tool definitions, and execute those tools with automatic input and output validation powered by Zod. This enables AI systems to interact with GraphQL services through the MCP protocol with strong guarantees about inputs, outputs, and field selections.
To use the bridge in practice, install the MCP server, start it, and point your MCP consumer at the server. The generated tools expose GraphQL query-like operations that accept strongly typed inputs and allow you to specify a safe subset of fields to fetch. The runtime validation ensures invalid field selections or mismatched inputs fail fast, making integration robust for production use.
How to install
Prerequisites:
- Node.js v24 or newer installed on your system
- npm, pnpm, or yarn for package management
- Git to clone the repository (optional if using npm install)
Install from npm:
- npm install -g graphql-mcp-bridge (or add to your project: npm install graphql-mcp-bridge)
- Ensure you have a GraphQL schema ready to convert into MCP tools, or reference the schema in your project
Configuration and running:
- Create a minimal server entry point (server.js) that initializes and exposes the MCP bridge using the library. Example contents would import the bridge, configure the GraphQL schema, and start listening on a port.
- Start the server: node path/to/server.js
- Verify the server is running by curling the MCP endpoint or using your MCP client to enumerate tools.
Optional:
- If you prefer a containerized approach, you can build a Docker image that runs node path/to/server.js and publishes the MCP port.
- Use environment variables to configure host, port, and any authentication if you add it to your server.
Notes:
- Ensure your GraphQL schema covers the necessary types and relationships for your MCP tools.
- Keep dependencies up to date to benefit from validation improvements and runtime safety.
Additional notes
Environment variables you may want to consider:
- PORT: Port to run the MCP server on (default 3000)
- HOST: Bind address (default 0.0.0.0)
- GRAPHQL_SCHEMA_PATH: Optional path to a local GraphQL schema file to be loaded at startup Common issues:
- If the server fails to start, check Node.js version compatibility and ensure the entry file path is correct
- Validate that your schema contains the necessary Query types for tool generation; very large schemas may benefit from incremental loading
- When integrating with MCP clients, ensure the client points to the correct host/port and handles validation errors gracefully
Related MCP Servers
Pare
Dev tools, optimized for agents. Structured, token-efficient MCP servers for git, test runners, npm, Docker, and more.
mie
Persistent memory graph for AI agents. Facts, decisions, entities, and relationships that survive across sessions, tools, and providers. MCP server — works with Claude, Cursor, ChatGPT, and any MCP client.
mcp -template
Cookiecutter template for MCP servers with one-click Render.com deployment - Generate production-ready API integration servers in minutes
mcp-ragex
MCP server for intelligent code search: semantic (RAG), symbolic (tree-sitter), and regex (ripgrep) search modes. Built for Claude Code and AI coding assistants.
ui-ux-pro
🎨 AI-powered UI/UX design intelligence - 1519+ curated design resources through MCP | React, Vue, Next.js, Flutter & more
mcp-debugpy
MCP server for AI-assisted Python debugging using debugpy and Debug Adapter Protocol