Integrations
Uses Axios to send requests to GraphQL endpoints, allowing for authenticated API interactions with configurable authorization tokens.
Acts as a bridge to any GraphQL API, providing tools to introspect schemas and execute arbitrary queries or mutations against the target GraphQL endpoint.
Built on Node.js to implement the Model Context Protocol server functionality, enabling GraphQL API interactions through standard I/O.
mcp4gql - GraphQL MCP Server
This project is a Node.js/TypeScript server that implements the Model Context Protocol (MCP). It acts as a bridge, allowing MCP clients (like Cursor) to interact with a target GraphQL API.
Features
- MCP Server: Implements the MCP
Server
class from@modelcontextprotocol/sdk
. - Stdio Transport: Communicates with clients via standard input/output.
- GraphQL Client: Uses
axios
to send requests to the configured GraphQL endpoint. - Generic GraphQL Tools: Exposes the following tools to MCP clients:
introspectGraphQLSchema
: Fetches the target GraphQL API schema using introspection.executeGraphQLOperation
: Executes arbitrary GraphQL queries or mutations against the target API, takingquery
, optionalvariables
, and optionaloperationName
as input.
Configuration
The server requires the following environment variables:
GRAPHQL_ENDPOINT
: The URL of the target GraphQL API.AUTH_TOKEN
: A bearer token for an optionalAuthorization: Bearer <token>
header for authenticating with the GraphQL API.
Client Configuration
To allow clients like Cursor or Claude Desktop to use the tools provided by this server, you need to configure them to run the npx
command.
Cursor
- Go to Cursor MCP Settings (Cursor > Settings > Cursor Settings > MCP)
- Go to + Add new global MCP server
- Add the following to your Cursor MCP configuration:Copy
Claude Desktop
- Open Claude Desktop settings (Claude > Settings).
- Go to Developer > Edit Config.
- Add to the config:Copy
Once configured, the MCP client should be able to list and call the introspectGraphQLSchema
and executeGraphQLOperation
tools provided by this server when relevant. Remember to set the required environment variables (GRAPHQL_ENDPOINT
and optionally AUTH_TOKEN
) in the configuration so the server can connect to your API.
You must be authenticated.
GraphQL MCP Server that acts as a bridge allowing MCP clients (like Cursor or Claude Desktop) to interact with target GraphQL APIs through standard tools for schema introspection and operation execution.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityMCP for working with GraphQL servers.Last updated -2536103TypeScriptMIT License
- -securityFlicense-qualityAn MCP server that enables graph database interactions with Neo4j, allowing users to access and manipulate graph data through natural language commands.Last updated -Python
- -securityFlicense-qualityA MCP server that exposes GraphQL schema information to LLMs like Claude. This server allows an LLM to explore and understand large GraphQL schemas through a set of specialized tools, without needing to load the whole schema into the contextLast updated -141JavaScript
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.Last updated -5361MIT License