GraphQL.MCP.GraphQLDotNet
0.1.0-alpha.1
See the version list below for details.
dotnet add package GraphQL.MCP.GraphQLDotNet --version 0.1.0-alpha.1
NuGet\Install-Package GraphQL.MCP.GraphQLDotNet -Version 0.1.0-alpha.1
<PackageReference Include="GraphQL.MCP.GraphQLDotNet" Version="0.1.0-alpha.1" />
<PackageVersion Include="GraphQL.MCP.GraphQLDotNet" Version="0.1.0-alpha.1" />
<PackageReference Include="GraphQL.MCP.GraphQLDotNet" />
paket add GraphQL.MCP.GraphQLDotNet --version 0.1.0-alpha.1
#r "nuget: GraphQL.MCP.GraphQLDotNet, 0.1.0-alpha.1"
#:package GraphQL.MCP.GraphQLDotNet@0.1.0-alpha.1
#addin nuget:?package=GraphQL.MCP.GraphQLDotNet&version=0.1.0-alpha.1&prerelease
#tool nuget:?package=GraphQL.MCP.GraphQLDotNet&version=0.1.0-alpha.1&prerelease
graphql-mcp
Expose your GraphQL API as MCP capabilities — one line of code. .NET 10 today, Java Spring next. No proxies. No external processes.
⚠️ Alpha Release — This project is feature-complete for the Hot Chocolate adapter but has not yet been validated against a wide range of real-world schemas. The API surface may change based on community feedback. Production use is at your own discretion.
What is this?
graphql-mcp turns your existing GraphQL API into an MCP server that AI clients (Claude, Copilot, Cursor, Windsurf) can use directly. No schema duplication. No sidecar process. Just your GraphQL API, now speaking MCP.
Supported AI Clients
| Client | Status |
|---|---|
| Claude Desktop | ✅ |
| GitHub Copilot | ✅ |
| Cursor | ✅ |
| Windsurf | ✅ |
| Any MCP-compatible client | ✅ |
Supported GraphQL Frameworks
| Framework | Status | Package |
|---|---|---|
| Hot Chocolate (.NET) | ✅ v0.1-alpha | GraphQL.MCP.HotChocolate |
| graphql-dotnet | 🚧 v0.2 | GraphQL.MCP.GraphQLDotNet |
| Spring GraphQL (Java) | 🚧 v0.3 | dev.graphql-mcp:graphql-mcp-spring |
Install
.NET (Hot Chocolate)
dotnet add package GraphQL.MCP.HotChocolate
Java (Spring) — coming soon
<dependency>
<groupId>dev.graphql-mcp</groupId>
<artifactId>graphql-mcp-spring-boot-starter</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
Quick Start
.NET — Zero Config
using GraphQL.MCP.HotChocolate;
var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddGraphQLServer()
.AddQueryType<Query>();
builder.Services.AddHotChocolateMcp(); // ← one line
var app = builder.Build();
app.UseGraphQLMcp(); // ← maps /graphql + /mcp
app.Run();
.NET — Full Config
builder.Services.AddHotChocolateMcp(options =>
{
options.ToolPrefix = "myapi";
options.MaxOutputDepth = 3;
options.NamingPolicy = ToolNamingPolicy.VerbNoun;
options.AllowMutations = false;
options.ExcludedFields.Add("internalData");
options.Authorization.Mode = McpAuthMode.Passthrough;
options.Transport = McpTransport.StreamableHttp;
});
Java — Zero Config
@EnableGraphQLMCP
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
Java — Full Config (application.yml)
graphql:
mcp:
enabled: true
tool-prefix: myapi
max-output-depth: 3
naming-policy: verb-noun
allow-mutations: false
excluded-fields:
- internalData
authorization:
mode: passthrough
transport: streamable-http
How It Works
GraphQL Schema ──→ Schema Canonicalization ──→ Policy Engine ──→ MCP Tools
│
AI Client ──→ POST /mcp ──→ Tool Executor ──→ GraphQL Execution ──→ Result
- Introspects your GraphQL schema at startup
- Canonicalizes operations into a framework-agnostic model
- Applies policies — exclusions, naming, depth limits, mutation safety
- Publishes tools as MCP tool descriptors with JSON Schema inputs
- Executes GraphQL queries when AI clients invoke tools
Safety by Default
| Feature | Default |
|---|---|
| Mutations exposed | No — opt-in only |
| Max output depth | 3 levels |
| Max tool count | 50 |
| Auth forwarded | No — opt-in passthrough |
| Sensitive fields | You configure ExcludedFields |
Observability
Built-in OpenTelemetry support from v0.1:
builder.Services.AddOpenTelemetry()
.WithTracing(t => t.AddSource("GraphQL.MCP"))
.WithMetrics(m => m.AddMeter("GraphQL.MCP"));
Metrics: mcp.tool.invocations, mcp.tool.errors, mcp.tool.duration
Architecture
┌─────────────────────────────────────────────┐
│ GraphQL.MCP.Abstractions │ ← Contracts (zero deps)
├─────────────────────────────────────────────┤
│ GraphQL.MCP.Core │ ← Engine (canonicalize, policy, publish, execute)
├─────────────────────────────────────────────┤
│ GraphQL.MCP.AspNetCore │ ← HTTP transport (Streamable HTTP)
├──────────────────────┬──────────────────────┤
│ GraphQL.MCP. │ GraphQL.MCP. │
│ HotChocolate │ GraphQLDotNet │ ← Framework adapters
└──────────────────────┴──────────────────────┘
See docs/architecture.md for the full design.
Documentation
| Topic | Link |
|---|---|
| Getting Started (.NET) | docs/dotnet/getting-started.md |
| Configuration | docs/dotnet/configuration.md |
| How Mapping Works | docs/mapping.md |
| Security Model | docs/security.md |
| Transports | docs/transports.md |
| Observability | docs/observability.md |
| Architecture | docs/architecture.md |
Roadmap
- .NET Core engine
- Hot Chocolate adapter
- Streamable HTTP transport
- Policy engine (exclusions, naming, depth)
- OpenTelemetry instrumentation
- graphql-dotnet adapter
- Spring GraphQL starter
- MCP Resources (schema summary, type docs)
- MCP Prompts (curated exploration templates)
- OAuth 2.1 metadata support
- stdio transport
- Netflix DGS adapter
- MCP Registry listing
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT — use it however you want.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- GraphQL.MCP.AspNetCore (>= 0.1.0-alpha.1)
- GraphQL.Server.Transports.AspNetCore (>= 8.3.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 112 | 3/31/2026 |
| 0.1.0-alpha.6 | 58 | 3/30/2026 |
| 0.1.0-alpha.5 | 54 | 3/26/2026 |
| 0.1.0-alpha.4 | 51 | 3/26/2026 |
| 0.1.0-alpha.3 | 54 | 3/26/2026 |
| 0.1.0-alpha.2 | 58 | 3/24/2026 |
| 0.1.0-alpha.1 | 58 | 3/21/2026 |
| 0.0.1-alpha.2 | 60 | 3/21/2026 |