SkillAgentSearch skills...

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

If the server publishes to npm under a different name, use that package instead — check the repo README.

About this skill
🔌

MCP Server

Model Context Protocol server

Quality Score

77/100

Category

Automation

Supported Platforms

Claude Code
Claude Desktop

Tags

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.

Substance
29/30
Structure
20/20
Description
15/15
Adoption
3/20
Freshness
11/15

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 found

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

SkillScoreStarsUpdatedFormat
OpenApiMcpNet (this skill)by kerryjiang7735mo agoMCP Server
Agent-Reachby Panniantong10085.2k8d agoCLAUDE.md
headroomby headroomlabs-ai10073.7ktodayCLAUDE.md
rufloby ruvnet10073.2ktodayCLAUDE.md
CowAgentby zhayujie10047.1ktodayCLAUDE.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.

OpenApiMcpNet

build NuGet Version NuGet Downloads

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

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

  1. Parse OpenAPI Spec: The library reads your OpenAPI specification (JSON or YAML)
  2. Generate Tools: Each operation in the spec becomes an MCP tool with:
    • Name: Derived from operationId or generated from method + path
    • Description: From summary or description in the spec
    • Input Schema: Auto-generated from parameters and request body schemas
  3. 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

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

View on GitHub
GitHub Stars3
CategoryAutomation
Updated5mo ago
Forks0

Languages

C#

Trust signals

90/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 low1 info