GraphQL.MCP.HotChocolate
0.1.0
dotnet add package GraphQL.MCP.HotChocolate --version 0.1.0
NuGet\Install-Package GraphQL.MCP.HotChocolate -Version 0.1.0
<PackageReference Include="GraphQL.MCP.HotChocolate" Version="0.1.0" />
<PackageVersion Include="GraphQL.MCP.HotChocolate" Version="0.1.0" />
<PackageReference Include="GraphQL.MCP.HotChocolate" />
paket add GraphQL.MCP.HotChocolate --version 0.1.0
#r "nuget: GraphQL.MCP.HotChocolate, 0.1.0"
#:package GraphQL.MCP.HotChocolate@0.1.0
#addin nuget:?package=GraphQL.MCP.HotChocolate&version=0.1.0
#tool nuget:?package=GraphQL.MCP.HotChocolate&version=0.1.0
graphql-mcp
MCP capabilities for every GraphQL server - Hot Chocolate, graphql-dotnet, Spring GraphQL, and more. Cross-framework curation, policy controls, and AI-friendly capability discovery.
What is this?
graphql-mcp is a cross-framework GraphQL AI capability layer. It turns your existing GraphQL API into an MCP server that AI clients can use directly, with curation, policy controls, and safety built in.
No schema duplication. No sidecar process. Just your GraphQL API, now speaking MCP.
Why graphql-mcp?
Some frameworks are adding native MCP support. graphql-mcp goes further:
| Native framework MCP | graphql-mcp | |
|---|---|---|
| Cross-framework support | One framework only | Hot Chocolate, graphql-dotnet, Spring |
| Curation and policy engine | Varies | Presets, shared profile packs, reusable profiles, glob-pattern field/type exclusion, mutation blocking, depth limits |
| AI-friendly naming | Varies | VerbNoun, Raw, PrefixedRaw policies with tool prefixes |
| Observability | Varies | Built-in OpenTelemetry traces and metrics |
| Portable core | No | Framework-agnostic engine, adapters are thin |
Use native MCP when your framework ships it and it covers your needs. Use graphql-mcp when you need cross-framework support, advanced curation, or operate across multiple GraphQL backends.
Discovery
graphql-mcp ships layered discovery surfaces plus MCP prompt workflows:
tools/listincludes per-tooldomain,category,tags, andsemanticHintsannotationsprompts/listandprompts/getexpose reusable exploration, planning, comparison, and safe-call templatesresources/listandresources/readexpose stable overview, domain, tool, and discovery playbook documentscatalog/listreturns grouped domain summaries, semantic hints, and tool metadata for exploration UIs, with stronger grouping for generic wrappers and search-style schemascatalog/searchreturns ranked matches with optional query, domain, category, and tag filters for discovery UIsinitialize,resources/read graphql-mcp://auth/metadata, and/.well-known/oauth-authorization-serverexpose OAuth metadata and required scopes for authenticated clients
Use docs/exploration.md and examples/discovery-workflow for a hands-on discovery walkthrough against the sample apps.
Supported AI Clients
| Client | Status |
|---|---|
| Claude Desktop | Tested |
| GitHub Copilot | Compatible |
| Cursor | Compatible |
| Windsurf | Compatible |
| Any MCP-compatible client | Compatible |
Supported GraphQL Frameworks
| Framework | Status | Package |
|---|---|---|
| Hot Chocolate (.NET) | Stable-ready | GraphQL.MCP.HotChocolate |
| graphql-dotnet (.NET) | Stable-ready | GraphQL.MCP.GraphQLDotNet |
| Spring GraphQL (Java) | Stable-ready | dev.graphql-mcp:graphql-mcp-spring-boot-starter |
| Netflix DGS (Java) | Stable-ready in repo | dev.graphql-mcp:graphql-mcp-dgs |
Install
Hot Chocolate
dotnet add package GraphQL.MCP.HotChocolate
graphql-dotnet
dotnet add package GraphQL.MCP.GraphQLDotNet
Java (Spring)
Use the latest published version from Maven Central:
<dependency>
<groupId>dev.graphql-mcp</groupId>
<artifactId>graphql-mcp-spring-boot-starter</artifactId>
<version>REPLACE_WITH_LATEST_VERSION</version>
</dependency>
Java (Netflix DGS)
Use the same latest published graphql-mcp version when the DGS package ships on the stable Java line:
<dependency>
<groupId>dev.graphql-mcp</groupId>
<artifactId>graphql-mcp-dgs</artifactId>
<version>REPLACE_WITH_LATEST_VERSION</version>
</dependency>
Quick Start
Hot Chocolate - Zero Config
using GraphQL.MCP.HotChocolate;
var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddGraphQLServer()
.AddQueryType<Query>();
builder.Services.AddHotChocolateMcp();
var app = builder.Build();
app.UseGraphQLMcp();
app.Run();
graphql-dotnet - Zero Config
using GraphQL.MCP.AspNetCore;
using GraphQL.MCP.GraphQLDotNet;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGraphQL(b => b
.AddSchema<MySchema>()
.AddSystemTextJson());
builder.Services.AddGraphQLDotNetMcp();
var app = builder.Build();
app.UseGraphQL("/graphql");
app.UseGraphQLMcp();
app.Run();
Full Config (any adapter)
builder.Services.AddHotChocolateMcp(options =>
{
options.PolicyPreset = McpPolicyPreset.Curated;
options.PolicyPack = McpPolicyPack.Commerce;
options.PolicyProfile = new McpPolicyProfile
{
Name = "commerce-api",
IncludedDomains = ["order", "invoice"],
MinDescriptionLength = 12,
MaxArgumentComplexity = 60
};
options.ToolPrefix = "myapi";
options.NamingPolicy = ToolNamingPolicy.VerbNoun;
options.AllowMutations = false;
options.ExcludedFields.Add("internalNotes");
options.ExcludedTypes.Add("AdminPanel");
options.ExcludedDomains.Add("admin");
options.Authorization.Mode = McpAuthMode.Passthrough;
options.Authorization.RequiredScopes.Add("orders.read");
options.Authorization.Metadata.Issuer = "https://auth.example.com";
options.Authorization.Metadata.AuthorizationEndpoint = "https://auth.example.com/authorize";
options.Authorization.Metadata.TokenEndpoint = "https://auth.example.com/token";
options.Transport = McpTransport.StreamableHttp; // or McpTransport.Stdio
});
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
policy-preset: curated
policy-pack: commerce
policy-profile:
name: commerce-api
included-domains:
- book
min-description-length: 12
max-argument-complexity: 60
tool-prefix: myapi
naming-policy: verb-noun
allow-mutations: false
excluded-fields:
- internalData
excluded-domains:
- admin
authorization:
mode: passthrough
required-scopes:
- orders.read
metadata:
issuer: https://auth.example.com
authorization-endpoint: https://auth.example.com/authorize
token-endpoint: https://auth.example.com/token
transport: streamable-http # or stdio
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 - field and type 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 with glob patterns |
| Selection set exclusion | Yes - excluded fields filtered from nested types too |
Observability
Built-in OpenTelemetry support:
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 and stdio)
+----------------------+----------------------+
| GraphQL.MCP. | GraphQL.MCP. |
| HotChocolate | GraphQLDotNet | Framework adapters
+----------------------+----------------------+
The core engine is fully framework-agnostic. Adding a new framework adapter means implementing two interfaces: IGraphQLSchemaSource and IGraphQLExecutor.
See docs/architecture.md for the full design.
Release Readiness
- The repository is prepared for stable
.NETandJavarelease lines. - Existing
-alpha,-beta, or-rctags remain prereleases in GitHub Releases, but stable tags without a prerelease suffix become the normal latest release line. - Spring GraphQL is already published, and the DGS adapter is part of the stable-ready Java surface for the next stable Java tag.
For the full stable release checklist, see docs/releases.md.
Claude Desktop Setup
Start your GraphQL MCP server, then add to claude_desktop_config.json:
{
"mcpServers": {
"my-graphql-api": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:5000/mcp"]
}
}
}
Restart Claude Desktop. Your GraphQL operations will appear as tools.
Documentation
| Topic | Link |
|---|---|
| Getting Started (.NET) | docs/dotnet/getting-started.md |
| Configuration (.NET) | docs/dotnet/configuration.md |
| Getting Started (Java) | docs/java/getting-started.md |
| Getting Started (DGS) | docs/java/dgs-getting-started.md |
| Configuration (Java) | docs/java/configuration.md |
| Discovery | docs/discovery.md |
| Prompts | docs/prompts.md |
| Resources | docs/resources.md |
| Exploration Workflow | docs/exploration.md |
| Policies | docs/policies.md |
| Adapters | docs/adapters.md |
| Releases | docs/releases.md |
| Roadmap | docs/roadmap.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 (framework-agnostic)
- Hot Chocolate adapter
- graphql-dotnet adapter
- Streamable HTTP transport
- MCP prompts for discovery and tool-selection workflows
- MCP resources for catalog overview and domain summaries
- Policy engine (field/type exclusion with globs, domain curation, naming, depth, mutation blocking, complexity gates)
- Selection set field exclusion (nested types)
- OpenTelemetry instrumentation
- Spring GraphQL starter
- Advanced MCP resources (tool summaries, discovery playbooks)
- Advanced MCP prompts (workflow planning, candidate comparison, safe-call prep)
- AI-friendly discovery (domain grouping, semantic hints, grouped catalogs, and catalog search)
- Curated exploration workflow and reusable request assets for the sample apps
- Reusable policy presets and profiles
- Shared policy packs for common schema families and industry domains
- OAuth 2.1 metadata support
- stdio transport
- Netflix DGS adapter
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)
- HotChocolate.AspNetCore (>= 15.1.12)
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 | 144 | 3/31/2026 |
| 0.1.0-alpha.6 | 58 | 3/30/2026 |
| 0.1.0-alpha.5 | 61 | 3/26/2026 |
| 0.1.0-alpha.4 | 58 | 3/26/2026 |
| 0.1.0-alpha.3 | 56 | 3/26/2026 |
| 0.1.0-alpha.2 | 61 | 3/24/2026 |
| 0.1.0-alpha.1 | 58 | 3/21/2026 |
| 0.0.1-alpha.2 | 55 | 3/21/2026 |