GraphQL.MCP.GraphQLDotNet 0.1.0-alpha.3

This is a prerelease version of GraphQL.MCP.GraphQLDotNet.
There is a newer version of this package available.
See the version list below for details.
dotnet add package GraphQL.MCP.GraphQLDotNet --version 0.1.0-alpha.3
                    
NuGet\Install-Package GraphQL.MCP.GraphQLDotNet -Version 0.1.0-alpha.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GraphQL.MCP.GraphQLDotNet" Version="0.1.0-alpha.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GraphQL.MCP.GraphQLDotNet" Version="0.1.0-alpha.3" />
                    
Directory.Packages.props
<PackageReference Include="GraphQL.MCP.GraphQLDotNet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GraphQL.MCP.GraphQLDotNet --version 0.1.0-alpha.3
                    
#r "nuget: GraphQL.MCP.GraphQLDotNet, 0.1.0-alpha.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GraphQL.MCP.GraphQLDotNet@0.1.0-alpha.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GraphQL.MCP.GraphQLDotNet&version=0.1.0-alpha.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=GraphQL.MCP.GraphQLDotNet&version=0.1.0-alpha.3&prerelease
                    
Install as a Cake Tool

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.

NuGet NuGet Maven Central License: MIT .NET CI


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 (Claude, Copilot, Cursor, Windsurf) 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 (e.g., Hot Chocolate 16). graphql-mcp goes further:

Native framework MCP graphql-mcp
Cross-framework support One framework only Hot Chocolate, graphql-dotnet, Spring
Curation & policy engine Varies 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 + 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.

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) Alpha GraphQL.MCP.HotChocolate
graphql-dotnet (.NET) Alpha GraphQL.MCP.GraphQLDotNet
Spring GraphQL (Java) Alpha Preview dev.graphql-mcp:graphql-mcp-spring-boot-starter
Netflix DGS (Java) Planned -

Install

Hot Chocolate

dotnet add package GraphQL.MCP.HotChocolate

graphql-dotnet

dotnet add package GraphQL.MCP.GraphQLDotNet

Java (Spring)

<dependency>
    <groupId>dev.graphql-mcp</groupId>
    <artifactId>graphql-mcp-spring-boot-starter</artifactId>
    <version>0.1.0-alpha.3</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();  // one line

var app = builder.Build();
app.UseGraphQLMcp();                     // maps /graphql + /mcp
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();  // one line

var app = builder.Build();
app.UseGraphQL("/graphql");
app.UseGraphQLMcp();                      // maps /mcp
app.Run();

Full Config (any adapter)

builder.Services.AddHotChocolateMcp(options =>   // or AddGraphQLDotNetMcp
{
    options.ToolPrefix = "myapi";
    options.MaxOutputDepth = 3;
    options.NamingPolicy = ToolNamingPolicy.VerbNoun;

    options.AllowMutations = false;
    options.ExcludedFields.Add("internalNotes");
    options.ExcludedTypes.Add("AdminPanel");

    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
  1. Introspects your GraphQL schema at startup
  2. Canonicalizes operations into a framework-agnostic model
  3. Applies policies — field/type exclusions, naming, depth limits, mutation safety
  4. Publishes tools as MCP tool descriptors with JSON Schema inputs
  5. 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)
+----------------------+----------------------+
|  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.


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
Configuration (Java) docs/java/configuration.md
Policies docs/policies.md
Adapters docs/adapters.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
  • Policy engine (field/type exclusion with globs, naming, depth, mutation blocking)
  • Selection set field exclusion (nested types)
  • OpenTelemetry instrumentation
  • Spring GraphQL starter
  • MCP Resources (schema summary, type docs)
  • MCP Prompts (curated exploration templates)
  • [~] AI-friendly discovery (basic tool annotations shipped; richer grouping and semantic hints next)
  • 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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