Basic information
About mcp-graphql Server
Model Context Protocol server for GraphQL
mcp-graphql is a MCP server in the Other category listed in the AddMCP.net directory, published by blurrah. It exposes 2 tools, including introspect-schema, query-graphql. Supported transport: stdio. Runtime: node. License: MIT. The repository has 397 GitHub stars. Source code is hosted on github.com. Related topics: ai, llm, mcp, mcp-server, modelcontextprotocol.
Setup
{
"mcpServers": {
"mcp-graphql": {
"command": "npx",
"args": [
"mcp-graphql"
],
"env": {
"ENDPOINT": "http://localhost:3000/graphql"
}
}
}
}
{
"mcpServers": {
"mcp-graphql": {
"command": "npx",
"args": [
"mcp-graphql"
],
"env": {
"ENDPOINT": "http://localhost:3000/graphql"
}
}
}
}
{
"servers": {
"mcp-graphql": {
"command": "npx",
"args": [
"mcp-graphql"
],
"env": {
"ENDPOINT": "http://localhost:3000/graphql"
}
}
}
}
mcp-graphql config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-graphql": {
"command": "npx",
"args": [
"mcp-graphql"
],
"env": {
"ENDPOINT": "http://localhost:3000/graphql"
}
}
}
}
mcp-graphql tools
-
introspect-schema
— Introspect the GraphQL schema, use this tool before doing a query to get the schema information if you do not have it available as a resource already.
__ignore__:boolean -
query-graphql
— Query a GraphQL endpoint with the given query and variables
query:string*, variables:string
Overview
What is mcp-graphql?
mcp-graphql is a Model Context Protocol (MCP) server that enables LLMs to interact with GraphQL APIs. It provides schema introspection and query execution capabilities, allowing models to dynamically discover and use any GraphQL endpoint.
How to use mcp-graphql?
Set environment variables (ENDPOINT, HEADERS, ALLOW_MUTATIONS, NAME, SCHEMA) and run npx mcp-graphql. The server automatically introspects the schema and exposes tools for querying. It can be installed via Smithery or configured manually for Claude Desktop.
Key features of mcp-graphql
- Schema introspection via
introspect-schematool orgraphql-schemaresource - Execute GraphQL queries with the
query-graphqltool - Support for custom headers (e.g., authentication tokens)
- Option to provide a local or remote schema file instead of introspection
- Mutations disabled by default for security; enable with
ALLOW_MUTATIONS=true
Use cases of mcp-graphql
- LLM agents that need to query or modify data through a GraphQL API
- Dynamic discovery of GraphQL schema for building context-aware responses
- Testing or exploring GraphQL endpoints without writing custom code
Frequently asked questions
1 What does mcp-graphql do?
It acts as a bridge between LLMs (via the MCP protocol) and any GraphQL endpoint, enabling schema discovery and query execution.
2 How is mcp-graphql installed?
It can be installed automatically via Smithery (npx -y @smithery/cli install mcp-graphql --client claude) or manually by adding to Claude Desktop configuration with npx mcp-graphql and environment variables.
3 What dependencies does mcp-graphql require?
No special dependencies beyond Node.js; it runs via npx from the npm package.
4 How are authentication credentials handled?
Custom HTTP headers can be passed as a JSON string via the HEADERS environment variable, e.g., HEADERS='{"Authorization":"Bearer token123"}'.
5 Are GraphQL mutations allowed by default?
No, mutations are disabled by default as a security measure to prevent unintended database changes. Set ALLOW_MUTATIONS=true to enable them.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In