GraphMCP
This server is a GraphQL MCP server providing four fixed tools for AI agents to interact with a GraphQL API. You can:
Fetch the GraphQL schema (
graphql_schema) → Get the full SDL with documentation to understand types, fields, and operations.Validate queries pre‑execution (
graphql_validate) → Check syntax, valid fields, and nesting depth without executing; receive errors and depth info.Execute read‑only queries (
graphql_query) → Fetch data with complex nested selections and variables; mutations are rejected.Execute mutations (writes) (
graphql_mutate) → Perform create/update/delete operations only when the server is started withGRAPHMCP_ALLOW_MUTATIONS=1(or equivalent).Safety & self‑correction → Enforces configurable limits on depth, complexity, and result size; returns structured GraphQL errors to aid agent self‑correction.
Mock blog dataset → In‑memory sample data (users, posts, comments) that resets on restart, ideal for testing.
Performance → Internal caching avoids re‑parsing and re‑validating repeated queries.
MCP integration → Works with any MCP client (Claude Desktop, VS Code agent mode, etc.).
Provides a GraphQL interface over configurable data sources, enabling agents to discover the schema, validate queries, and execute read/write operations through a single typed API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GraphMCP Who commented on Grace Hopper's posts?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Anansi
An MCP server that speaks GraphQL. Named for the spider who owns all stories: instead of exposing one tool per endpoint, Anansi spins your backend into a single typed web. The agent reads the schema, then composes exactly the query it needs — nested relations in one call, only the fields it wants.
Ships with a mock blog dataset (users → posts → comments) so you can try it the moment you clone it.
Why
Concern | Tool-per-endpoint MCP server | Anansi |
Tool count | Grows with the API (tool explosion) | 4 fixed tools |
Over-fetching | Full payloads → wasted tokens | Agent selects only needed fields |
Related data | One round trip per relation | Nested selections, single call |
Discoverability | Prose tool descriptions | Typed schema (SDL) with doc strings |
Self-correction | Errors only after execution | Pre-flight |
Related MCP server: anyapi-mcp-server
Quickstart
No clone needed (any MCP client)
With uv installed, add this to your MCP client config (Claude Desktop, VS Code, etc.):
{
"mcpServers": {
"anansi": {
"command": "uvx",
"args": ["anansi-mcp"],
"env": { "ANANSI_ALLOW_MUTATIONS": "1" }
}
}
}From source
Requires Python 3.10+.
git clone https://github.com/NarglesCS/anansi.git
cd anansi
python -m venv .venv
# Windows
.venv\Scripts\python.exe -m pip install -e ".[dev]"
.venv\Scripts\python.exe -m pytest -q # verify: 12 tests
# macOS / Linux
.venv/bin/python -m pip install -e ".[dev]"
.venv/bin/python -m pytest -qInteracting with it
Option 1 — MCP Inspector (fastest way to poke at the mock data)
npx @modelcontextprotocol/inspector .venv/Scripts/python.exe -m anansi.serverOpens a browser UI where you can list the tools, read the graphql://schema
resource, and run queries by hand.
Option 2 — VS Code agent mode
.vscode/mcp.json is preconfigured. Open the repo in VS Code,
start the anansi server from the MCP view, then ask Copilot agent mode things
like "Who commented on Grace Hopper's posts?" and watch it discover the schema
and compose queries.
Option 3 — Any MCP client (Claude Desktop, etc.)
{
"mcpServers": {
"anansi": {
"command": "/absolute/path/to/anansi/.venv/bin/python",
"args": ["-m", "anansi.server"],
"env": { "ANANSI_ALLOW_MUTATIONS": "1" }
}
}
}(On Windows the command is ...\anansi\.venv\Scripts\python.exe.)
What the server exposes
Kind | Name | Purpose |
Resource |
| The SDL, loadable as context up front |
Tool |
| Same SDL for clients that prefer tools over resources |
Tool |
| Parse + validate + measure depth without executing |
Tool |
| Read-only execution; mutations rejected |
Tool |
| Writes, only when |
Example: query the mock data
query($role: Role) {
users(role: $role) {
name
posts(limit: 2) {
title
comments { author { name } text }
}
}
}with variables {"role": "ADMIN"} returns, in one round trip:
{"data": {"users": [{"name": "Ada Lovelace", "posts": [{"title": "...", "comments": [...]}]}]}}Example: write to the mock data
mutation($input: CreatePostInput!) {
createPost(input: $input) { id published }
}with {"input": {"authorId": "u3", "title": "Hello", "body": "..."}}.
The store is in-memory — restart the server and you're back to the seed data.
Configuration
Env var | Default | Effect |
| off | Set to |
|
| Max query nesting depth (fragment-cycle safe) |
|
| Max total fields selected per request (breadth guard) |
|
| Max serialized result size; |
Other rails: graphql_query hard-rejects mutations, subscriptions are always
rejected, and all errors come back as standard GraphQL {message, locations, path}
shapes that models know how to read and repair. Guard failures include a
remediation hint so agents can self-correct. Repeated queries skip
re-parsing/re-validation via an internal cache (execution is never cached).
How it's built
flowchart LR
Agent["AI agent (MCP client)"] -- "MCP stdio" --> Tools
subgraph Anansi["Anansi server"]
direction TB
Tools["Tools: graphql_query / graphql_validate / graphql_mutate / graphql_schema"]
Schema["Resource: graphql://schema (SDL)"]
Engine["Engine: parse → gate ops → validate → depth-check → execute"]
Resolvers["Resolvers"]
end
Tools --> Engine --> Resolvers --> Store[("In-memory mock store<br/>(swap for DB / REST fan-out / services)")]
Agent -. "reads schema" .-> SchemaEach layer is independently swappable:
src/anansi/data.py — in-memory mock dataset. Replace with any real backend.
src/anansi/schema.py — SDL with doc strings (they travel to the model) + resolver wiring.
src/anansi/engine.py — execution pipeline with safety rails; no MCP dependency.
src/anansi/server.py — thin MCP wiring: tools, resource, instructions.
Roadmap ideas
Swap
data.pyfor a real datasource (SQL, REST fan-out, microservices) — the classic GraphQL gateway pattern, now agent-facing.Per-field auth, query cost analysis, timeouts, result-size caps.
Persisted-query allowlists for high-trust deployments.
GraphQL subscriptions mapped onto MCP notifications.
License
Contributions and issues welcome.
Available Tools
4 toolsgraphql_mutateA
Execute a GraphQL mutation (write operation).
Only permitted when the server is started with GRAPHMCP_ALLOW_MUTATIONS=1. Example:
mutation($input: CreatePostInput!) { createPost(input: $input) { id } }
Inputs: mutation (required), variables. Returns: object
graphql_queryA
Execute a read-only GraphQL query and return {"data", "errors"}.
Select only the fields you need. Example:
query($role: Role) {
users(role: $role) { name posts(limit: 2) { title } }
}with variables {"role": "ADMIN"}. Mutations are rejected here.
Inputs: query (required), variables. Returns: object
graphql_schemaA
Return the GraphQL schema (SDL). Call this before writing queries.
Inputs: no named parameters. Returns: result
graphql_validateA
Validate a GraphQL query without executing it.
Returns {"valid": bool, "errors": [...], "depth": int}. Use this to catch typos and invalid fields cheaply before calling graphql_query.
Inputs: query (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct role: retrieving the schema, validating queries, executing read-only queries, and performing mutations. No overlap or ambiguity between them.
All tools share the 'graphql_' prefix and follow a predictable pattern, though 'schema' is a noun while the others are verbs. The minor inconsistency does not impede readability.
Four tools perfectly cover the core GraphQL workflow (introspect, validate, query, mutate) without unnecessary redundancy. The count is well-scoped for the server's purpose.
The tool surface is complete for a GraphQL client: schema access, validation, read and write operations. No obvious missing functionality for typical use cases.
Maintenance
Related MCP Connectors
The Grafbase MCP server sits in front of a GraphQL API and exposes an MCP protocol-compliant interface that allows AI agents and LLMs to explore and query GraphQL APIs using natural language. It provides tools to search schemas, introspect types and fields, and execute GraphQL queries while minimizing context bloat by returning only relevant schema subsets, with built-in support for authentication, authorization, and configurable access control.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Hosted MCP server for live public-data APIs and Skills for AI agents.
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA 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 context46MIT
- FlicenseNot gradedqualityDmaintenanceA universal MCP server that connects any REST API to AI assistants via OpenAPI or Postman specifications. It enables dynamic tool creation with GraphQL-style field selection and automatic schema inference for efficient data retrieval.42 npm6-
- AlicenseAqualityDmaintenanceAn MCP server that powers AI agents with indexed blockchain data from The Graph.3MIT
- AlicenseNot gradedqualityCmaintenanceA universal MCP server providing persistent, structured memory through a knowledge graph with graph storage, semantic vector search, and multi-hop traversal for AI agents and IDEs.1MIT