- Home
- MCP servers
- MCP GraphQL Server
MCP GraphQL Server
- typescript
3
GitHub Stars
typescript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"launchthatbrand-mcp-graphql": {
"command": "npx",
"args": [
"mcp-graphql",
"--endpoint",
"http://localhost:3000/graphql"
]
}
}
}You run a Model Context Protocol (MCP) server named MCP GraphQL to let LLMs discover and interact with GraphQL APIs. It provides schema introspection and query execution so models can dynamically explore and query GraphQL endpoints.
How to use
Start the MCP GraphQL server using your MCP client. The server will automatically introspect GraphQL schemas or use a local schema if you provide one. By default mutations are disabled for safety, but you can enable them if you need write capabilities.
Key capabilities include discovering the GraphQL schema and executing queries or mutations (when enabled). Use an MCP client to send queries; the server exposes the GraphQL schema as a resource that clients can access.
How to install
Prerequisites: ensure you have Node.js installed on your system. You also need npm or npx available in your shell.
Install and configure the MCP GraphQL server using the following steps. If you want a quick start with the standard setup, use the provided command to run the MCP server via npx. You can also configure a local JSON snippet to specify the MCP server in your environment.
# Quick start: run MCP GraphQL against a remote GraphQL endpoint
npx mcp-graphql --endpoint http://localhost:3000/graphql
# Use custom headers (e.g., for auth)
npx mcp-graphql --endpoint https://api.example.com/graphql --headers '{"Authorization":"Bearer token123"}'
# Enable mutations (disable by default for safety)
npx mcp-graphql --endpoint http://localhost:3000/graphql --enable-mutations
# Use a local GraphQL schema file instead of introspection
npx mcp-graphql --endpoint http://localhost:3000/graphql --schema ./schema.graphql
Additional configuration and examples
You can place a configuration example in your MCP setup to register the server. The following JSON shows how to define the MCP GraphQL server in your setup:
{
"mcpServers": {
"mcp-graphql": {
"command": "npx",
"args": ["mcp-graphql", "--endpoint", "http://localhost:3000/graphql"]
}
}
}
Security considerations
Mutations are disabled by default to prevent unintended modification of data. Enable mutations only after carefully assessing the security implications and ensuring that your environment has proper access controls.
Available tools
introspect-schema
Retrieves the GraphQL schema using a local schema file or an introspection query to expose the available types and fields to the MCP client.
query-graphql
Executes GraphQL queries against the configured endpoint, returning results to the MCP client; mutations are disabled by default and can be enabled with a flag.