OpenApiMcpNet
OpenApiMcpNet is an open‑source project that lets you build MCP servers backed by any web API defined with an OpenAPI spec. It automatically maps MCP operations to the corresponding API endpoints, so you can create a fully functional MCP server with minimal manual wiring.
Install / Use
claude mcp add kerryjiang -- npx -y github:kerryjiang/OpenApiMcpNetIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AutomationSupported Platforms
Our assessment of OpenApiMcpNet
OpenApiMcpNet scores 77/100 on our quality scale, 339th of 653 Automation skills we index.
Its MCP Server is 6.4 KB long, well organised into 23 sections with 9 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 5 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-09-02 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 90/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
OpenApiMcpNet compared with similar skills
All 4 of these similar skills score higher than OpenApiMcpNet; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| OpenApiMcpNet (this skill)by kerryjiang | 77 | 3 | 5mo ago | MCP Server |
| Agent-Reachby Panniantong | 100 | 85.2k | 8d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 73.7k | today | CLAUDE.md |
| rufloby ruvnet | 100 | 73.2k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.1k | today | CLAUDE.md |
Frequently asked questions
- How do I install OpenApiMcpNet?
- Run
claude mcp add kerryjiang -- npx -y github:kerryjiang/OpenApiMcpNet. The install tabs above show the steps for each supported agent. - Which AI agents does OpenApiMcpNet work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is OpenApiMcpNet safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is Apache-2.0-licensed and scores 90/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is OpenApiMcpNet still maintained?
- The repository was last updated about 5 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubOpenApiMcpNet
A .NET library that automatically generates Model Context Protocol (MCP) tools from OpenAPI specifications. This allows AI assistants and LLMs to interact with any REST API that has an OpenAPI (Swagger) specification.
Features
- Automatic Tool Generation: Converts OpenAPI operations into MCP-compatible tools automatically
- Full OpenAPI Support: Handles path, query, header, and cookie parameters, as well as request bodies
- Authentication Support: Built-in support for OAuth 1.0a and OAuth 2.0 (client credentials flow)
- Extensible Architecture: Custom authentication handlers and web API callers can be injected
- Fluent API: Simple, chainable configuration via
IMcpServerBuilderextensions
Installation
dotnet add package OpenApiMcpNet
Quick Start
Basic Usage
using Microsoft.Extensions.DependencyInjection;
using ModelContextProtocol.Server;
using OpenApiMcpNet;
var builder = Host.CreateApplicationBuilder(args);
// Add MCP server with tools from OpenAPI spec
builder.Services.AddMcpServer()
.WithToolsFromOpenApi(openApiSpecJson, "https://api.example.com");
var host = builder.Build();
await host.RunAsync();
Loading OpenAPI Spec from File or URL
// From a string
builder.Services.AddMcpServer()
.WithToolsFromOpenApi(openApiSpecJsonOrYaml, "https://api.example.com");
// From a stream
using var stream = File.OpenRead("openapi.yaml");
builder.Services.AddMcpServer()
.WithToolsFromOpenApi(stream, "https://api.example.com");
// From an OpenApiDocument
var reader = new OpenApiStringReader();
var document = reader.Read(openApiSpec, out var diagnostic);
builder.Services.AddMcpServer()
.WithToolsFromOpenApi(document, "https://api.example.com");
Authentication
OAuth 2.0 (Client Credentials)
var authHandler = new OAuth2AuthenticationHandler(
httpClient,
tokenEndpoint: "https://auth.example.com/oauth/token",
consumerKey: "your-client-id",
consumerSecret: "your-client-secret",
scope: "read write" // optional
);
// Authenticate before making requests
await authHandler.AuthenticateAsync();
// Register with DI
builder.Services.AddSingleton<IAuthenticationHandler>(authHandler);
OAuth 1.0a
var authHandler = new OAuth1AuthenticationHandler(
httpClient,
requestTokenUrl: "https://api.example.com/oauth/request_token",
accessTokenUrl: "https://api.example.com/oauth/access_token",
consumerKey: "your-consumer-key",
consumerSecret: "your-consumer-secret",
signatureMethod: "HMAC-SHA1"
);
await authHandler.AuthenticateAsync();
builder.Services.AddSingleton<IAuthenticationHandler>(authHandler);
Custom Authentication
Implement IAuthenticationHandler or IRequestAuthenticationHandler for custom authentication:
public class ApiKeyAuthenticationHandler : IAut…[redacted]
{
private readonly string _apiKey;
public bool IsAuthenticated => true;
public ApiKeyAuthenticationHandler(string apiKey)
{
_apiKey = apiKey;
}
public Task AuthenticateAsync() => Task.CompletedTask;
public void AuthenticateRequest(
HttpRequestMessage request,
IEnumerable<KeyValuePair<string, string>> queryParameters,
IEnumerable<KeyValuePair<string, JsonElement>> bodyParameters)
{
request.Headers.Add("X-API-Key", _apiKey);
}
}
How It Works
- Parse OpenAPI Spec: The library reads your OpenAPI specification (JSON or YAML)
- Generate Tools: Each operation in the spec becomes an MCP tool with:
- Name: Derived from
operationIdor generated from method + path - Description: From
summaryordescriptionin the spec - Input Schema: Auto-generated from parameters and request body schemas
- Name: Derived from
- Handle Requests: When an AI calls a tool, the library:
- Maps parameters to the correct location (path, query, header, body)
- Applies authentication
- Makes the HTTP request
- Returns the response as structured JSON
API Reference
Extension Methods
WithToolsFromOpenApi(string openApiSpec, string baseUrl)
Registers MCP tools from an OpenAPI specification string.
WithToolsFromOpenApi(Stream openApiSpecStream, string baseUrl)
Registers MCP tools from an OpenAPI specification stream.
WithToolsFromOpenApi(OpenApiDocument openApiDocument, string baseUrl)
Registers MCP tools from a parsed OpenAPI document.
Interfaces
IAuthenticationHandler
Interface for authentication handlers that need to authenticate before making requests.
public interface IAuthenticationHandler
{
bool IsAuthenticated { get; }
Task AuthenticateAsync();
void AuthenticateRequest(HttpRequestMessage request, ...);
}
IWebApiCaller
Interface for making HTTP requests to web APIs.
public interface IWebApiCaller
{
Task<JsonElement> CallApiAsync(WebApiMetadata apiMetadata, IDictionary<string, JsonElement> parameters, CancellationToken cancellationToken);
}
Example
Given this OpenAPI operation:
paths:
/users/{id}:
get:
operationId: GetUser
summary: Gets a user by ID
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
200:
description: The user
The library generates an MCP tool:
- Name:
GetUser - Description:
Gets a user by ID - Input Schema:
{ "id": { "type": "integer" } }
When called with { "id": 123 }, it makes a GET request to /users/123.
Requirements
- .NET 8.0 or later
- ModelContextProtocol 0.5.0-preview.1 or later
- Microsoft.OpenApi.Readers 1.6.28 or later
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Related Skills
Agent-Reach
85.2kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
73.7kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.2k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
CowAgent
47.1kOpen-source super AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
