Openapi.client
БесплатноНе проверенOpenAPI Client is a toolkit that helps you create HTTP clients for external APIs based on their OpenAPI specifications. It simplifies the process of consuming a
Описание
OpenAPI Client is a toolkit that helps you create HTTP clients for external APIs based on their OpenAPI specifications. It simplifies the process of consuming and interacting with various web services.
README
Created with ❤ in Poland by lepo.co and the awesome open-source community.
OpenAPI Client is a modern toolkit for developers working with OpenAPI/Swagger specifications. It provides multiple tools to simplify the creation, inspection, validation, and integration of OpenAPI clients across .NET projects and MCP (Model Context Protocol) environments.
🧰 What's in this repo?
This repository contains a suite of OpenAPI tools designed to support different workflows:
| Tool | Description |
|---|---|
| 🧠 .NET Source Generator | Generates C# HTTP clients directly from OpenAPI JSON/YAML files at build time. |
| 💻 .NET CLI Tool | Command-line tool to generate clients from OpenAPI definitions manually. |
| 🛰️ MCP Server | Containerized server with built-in tools for working with OpenAPI specs. |
🚀 MCP Server Tools
The MCP Server is the central piece of this toolkit. It runs as a standalone container or inside an MCP setup and exposes tools for working with OpenAPI documents.
🛠️ Available Server Tools
| Tool | Description |
|---|---|
get_list_of_operations |
Lists all operation IDs from a given OpenAPI or Swagger JSON document. |
get_known_responses |
Lists all known responses for given operation IDs from a OpenAPI or Swagger JSON document. |
validate_document |
Validates the structure and syntax of an OpenAPI JSON document. |
generate_curl_command |
Generates a cURL command for a specific operation ID. |
create_csharp_snippet |
Creates a simple HTTP request for a given operation ID. |
🐳 Run the server with Docker
Build the image:
docker buildx build ./ -t mcp/openapi --no-cache
# or
dotnet publish ./src/OpenApi.Client.Mcp/OpenApi.Client.Mcp.csproj -c Release /t:PublishContainer
Run the container:
docker run -d -i --rm --name mcp-openapi mcp/openapi
# or for HTTP mode:
docker run -d -i --rm --name mcp-openapi mcp/openapi -e MODE=Http -p 64622:8080
Example MCP config (.mcp.json):
{
"servers": {
"openapi": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "mcp/openapi"]
}
},
"inputs": []
}
📦 NuGet Package (Source Generator)
OpenApiClient is available as NuGet package on NuGet.org:
https://www.nuget.org/packages/OpenApiClient
Install the package to enable automatic OpenAPI client generation:
dotnet add package OpenApiClient
, or package manager console:
NuGet\Install-Package OpenApiClient
In your .csproj:
<ItemGroup>
<AdditionalFiles Include="google.youtube.api.json" />
</ItemGroup>
Define a client:
[OpenApiClient("google.youtube.api")]
public partial class YouTubeClient;
Use it:
var client = new YouTubeClient(new HttpClient());
var subs = await client.SubscribersCountAsync("mychannel", CancellationToken.None);
Known limitations
Since we are using the generated internal OpenApiAttribute as a marker, conflicts may occur when we use InternalsVisibleTo.
We found the use of nullable essential, so C# 8.0 is required.
💻 .NET CLI Tool
Generate OpenAPI clients from the terminal:
dotnet tool install --global OpenApiClient.Cli
dotnet openapi generate ./google.youtube.api.json --output ./clients/YouTubeClient.cs --namespace Google.YouTube --classname YouTubeClient
OpenAPI
OpenAPI specification is available at:
https://github.com/OAI/OpenAPI-Specification
Code of Conduct
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
License
OpenAPI Client is free and open source software licensed under MIT License. You can use it in private and commercial projects.
Keep in mind that you must include a copy of the license in your project.
Установка Openapi.client
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/lepoco/openapi.clientFAQ
Openapi.client MCP бесплатный?
Да, Openapi.client MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Openapi.client?
Нет, Openapi.client работает без API-ключей и переменных окружения.
Openapi.client — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Openapi.client в Claude Desktop, Claude Code или Cursor?
Открой Openapi.client на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare Openapi.client with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
