
Security News
Cloudflare Introduces a Faster TypeScript Compiler Written in Rust
Cloudflare introduces tsrs, a Rust port of TypeScript’s compiler promising faster checks and lower memory use, with the TypeScript team’s help.
graphql-inspector-mcp
Advanced tools
MCP server for GraphQL introspection, query execution, and mutation support with safety controls
A Model Context Protocol (MCP) server that provides comprehensive GraphQL introspection capabilities with filtering and detailed analysis features.
ALLOW_MUTATIONS flagBy default, only read-only operations are available:
execute_query — executes GraphQL queries onlyTo enable mutation execution, set the ALLOW_MUTATIONS environment variable:
ALLOW_MUTATIONS=true npx graphql-inspector-mcp
Or in your MCP config:
{
"mcpServers": {
"graphql-introspection": {
"command": "npx",
"args": ["-y", "graphql-inspector-mcp"],
"env": {
"ALLOW_MUTATIONS": "true"
}
}
}
}
When enabled, the execute_mutation tool becomes available.
Three layers of protection prevent unauthorized mutations:
execute_mutation is hidden from tool discovery when ALLOW_MUTATIONS is not setexecute_mutation rejects when not in dangerous modereadOnlyHint for MCP-aware clientsnpm install
npm run build
You can run the tool directly via npx:
npx graphql-inspector-mcp
This will start the MCP server and expose GraphQL introspection tools.
The following arguments can be provided via JSON config, environment variables, or MCP tool requests. They are not traditional CLI flags, but are passed as options to the server or tools.
| Argument | Type | Description | Example Value |
|---|---|---|---|
endpoint | string | GraphQL endpoint URL (default: http://localhost:5555/graphql) | http://localhost:5555/graphql |
username | string | Username for basic authentication (optional) | admin |
password | string | Password for basic authentication (optional) | secret |
bearer_token | string | Bearer token for authentication (optional) | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... |
search | string | Search pattern to filter queries, mutations, or types (case-insensitive) | user |
detailed | boolean | Return detailed information (default: false) | true |
kind | string | Filter by type kind (OBJECT, SCALAR, ENUM, INTERFACE, UNION, INPUT_OBJECT) | OBJECT |
type_name | string | Name of the type to get details for | User |
field_name | string | Name of the field to get details for | getUser |
operation_type | string | Type of operation (query or mutation) | query |
query | string | GraphQL query or mutation string | query { users { id name } } |
variables | object | Variables for the GraphQL operation (optional) | {"userId": "123"} |
operation_name | string | Name of the operation to execute (optional, for multi-operation documents) | GetUserById |
npx graphql-inspector-mcp
With config file (mcp.config.json):
{
"mcpServers": {
"graphql-introspection": {
"command": "npx",
"args": [
"-y",
"kokorolx/graphql-inspector-mcp"
],
"options": {
"endpoint": "http://localhost:5555/graphql"
}
}
}
}
Or via environment variables:
export GRAPHQL_DEFAULT_ENDPOINT="http://localhost:4000/graphql"
export CACHE_DURATION_MS="600000"
Or via MCP tool request JSON:
{
"endpoint": "http://localhost:5555/graphql",
"search": "user",
"detailed": true
}
The MCP config file allows you to customize server settings and tool behavior. By default, the config file should be named mcp.config.json and placed in your project root.
Example mcp.config.json:
{
"mcpServers": {
"graphql-introspection": {
"command": "npx",
"args": [
"-y",
"kokorolx/graphql-inspector-mcp"
],
"options": {
"endpoint": "http://localhost:5550/graphql"
}
}
}
}
./mcp.config.json)Get complete GraphQL schema introspection with SDL and structured data.
{
"endpoint": "http://localhost:5555/graphql",
"username": "optional_username",
"password": "optional_password",
"bearer_token": "optional_bearer_token"
}
Filter and list available GraphQL queries with optional search.
{
"endpoint": "http://localhost:5555/graphql",
"search": "user",
"detailed": true
}
Filter and list available GraphQL mutations with optional search.
{
"endpoint": "http://localhost:5555/graphql",
"search": "create",
"detailed": false
}
Filter and list available GraphQL types by kind and search pattern.
{
"endpoint": "http://localhost:5555/graphql",
"search": "User",
"kind": "OBJECT",
"detailed": true
}
Supported type kinds:
OBJECT - Object typesSCALAR - Scalar typesENUM - Enumeration typesINTERFACE - Interface typesUNION - Union typesINPUT_OBJECT - Input object typesGet comprehensive information about a specific GraphQL type.
{
"type_name": "User",
"endpoint": "http://localhost:5555/graphql"
}
Get detailed information about a specific query or mutation field.
{
"field_name": "getUser",
"operation_type": "query",
"endpoint": "http://localhost:5555/graphql"
}
Execute a read-only GraphQL query against the endpoint.
{
"query": "query { users { id name email } }",
"variables": {},
"endpoint": "http://localhost:5555/graphql"
}
Execute a GraphQL mutation (requires ALLOW_MUTATIONS=true).
{
"query": "mutation { createUser(name: \"John\") { id name } }",
"variables": {},
"endpoint": "http://localhost:5555/graphql"
}
The server supports multiple authentication methods:
{
"endpoint": "https://api.example.com/graphql",
"username": "your_username",
"password": "your_password"
}
{
"endpoint": "https://api.example.com/graphql",
"bearer_token": "your_jwt_token"
}
All responses are structured JSON optimized for AI processing:
{
"success": true,
"endpoint": "http://localhost:5555/graphql",
"data": {
// ... relevant data
}
}
{
"success": false,
"error": "Error description",
"endpoint": "http://localhost:5555/graphql"
}
{
"success": true,
"endpoint": "http://localhost:5555/graphql",
"search_term": "user",
"queries": [
{
"name": "getUser",
"description": "Fetch a user by ID",
"deprecated": false,
"deprecation_reason": null
},
{
"name": "searchUsers",
"description": "Search users by criteria",
"deprecated": false,
"deprecation_reason": null
}
],
"total": 2
}
{
"success": true,
"endpoint": "http://localhost:5555/graphql",
"queries": [
{
"name": "getUser",
"description": "Fetch a user by ID",
"deprecated": false,
"deprecation_reason": null,
"arguments": [
{
"name": "id",
"description": "User ID",
"type": {
"kind": "NON_NULL",
"of_type": {
"kind": "SCALAR",
"name": "ID"
},
"is_required": true
},
"default_value": null
}
],
"return_type": {
"kind": "OBJECT",
"name": "User",
"description": "A user in the system"
}
}
],
"total": 1
}
{
"success": true,
"endpoint": "http://localhost:5555/graphql",
"type": {
"name": "User",
"kind": "OBJECT",
"description": "A user in the system",
"fields": [
{
"name": "id",
"description": "Unique identifier",
"type": {
"kind": "NON_NULL",
"of_type": {
"kind": "SCALAR",
"name": "ID"
},
"is_required": true
},
"deprecated": false,
"deprecation_reason": null
},
{
"name": "email",
"description": "User email address",
"type": {
"kind": "SCALAR",
"name": "String"
},
"deprecated": false,
"deprecation_reason": null
}
],
"interfaces": [],
"possible_types": null
}
}
The server implements in-memory caching with the following characteristics:
The server provides comprehensive error handling for:
npm run build
npm run dev
npm run clean
npm run build
http://localhost:5555/graphql| Variable | Default | Description |
|---|---|---|
GRAPHQL_DEFAULT_ENDPOINT | http://localhost:5555/graphql | Default GraphQL endpoint |
CACHE_DURATION_MS | 300000 | Cache duration in milliseconds (5 minutes) |
ALLOW_MUTATIONS | false | Enable mutation execution (true to enable) |
detailed: true when you need comprehensive informationsuccess field in responseskind parameter when filtering typesdetailed: false for quick overviewsSchema not found
Authentication failures
Network timeouts
Enable debug logging by setting the environment variable:
export DEBUG=graphql-introspection:*
MIT License - see LICENSE file for details.
FAQs
MCP server for GraphQL introspection, query execution, and mutation support with safety controls
The npm package graphql-inspector-mcp receives a total of 0 weekly downloads. As such, graphql-inspector-mcp popularity was classified as not popular.
We found that graphql-inspector-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare introduces tsrs, a Rust port of TypeScript’s compiler promising faster checks and lower memory use, with the TypeScript team’s help.

Security News
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.

Security News
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.