
Mcp Graphql Enhanced
io.github.letoribo由 GitHub 帳號 letoribo 發布v4.16.0更新於 Nov 7, 2026
面向LLM的GraphQL閘道器。可處理龐大的GitHub GraphQL與@neo4j/graphql schema而不崩潰
AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。
原文描述
GraphQL gateway for LLMs. Handles huge GitHub GraphQL & @neo4j/graphql schemas without crashing
概覽
Mcp Graphql Enhanced 的本機 MCP 服務;無需登入;STDIO。
暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Graphql Enhanced,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-graphql-enhanced
[Glama] [mcp-graphql-enhanced MCP server][Smithery Listed][npm version][MCP Registry][Agent Trust Fabric]
An enhanced MCP (Model Context Protocol) server for GraphQL that fixes real-world interoperability issues between LLMs and GraphQL APIs.
Drop-in replacement for
mcp-graphql— with dynamic headers, robust variables parsing, and zero breaking changes.
🎯 What is mcp-graphql-enhanced?
mcp-graphql-enhanced is a high-performance, federated GraphQL gateway designed to act as a workhorse for LLM agents. It bridges the gap between massive, complex GraphQL ecosystems and the context-limited environment of AI assistants. Unlike standard "all-or-nothing" introspection tools that crash under the weight of large schemas (like GitHub's or enterprise-grade Neo4j graphs), this server provides surgical control over how your agent perceives and interacts with your data.
💡 Why do you need it?
If you have ever seen the<error>Tool result is too large</error>while trying to introspect your API, you are already hitting the limits of standard MCP implementations. Here is why mcp-graphql-enhanced is a practical choice for professional environments:
Avoid the 1MB Ceiling: It shifts the responsibility for scope from the server to the caller. Instead of a unilateral "everything or nothing" dump, you get granular control via typeNames and typeDepth parameters.
Surgical Precision: You can selectively introspect only the nodes you need (e.g., Repository, User, or Message), keeping your context window clean and your LLM focused.
Predictability over Immunity: It doesn't promise "unlimited" capacity—it promises predictability. In enterprise systems, you need a tool that lets you navigate the graph surgically and fail predictably if you overstep, rather than a "black box" that dies on you the moment the schema grows.
Demonstration: See a real-world diagnostic test against the GitHub API that compares scoped and monolithic introspection: 🔗 Diagnostic Case Study: Scoped vs. Monolithic Introspection (Shared Chat)
💬 Community & Support
Join the conversation! If you have questions about using this bridge with Neo4j, Discord data graphs, or GraphQL in general, come hang out with us:
- Discord Channel: #mcp-graphql-enhanced
- Server: The official GraphQL Discord
This is the best place to share your feedback, report issues, or suggest new "enhanced" features for the bridge.
✨ Key Enhancements
- ✅ Dynamic Endpoint Switching — Hot-swap targets on the fly directly via tool arguments without restarting the server or losing session context.
- ✅ Built-in GraphiQL IDE — Visual playground at / (or /graphql, /graphiql) with pre-configured headers for instant testing and introspection.
- ✅ Dual Transport — Supports both STDIO (for local CLI/client tools) and HTTP/JSON-RPC (for external/browser clients).
- ✅ Dynamic headers — pass
Authorization,X-API-Key, etc., via tool arguments (no config restarts) - ✅ Robust variables parsing — fixes
“Query variables must be a null or an object”error - ✅ Smart introspection — supports filtered requests (via typeNames) and recursive depth control (via typeDepth) to minimize LLM context noise and optimize schema exploration.
- ✅ Full MCP compatibility — works with Claude Desktop, Groq Desktop, Google Antigravity, Glama, Gemini CLI, Hermes Agent and any standard MCP client
- ✅ Secure by default — mutations disabled unless explicitly enabled
- ✅ Dynamic Schema Evolution — Smart diagnostics and gap analysis for servers that regenerate GraphQL types on-the-fly (like Neo4j).
- ✅ Deep Observability — Automatic Cypher extraction and cleaning from GraphQL extensions.
🔥 Dynamic Endpoint Switching
The bridge allows LLMs or clients to dynamically target different GraphQL endpoints at runtime within a single session without requiring server restarts or configuration changes.
Simply pass the optional endpoint parameter in query-graphql or introspect-schema:
- Zero Downtime: Hot-swaps the underlying schema and clears internal caches instantly.
- Context Preservation: Keeps the MCP connection open while shifting queries between different environments (e.g., switching from a Discord ingest node to a Neo4j graph database).
🚀 Federated Multi-Node Architecture (since v3.9.1)
The server operates as a Federated GraphQL Gateway capable of querying multiple independent GraphQL environments through a single endpoint.
-
Zero Breaking Changes: If you provide a single URL in
ENDPOINT, the server behaves exactly as before. -
Federated Capability Discovery: During startup, all configured endpoints are introspected to build a federated manifest used for routing, relevance analysis, and node selection.
-
Stable Runtime Introspection: Direct GraphQL introspection queries (
__schema,__type) are always resolved against the first configured endpoint. This preserves a consistent schema model and avoids corruption caused by merging independent introspection trees. -
Selective Node Routing: The federated manifest is consulted before execution to determine whether a query is relevant to a node, reducing unnecessary requests and improving performance.
-
Schema-Adaptive Broadcasts: Queries are automatically pruned against each participating schema before execution. Unsupported fields and empty selection branches are removed on a per-node basis, allowing a single query to operate across heterogeneous GraphQL environments.
-
Smart Aggregation: When multiple comma-separated URLs are provided, the server broadcasts queries, aggregates responses, and performs universal deep object-level deduplication.
-
Conflict Handling: Structural differences between identically named types across nodes are detected and exposed safely.
-
Unified Graph Experience: Independent GraphQL systems can be queried through a single endpoint, including combinations such as GitHub GraphQL, Neo4j GraphQL, and custom GraphQL APIs.
-
Bypass Free Tier Limits: Useful for Free Tier cloud databases (for example Neo4j Aura). Data can be distributed across multiple instances while remaining queryable through a single federated gateway.
Proof of Concept:
See a real-world demonstration of the federated query synthesis in action, where the agent aggregates live Discord data with historical Neo4j insights: 🔗 Live Federation Analysis (Shared Chat)
💡 Use Case: Bridging WSL and Windows (PowerShell)
A common challenge for Windows developers is the network isolation between the Windows Subsystem for Linux (WSL) and the host OS. This feature allows you to bridge these two worlds into a "Unified Nervous System".
Example configuration for Claude Desktop:
-
Hybrid Ecosystem: Seamlessly query and aggregate data across Windows-native processes (PowerShell) and Linux-based environments (WSL).
-
mDNS Support: By using .local addresses, the bridge automatically resolves the host machine's IP from within the WSL environment.
-
Transparent Aggregation: The AI assistant interacts with a single unified schema, unaware that the data is being fetched from different operating systems simultaneously.
🔍 Advanced Observability & Cypher
The bridge provides deep insights into how the LLM interacts with your graph database.
🕸️ Automated Cypher Extraction
For GraphQL server implementations that return query execution plans (like @neo4j/graphql), the bridge automatically:
- Detects
extensions.cypherin the response. - Sanitizes the output by stripping internal headers (like
CYPHER 5or emptyPARAMS). - Injects a clean Cypher block directly into the tool's output for the AI to analyze.
Note: This feature requires your GraphQL server to be configured to include debug information in the response extensions.
🎨 Visual Command Center (GraphiQL)
Unlike standard MCP servers, this one provides a visual interface for humans. When running with ENABLE_HTTP=true, you can open a full-featured GraphiQL IDE in your browser.
- Endpoint:
http://localhost:6274/(or /graphql, /graphiql) - Header Sync: Any headers set in your environment (like GitHub tokens) are automatically injected into the GraphiQL "Headers" tab for immediate testing.
💻 HTTP / Dual Transport
This server runs in dual transport mode, supporting both the standard STDIO communication (used by most MCP clients) and an HTTP JSON-RPC endpoint on port 6274.
This allows external systems, web applications, and direct curl commands to access the server's tools with live request logging in your terminal ([HTTP-RPC] logs).
Resolving Port Conflicts (EADDRINUSE) and Automatic Port Selection
The server defaults to port 6274. If you encounter an EADDRINUSE: address already in use :::6274 error (common in local development due to stale processes), the server will automatically find the next available port (up to 10 attempts, not spawning multiple servers).
This ensures the server starts successfully even when the default is blocked. Always check the server logs for the final bound port (e.g., [HTTP] Started server on http://localhost:6275) if your curl or client tool fails on the default 6274.
To force a specific port (e.g., for guaranteed external firewall settings), you can still explicitly set the MCP_PORT environment variable:
Testing the HTTP Endpoint
You can test the endpoint using curl as long as the server is running (e.g., via npm run dev):
Test the health check (assuming the server bound to the default or found the next available port)
Testing the JSON-RPC Transport
(using port 6275 if 6274 was busy)
🔍 Use the official MCP Inspector to test your server live:
Environment Variables
Note: As of version 1.0.0, command line arguments have been replaced with environment variables.
auto(default): Automatically enables HTTP only when running in MCP Inspector.true: Always enable HTTP serverfalse: Disable HTTP server completely
🚀 Examples
1. Quick Start
Basic startup using the default endpoint.
2. Configuration & Authentication
Running with custom headers (e.g., for API keys or Bearer tokens).
3. Advanced Integration
Using a local .graphql file If you want to work with a local schema without querying the API directly.
Enabling Mutations (Writes) Mutations are disabled by default for security. To enable them:
Multi-Node Architecture (Federation) Aggregating data from multiple sources into a single unified graph.
4. Customizing Environment
Example of port configuration and development mode settings.
5. Interactive Launch with mcpgql (Recommended)
If you want to skip manual environment variable setup, use our CLI tool available on npm.
If installed globally (npm install -g @letoribo/mcpgql), simply run:
Alternatively, you can run it without global installation using:
- Zero-config start: Automatic discovery and template initialization.
- Interactive selection: Toggle multiple endpoints and permissions on the fly.
- Bridge mode: Automatically handles the Federated Bridge setup on localhost:6274.
☁️ Deploy to Cloud
This server is fully containerized and optimized for long-running processes.
Recommended Hosting
Quick Azure CLI Deployment
Important:
- For hosted environments, you must set the environment variable
ENABLE_HTTP=truein your platform's settings to ensure the HTTP transport layer is active. - Ensure your hosting provider's public networking settings are configured to route traffic to the port defined in your
PORTenvironment variable to avoid502 Bad Gatewayerrors.
⚠️ Concurrent Cloud Usage & Dynamic Endpoints
While mcp-graphql-enhanced supports switching target endpoints on the fly via the optional endpoint argument, keep state mutability in mind when running in hosted/shared environments (e.g., Render, Railway, Smithery):
- State Isolation: Providing an
endpointargument dynamically updates the active graph context for the server instance. - Best Practice for Concurrent Cloud Requests: If multiple clients, agent sessions, or automated workers share the same cloud instance, always pass the
endpointexplicitly in every tool call (query-graphqlandintrospect-schema). - Preventing Context Drift: Relying on the implicitly cached endpoint in a shared environment can lead to race conditions where a concurrent call from another session switches the active upstream URL under your feet.
🌐 Public Live Gateways (Hosted SSE/HTTP Bridges)
If you want to test the bridge instantly without running local Node.js processes, use our hosted cloud endpoints:
[Cloudflare Workers] [Vercel Deployment]
Note: Public gateways operate in shared environments. Remember to supply your explicit
endpointandheadersin tool calls to ensure request isolation.
🖥️ Claude Desktop Configuration Examples
You can connect Claude Desktop to your GraphQL API using either the npx package (recommended for simplicity) or the Docker image (ideal for reproducibility and isolation).
✅ Option 1: Using npx
🐳 Option 2: Using Docker (auto-pull supported)
🧪 Option 3: Using node with local build (for development)
If you’ve cloned the repo and built the project (npm run build → outputs to dist/):
🖥️ Live Playground Integration (mcp-graphiql)
Ever wished your GraphQL queries generated inside Claude Desktop or Antigravity would auto-populate directly into your GraphiQL playground in real time?
@letoribo/mcp-graphql-enhanced provides an HTTP/SSE bridge to mcp-graphiql. Whenever your AI agent calls query-graphql, the payload streams instantly into an active GraphiQL tab, while introspect-schema hot-reloads and updates the Docs explorer in real time when switching endpoints.
Resources
- graphql-schema: The server exposes the GraphQL schema as a resource that clients can access. This is either the local schema file, a schema file hosted at a URL, or based on an introspection query.
Available Tools
The server provides two main tools:
- introspect-schema: Retrieves the GraphQL schema or a subset. Use this first to understand the graph structure.
- Arguments:
typeNames(optional, array): List of specific types to introspect (e.g.,["User", "Message"]). Reduces noise by returning only relevant parts of the graph.typeDepth(optional, number): Controls the recursion level of nested fields (Default:2).Note:
typeDepthis only functional whentypeNamesis provided to narrow the scope.endpoint(optional, string): Target GraphQL HTTP/HTTPS URL to dynamically switch endpoint on the fly before executing introspection.headers(optional, string): JSON stringified object of custom HTTP headers (e.g.,'{"Authorization": "Bearer token"}').
- Note: Filtered introspection is only available when querying a live GraphQL endpoint.
- query-graphql: Execute GraphQL queries against the endpoint. By default, mutations are disabled unless
ALLOW_MUTATIONSis set totrue.
- Arguments:
query(required, string): The GraphQL query or mutation string.variables(optional, string): JSON stringified object of variables.endpoint(optional, string): Target GraphQL HTTP/HTTPS URL to dynamically switch endpoint on the fly before executing query.headers(optional, string): JSON stringified object of custom HTTP headers (e.g.,'{"Authorization": "Bearer token"}').
💡 Note: Dynamic Headers vs Static env Previously, auth tokens had to be hardcoded statically at startup inside the configuration's "env" block (e.g., in claude_desktop_config.json).
With the optional headers argument added directly to query-graphql and introspect-schema, you get total dynamic control:
- Keep Secrets in Your Terminal: You don't have to feed your private tokens (like GitHub PATs or Bearer keys) directly into Claude's prompt or static setup. Just set "ENABLE_HTTP": "true", run your cURL commands or local scripts directly in the terminal, and pass headers there. Any headers passed at runtime will override static tokens from your config file. Otherwise, Claude might just laugh at you for sharing your raw secret tokens in the chat!
- On-the-Fly Switching: You can dynamically inject different auth headers per request or per endpoint right at execution time without restarting the MCP server.
Security Considerations
Mutations are disabled by default to prevent unintended data changes. Always validate HEADERS and SCHEMA inputs in production. Use HTTPS endpoints and short-lived tokens where possible.
Customize for your own server
This is a very generic implementation where it allows for complete introspection and for your users to do whatever (including mutations). If you need a more specific implementation I'd suggest to just create your own MCP and lock down tool calling for clients to only input specific query fields and/or variables. You can use this as a reference.
Note on Contributors
Claude Code was not used in this project. If you're curious how Claude ended up as a co-author via custom MCP architecture, feel free to ask!
來源:README.md,提交 84d238a
工具
0版本歷史
6- v4.16.0最新Nov 7, 2026
- v4.15.8Nov 3, 2026
- v4.15.7Nov 1, 2026
- v4.15.5Oct 29, 2026
- v4.15.4Oct 6, 2026
- v4.15.3Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分