GraphQL.MCP.GraphQLDotNet 0.1.0-alpha.1

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.1
                    
NuGet\Install-Package GraphQL.MCP.GraphQLDotNet -Version 0.1.0-alpha.1
                    
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.1" />
                    
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.1" />
                    
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.1
                    
#r "nuget: GraphQL.MCP.GraphQLDotNet, 0.1.0-alpha.1"
                    
#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.1
                    
#: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.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=GraphQL.MCP.GraphQLDotNet&version=0.1.0-alpha.1&prerelease
                    
Install as a Cake Tool

graphql-mcp

Expose your GraphQL API as MCP capabilities — one line of code. .NET 10 today, Java Spring next. No proxies. No external processes.

NuGet Maven Central License: MIT .NET CI

⚠️ 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
  1. Introspects your GraphQL schema at startup
  2. Canonicalizes operations into a framework-agnostic model
  3. Applies policies — 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

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 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