Sign In

@supernova123/graphql-mcp-server

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@supernova123/graphql-mcp-server

MCP server for GraphQL — schema introspection, auto-generated tools, query/mutation execution for Claude, Cursor, and AI agents

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

GraphQL MCP Server

npm License: MIT

MCP server for GraphQL — schema introspection, auto-generated tools, query/mutation execution for Claude, Cursor, and AI agents.

What It Does

Connects to any GraphQL endpoint and gives AI agents the ability to:

  • Introspect schemas — discover all types, queries, mutations, and subscriptions
  • Execute queries and mutations — raw GraphQL strings or typed field-based calls
  • Search and explore — find types, fields, and arguments across the schema
  • Manage connections — switch endpoints, configure auth, cache schemas

Quick Start

npx @supernova123/graphql-mcp-server

Set your endpoint via environment variable:

GRAPHQL_ENDPOINT=https://your-api.com/graphql npx @supernova123/graphql-mcp-server

Or configure at runtime with the connect_endpoint tool.

Tools (20)

Connection & Configuration

ToolDescription
connect_endpointSet or change the active GraphQL endpoint
set_auth_tokenConfigure Bearer token authentication
set_basic_authConfigure HTTP Basic authentication
set_headersReplace custom HTTP headers
add_headerAdd/update a single header
remove_headerRemove a header
get_connection_statusShow endpoint config, auth state, and schema cache

Schema Introspection

ToolDescription
introspect_schemaFetch the full schema via introspection
list_typesList all types (filter by kind or name)
describe_typeGet full details of a single type
list_queriesList all root query fields
list_mutationsList all root mutation fields
list_subscriptionsList all root subscription fields
describe_fieldGet full details of a field
search_schemaSearch types and fields by substring

Execution

ToolDescription
execute_querySend a raw GraphQL query
execute_mutationSend a raw GraphQL mutation
execute_typed_queryExecute a query by field name (auto-constructed)
execute_typed_mutationExecute a mutation by field name (auto-constructed)

Cache Management

ToolDescription
get_cached_schemaReturn the cached introspection result
clear_cacheClear schema cache
reload_schemaForce a fresh introspection

Environment Variables

VariableDescriptionDefault
GRAPHQL_ENDPOINTGraphQL endpoint URL(none — must configure at runtime)
GRAPHQL_AUTH_TOKENBearer token for Authorization header(none)
GRAPHQL_BASIC_USERBasic auth username(none)
GRAPHQL_BASIC_PASSBasic auth password(none)
GRAPHQL_TIMEOUT_MSRequest timeout in milliseconds30000
GRAPHQL_HEADER_*Custom headers (e.g. GRAPHQL_HEADER_X_API_KEY=secret)(none)

Configuration (Claude Desktop)

{
  "mcpServers": {
    "graphql": {
      "command": "npx",
      "args": ["-y", "@supernova123/graphql-mcp-server"],
      "env": {
        "GRAPHQL_ENDPOINT": "https://your-api.com/graphql",
        "GRAPHQL_AUTH_TOKEN=***"
      }
    }
  }
}

Features

  • No external GraphQL library — minimal dependency surface, works at the HTTP layer
  • Schema caching — introspect once, reuse across tool calls
  • Retry with backoff — transient errors (5xx, 429, timeouts) are retried automatically
  • Output sanitization — ANSI stripping and length capping prevent prompt injection
  • Type-safe — TypeScript with Zod validation on all tool inputs
  • Auth flexibility — Bearer tokens, Basic auth, or arbitrary HTTP headers

Development

npm install
npm run build
npm test

License

MIT

Keywords

agent-tools

FAQs

Package last updated on 23 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts