Skip to main content
Glama
NarglesCS

GraphMCP

by NarglesCS

Anansi

CI PyPI License: MIT

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 graphql_validate + structured GraphQL errors

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 -q

Interacting with it

Option 1 — MCP Inspector (fastest way to poke at the mock data)

npx @modelcontextprotocol/inspector .venv/Scripts/python.exe -m anansi.server

Opens 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

graphql://schema

The SDL, loadable as context up front

Tool

graphql_schema()

Same SDL for clients that prefer tools over resources

Tool

graphql_validate(query)

Parse + validate + measure depth without executing

Tool

graphql_query(query, variables?)

Read-only execution; mutations rejected

Tool

graphql_mutate(mutation, variables?)

Writes, only when ANANSI_ALLOW_MUTATIONS=1

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

ANANSI_ALLOW_MUTATIONS

off

Set to 1 to enable graphql_mutate

ANANSI_MAX_DEPTH

10

Max query nesting depth (fragment-cycle safe)

ANANSI_MAX_COMPLEXITY

100

Max total fields selected per request (breadth guard)

ANANSI_MAX_RESULT_BYTES

262144

Max serialized result size; 0 disables

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" .-> Schema

Each layer is independently swappable:

Roadmap ideas

  • Swap data.py for 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

MIT

Contributions and issues welcome.

Available Tools

4 tools
graphql_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 } }
ParametersJSON Schema
NameRequiredDescriptionDefault
mutationYes
variablesNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description discloses the mutating nature and the server-side permission requirement, which are essential. However, it does not describe side effects, idempotency, or other behavioral details beyond the write nature and the environment variable condition.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief, front-loaded with the core purpose, and includes a useful example. Every sentence earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that an output schema exists, return values need no explanation. The description provides the key permission context and clarifies the write nature, but it omits guidance on error handling, authentication specifics beyond the env var, and explicit differentiation from sibling tools. It is minimally adequate for a simple two-parameter tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not explain the 'mutation' or 'variables' parameters beyond an example. The parameter names are self-explanatory, but the description adds no explicit semantic detail about expected formats, required variables, or how variables map to the mutation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute a GraphQL mutation (write operation)', using a specific verb and resource, and explicitly labels it as a write operation, which distinguishes it from sibling tools like graphql_query. The example mutation reinforces the purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It indicates when the tool is permitted (server must have GRAPHMCP_ALLOW_MUTATIONS=1) and labels it as a write operation, implying it should be used for mutations rather than queries. However, it does not explicitly name alternatives like 'use graphql_query for read operations'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
variablesNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description discloses critical behavioral details: it is read-only, returns both data and errors, and explicitly rejects mutations. It also gives a concrete example of query and variables, adding useful context. It could mention auth requirements or rate limits, but for a simple read-only query tool, this is above average.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: a one-sentence purpose, a clear guidance to select only needed fields, and a single example that covers both parameters. No redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having no annotations, the description provides all necessary context for an agent to invoke the tool correctly: purpose, read-only guarantee, mutation rejection, parameter format, and return shape. The sibling tools are distinguishable, and the output schema is mentioned via the return {'data', 'errors'}. It is complete for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero description coverage, but the description fully compensates by providing a complete example showing both the 'query' string and 'variables' object with a role variable. This demonstrates the exact format for both parameters and their relationship, adding significant meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute a read-only GraphQL query' with a specific verb and resource, and explicitly distinguishes it from the sibling graphql_mutate by noting 'Mutations are rejected here.' This leaves no ambiguity about the tool's function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly indicates read-only usage and rejects mutations, which tells the agent when not to use this tool. However, it does not explicitly name alternatives like graphql_schema or graphql_validate, though the 'read-only' and 'mutations rejected' framing implies the correct context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

graphql_schemaA

Return the GraphQL schema (SDL). Call this before writing queries.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It states the tool returns the schema, implying a read-only action, but doesn't disclose any additional behavioral details such as authentication requirements or side effects. Adequate for the simple operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the core action and a usage hint. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (no parameters), output schema exists, and the description provides both the purpose and a usage trigger. Complete for its scope.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and with schema coverage at 100% (vacuously), the description doesn't need to explain parameters. Baseline 4 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Return') and identifies the exact resource ('the GraphQL schema (SDL)'), clearly distinguishing it from sibling tools that validate, query, or mutate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly instructs to 'Call this before writing queries,' providing clear contextual guidance for when to use the tool, though it doesn't explicitly state exclusions or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It honestly states that the query is not executed and provides the return structure (valid, errors, depth), plus a hint about low cost. While it does not detail error semantics or auth requirements, the essential behavior is transparent for a validation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, immediately front-loaded with the core purpose, followed by return format and usage guidance. No extraneous words; every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one parameter and an output schema, the description is quite complete: it explains the operation, non-execution, return type, and when to use it in relation to a sibling. It does not allude to potential limitations (e.g., query size or schema dependence), but these are not critical for basic validation usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It identifies the parameter as 'a GraphQL query', giving meaning beyond the generic schema title 'Query', but it does not provide format examples, constraints, or additional details. This is moderate compensation for a single simple parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('validate') and resource ('GraphQL query') while explicitly noting it does not execute the query. This distinguishes it from sibling tools like graphql_query and graphql_mutate, making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: 'Use this to catch typos and invalid fields cheaply before calling graphql_query.' It names an alternative tool and specifies the exact scenario (pre-execution validation), fulfilling the when-to-use criterion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedgraphql_mutate
    • First observedgraphql_query
    • First observedgraphql_schema
    • First observedgraphql_validate

TDQS

A4.3/5.0
Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness5/5

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

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    A 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 context
    57
    47
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A 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.
    13
    6
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    A 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.
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NarglesCS/Anansi'

If you have feedback or need assistance with the MCP directory API, please join our Discord server