Enables indexing and semantic searching of GraphQL schemas to discover types and fields, and provides the ability to execute queries against a live GraphQL endpoint.
Uses OpenAI's embedding models to generate vector representations of GraphQL schema signatures for efficient fuzzy lookup and discovery of relevant data structures.
Click on "Install 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., "@GraphQL Schema Embedder MCP Serversearch for product review fields and fetch the latest 5"
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.
GraphQL schema embedder MCP server
Python MCP server for LLMs that indexes a GraphQL schema, stores embeddings per type->field via an embeddings endpoint, and enables fast lookup plus run_query execution once relevant types are identified to fetch data from your GraphQL endpoint.
Architecture
GraphQL schema: provide a schema file (SDL) to exercise parsing and indexing.
Indexer:
schema_indexer.pyflattens the schema intotype.fieldsignatures (with arguments and return types), embeds each summary via the configured embeddings endpoint, and persists todata/metadata.json+data/vectors.npz(normalized embeddings for cosine search).Server:
server.pyexposes MCP toolslist_typesandrun_query. The server ensures the schema index exists on startup; it only calls the embeddings endpoint when reindexing or embedding a new query.Persistence:
data/is.gitignore'd so you can regenerate locally without polluting the repo.
Setup
Set env vars. You can start from .env.example.
Environment configuration:
GRAPHQL_EMBED_API_KEY(orOPENAI_API_KEY)GRAPHQL_EMBEDDINGS_URL(full embeddings URL)GRAPHQL_EMBED_MODELGRAPHQL_EMBED_API_KEY_HEADER/GRAPHQL_EMBED_API_KEY_PREFIXGRAPHQL_EMBED_HEADERS(JSON object string for extra headers) Endpoint auth (when usingGRAPHQL_ENDPOINT_URL):GRAPHQL_ENDPOINT_HEADERS(JSON object string, merged with any--headerflags)
Run the MCP server
Tools:
list_types(query, limit=5)– fuzzy search overtype.fieldsignatures (embeddings; auto-build index if missing). Results are ordered withQueryfields first and include aquery_templateforQueryfields plus aselection_hintfor object fields.run_query(query)– if--endpointis set, proxies the query to the endpoint; otherwise validates/runs against the local schema (no resolvers; primarily for validation/shape checking, data resolves to null). Both indexing and querying use the same embedding model (text-embedding-3-smallby default, override via config/env or--model).
Example list_types output:
Notes:
python3 src/server.pydefaults to thessetransport; pass--transport streamable-httpif you want HTTP instead.You can also set env vars prefixed with
FASTMCP_(e.g.,FASTMCP_HOST,FASTMCP_PORT,FASTMCP_LOG_LEVEL) to override defaults.The server exposes MCP
instructions(override withMCP_INSTRUCTIONS) that describe the server as an abstraction layer and tell the LLM to uselist_typesthenrun_querywith minimal tool calls.
Quick test with the MCP Inspector
Requires npm/npx on PATH.
Connect to an already-running SSE server
In one terminal (start the server):
In another terminal (start the Inspector and point it at /sse):
Configure in Claude Desktop / CLI
If you're running this server locally over SSE (default), point Claude at the /sse URL.
You can also configure via JSON (e.g. config file):
If you expose this server behind auth, pass headers: