OpenAPI spesifikasyonlarını, otomatik parametre çakışması çözümü ve yerleşik HTTP istek oluşturma özellikleriyle MCP tool tanımlarına dönüştürür.
Ayrıca bilinen adı agentfront/mcp-from-openapi
- Yıldızlar
- 12
- Araçlar
- —
- İndirmeler, 30 gün
- —
- En son sürüm
- —
- Son commit
- 12 Kas 2026
- Lisans
- Apache-2.0
from-openapi MCP nedir?
from-openapi bir MCP sunucusudur. OpenAPI spesifikasyonlarını, otomatik parametre çakışması çözümü ve yerleşik HTTP istek oluşturma özellikleriyle MCP tool tanımlarına dönüştürür.
Özet, projenin README dosyasından oluşturuldu
from-openapi MCP sunucusu hakkında
REST API'ler ile AI agent'lar arasındaki boşluğu doldurmak isteyen geliştiriciler, OpenAPI spesifikasyonlarını kullanıma hazır MCP tool tanımlarına dönüştürmek için bu kütüphaneyi kullanabilirler. Aynı ismin path, query veya request body gibi farklı konumlarda yer aldığı parametre çakışmalarını yönetme gibi zorlu görevleri otomatikleştirir. Açık bir mapper ve yerleşik bir request builder sağlayarak, HTTP isteklerinin manuel birleştirme gerektirmeden doğru şekilde oluşturulmasını sağlar.
Araç, Node.js veya Cloudflare Workers gibi V8 isolate ortamlarında çalışır; spesifikasyonların URL'lerden, dosyalardan veya JSON nesnelerinden yüklenmesini destekler. Farklı AI istemcileri için özelleşmiş özellikler sunarak, oluşturulan şemaların Claude, OpenAI veya Gemini gibi spesifik modellerin kabul ettiği formatlarla eşleşmesini sağlar. Ayrıca SSRF önleme ve Bearer, OAuth2 ile AWS Sig V4 dahil olmak üzere çeşitli kimlik doğrulama şemaları için destek gibi güvenlik özellikleri sunar.
Basit dönüşümün ötesinde, analyzeToolSet aracılığıyla token bütçesi raporları ve spesifikasyon eksikliklerini belirlemek için linting gibi kürasyon yetenekleri sağlar. Kullanıcılar, agent'ları için rafine edilmiş yetenek setleri oluşturmak amacıyla araçları etiketlere, metodlara veya path globlarına göre filtreleyebilirler.
Neler yapabilirsiniz
- 1API parametre isimlendirme çakışmalarını çözünŞema çakışmalarını önlemek için bir HTTP isteğinin farklı bölümlerinden gelen örtüşen parametreleri otomatik olarak yeniden adlandırın.
- 2İstemciye özel tool şemaları oluşturunClaude, OpenAI veya Gemini gereksinimleri için özel olarak formatlanmış JSON şemaları üretin.
- 3HTTP istek oluşturma sürecini otomatize edinAraç girdilerini, karmaşık query serileştirme ve multipart body'ler dahil olmak üzere doğrudan geçerli HTTP isteklerine dönüştürün.
- 4AI token tüketimini izleyinAI agent'larda doğruluk kaybını önlemek için bir toolset'in token maliyetini tahmin edin.
Projenin README dosyasından alınmıştır. Her kullanım durumu, oradaki bir alıntı ile kontrol edilir.
from-openapi MCP nasıl yüklenir
Biçimler 10 Kas 2026 tarihinde doğrulandıCursor'a ekleGoose'a eklefrom-openapi MCP'yi Claude Code içine yükleyin
$ claude mcp add mcp-from-openapi -- npx -y mcp-from-openapifrom-openapi MCP'yi Cursor içine yükleyin
~/.cursor/mcp.json
{
"mcpServers": {
"mcp-from-openapi": {
"command": "npx",
"args": [
"-y",
"mcp-from-openapi"
]
}
}
}from-openapi MCP'yi VS Code içine yükleyin
.vscode/mcp.json
{
"servers": {
"mcp-from-openapi": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-from-openapi"
]
}
}
}from-openapi MCP'yi VS Code CLI içine yükleyin
$ code --add-mcp '{"name":"mcp-from-openapi","type":"stdio","command":"npx","args":["-y","mcp-from-openapi"]}'from-openapi MCP'yi Claude Desktop içine yükleyin
claude_desktop_config.json
{
"mcpServers": {
"mcp-from-openapi": {
"command": "npx",
"args": [
"-y",
"mcp-from-openapi"
]
}
}
}from-openapi MCP'yi Codex içine yükleyin
$ codex mcp add mcp-from-openapi -- npx -y mcp-from-openapifrom-openapi MCP'yi Codex config.toml içine yükleyin
~/.codex/config.toml
[mcp_servers.mcp-from-openapi] command = "npx" args = ["-y", "mcp-from-openapi"]
from-openapi MCP'yi Gemini CLI içine yükleyin
$ gemini mcp add -s user mcp-from-openapi npx -- -y mcp-from-openapifrom-openapi MCP'yi Gemini settings.json içine yükleyin
~/.gemini/settings.json
{
"mcpServers": {
"mcp-from-openapi": {
"command": "npx",
"args": [
"-y",
"mcp-from-openapi"
]
}
}
}Otomatik kontroller
Çalıştırıldı 14 Kas 2026Tam rapor →Otomatik kontrollerimizden geçti. Bu bir güvenlik denetimi değildir: kodu okuyun ve sunucuya ihtiyaç duyduğu en dar erişimi verin. Kontroller nasıl çalışır
- Kaynak deposu bağlantılı ve erişilebiliragentfront/mcp-from-openapi is public and reachablegithub.com/agentfront/mcp-from-openapi ↗Geçti
- Paket, bu depoyu kaynağı olarak gösteriyormcp-from-openapi names agentfront/mcp-from-openapi as sourcenpmjs.com/package/mcp-from-openapi ↗Geçti
- Derleme kökeni (Sigstore onayı)Sigstore attestation for mcp-from-openapinpmjs.com/package/mcp-from-openapi/v/2.9.3#provenance ↗Geçti
- Açık kaynak lisansı (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Geçti
- Son bir yıl içinde commit veya sürüm mevcutLast commit or release 2026-11-12github.com/agentfront/mcp-from-openapi ↗Geçti
- OpenSSF ScorecardKontrol edilmedi
- Paket adı popüler bir pakete yakın değilNo popular package one edit away from mcp-from-openapiGeçti
- Pakette veya bağımlılıklarında kritik uyarı yokKontrol edilmedi
- Modele yönelik gizli talimat yok0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersGeçti
- Yıkıcı araçlar etiketlenmişKontrol edilmedi
- Uzak uç nokta MCP el sıkışmasına yanıt veriyorKontrol edilmedi
mcp-from-openapi
Convert OpenAPI specifications into MCP tool definitions with automatic parameter conflict resolution
What This Solves
When converting OpenAPI specs to MCP tools, you hit parameter conflicts -- the same name appears in different locations (path, query, body). This library resolves them automatically and gives you an explicit mapper for building HTTP requests.
The Problem:
paths:
/users/{id}:
post:
parameters:
- name: id # path
in: path
requestBody:
content:
application/json:
schema:
properties:
id: # body -- CONFLICT!
type: string
The Solution:
{
inputSchema: {
properties: {
pathId: { type: "string" }, // Automatically renamed
bodyId: { type: "string" } // Automatically renamed
}
},
mapper: [
{ inputKey: "pathId", type: "path", key: "id" },
{ inputKey: "bodyId", type: "body", key: "id" }
]
}
Now you know exactly how to build the HTTP request.
Features
- Built-in Request Builder --
buildHttpRequest()applies the full OpenAPI serialization table (form/deepObject/pipeDelimited queries, label/matrix paths, multipart, binary,wholeBody) so you never hand-write request assembly - Client Compatibility Targets --
target: 'claude' | 'openai' | 'gemini' | 'strict'emits schemas each client actually accepts (inlined refs, closed objects, collapsed unions, demoted formats) - Context-Budget Reports --
analyzeToolSet()estimates the token bill per tool and warns at the thresholds where agent accuracy degrades - Overlays & Lint -- apply OpenAPI Overlay curation files at load time;
lint()flags the spec gaps that hurt tool-calling accuracy - Curation-Grade Filtering -- Filter by tag, method, path glob (
/admin/**), operationId, areadOnlyOnlysafety switch, andx-mcpextension flags with root < path < operation precedence - Smart Parameter Handling -- Automatic conflict detection and resolution across path, query, header, cookie, and body;
allOfbodies flatten, union and binary bodies map cleanly (wholeBody,binarymarkers) - Complete Schemas -- Input schema combines all parameters; output schema from responses (with oneOf unions); clean JSON Schema 2020-12 output (
nullableunions, normalizedexamples) - MCP-Native Tools --
titleand toolannotations(readOnly/destructive/idempotent hints) inferred from HTTP semantics, overridable via thex-mcpextension family; spec-compliant tool names (64-char cap, stable hash truncation, collision dedup); deterministic tool ordering for prompt-cache friendliness;toSdkTool()for one-line SDK registration - Security Resolution -- Framework-agnostic auth for Bearer, Basic, Digest, API Key, OAuth2, OpenID, mTLS, HMAC, AWS Sig V4; per-scheme
includeSecurityInInput - SSRF Prevention -- Blocks internal IPs, localhost, and cloud metadata endpoints by default during
$refresolution; one-flagsecureDefaultsposture for untrusted specs - Multiple Input Sources -- Load from URL, file, YAML string, or JSON object
- Rich Metadata -- Authentication, servers, tags, deprecation, external docs,
x-frontmcpextension - Production Ready -- Full TypeScript support, validation, structured errors, 100% test coverage (enforced)
- Runtime Agnostic -- Works on Node and V8 isolates (Cloudflare Workers) alike
Installation
npm install mcp-from-openapi
# or
yarn add mcp-from-openapi
# or
pnpm add mcp-from-openapi
Quick Start
import { OpenAPIToolGenerator } from "mcp-from-openapi";
// Load an OpenAPI spec
const generator = await OpenAPIToolGenerator.fromURL(
"https://api.example.com/openapi.json",
);
// Generate MCP tools
const tools = await generator.generateTools();
// Each tool has everything you need
tools.forEach((tool) => {
console.log(tool.name); // "createUser"
console.log(tool.title); // "Create a user" (from summary/extensions)
console.log(tool.annotations); // { readOnlyHint: false, destructiveHint: true, ... }
console.log(tool.inputSchema); // Combined schema for all params
console.log(tool.outputSchema); // Response schema
console.log(tool.mapper); // How to build the HTTP request
console.log(tool.metadata); // Auth, servers, tags, etc.
});
Building Requests
buildHttpRequest() turns a tool plus input values into a ready-to-send request — style/explode serialization, deepObject queries, multipart, binary, and wholeBody handled correctly:
import { buildHttpRequest } from "mcp-from-openapi";
const request = buildHttpRequest(tool, { id: "42", filter: { tag: "news" } });
// { url: 'https://api.example.com/users/42?filter[tag]=news',
// method: 'GET', headers: {...}, body: undefined, ... }
await fetch(request.url, {
method: request.method,
headers: request.headers,
body: request.body as BodyInit,
});
The mapper array stays public for anyone who needs custom request assembly — see Request Builder and Parameter Conflicts for its contract.
Serving with the Official MCP SDK
import { toSdkTool, buildHttpRequest } from "mcp-from-openapi";
import { fromJsonSchema } from "@modelcontextprotocol/server"; // SDK v2
for (const tool of await generator.generateTools({ target: "claude" })) {
server.registerTool(...toSdkTool(tool, { fromJsonSchema }), async (input) => {
const request = buildHttpRequest(tool, input);
const response = await fetch(request.url, {
method: request.method,
headers: request.headers,
body: request.body as BodyInit,
});
return { content: [{ type: "text", text: await response.text() }] };
});
}
Documentation
| Document | Description |
|---|---|
| Getting Started | Loading specs, generating tools, building requests |
| Configuration | LoadOptions, GenerateOptions, RefResolutionOptions |
| Parameter Conflicts | How conflict detection and resolution works |
| Request Builder | buildHttpRequest — full OpenAPI parameter serialization |
| Client Targets | Per-client schema dialects (Claude, OpenAI, Gemini) |
| Curation | Token budgets, overlays, lint, trimming, response hints |
| Type Signatures | TypeScript call contracts for code-execution surfaces |
| Modern MCP Fields | Tool _meta, icons, x-mcp-header, elicitation descriptors |
| Arazzo Workflows | fromArazzo() — Arazzo 1.0 workflows as consolidated MCP tools |
| Tested Examples | Runnable examples, each executed as an e2e test on every CI run |
| Response Schemas | Output schemas, status codes, oneOf unions |
| Annotations & Extensions | Tool title, annotation inference, x-mcp extension family |
| Security | SecurityResolver, all auth types, custom resolvers |
| SSRF Prevention | Ref resolution security, blocked IPs and hosts |
| Format Resolution | Format-to-schema enrichment (uuid, date-time, email, int32, etc.) |
| Naming Strategies | Custom tool naming and conflict resolvers |
| SchemaBuilder | JSON Schema utility methods |
| Error Handling | Error classes, context, and patterns |
| x-frontmcp Extension | Custom OpenAPI extension for MCP annotations |
| API Reference | Complete types, interfaces, and exports |
| Examples | MCP server, Zod, filtering, security, and more |
| Architecture | System overview, data flow, design patterns |
Requirements
- Node.js >= 20.0.0
- TypeScript >= 5.0 (for TypeScript users)
- Peer dependency:
zod@^4.0.0
Contributing
Contributions are welcome! Start with the contributing guide; this project follows the Contributor Covenant. Bug reports and feature requests go through the issue templates.
Security
Report vulnerabilities privately — see the
security policy.
When loading untrusted specs, use secureDefaults: true.
Related Projects
License
from-openapi MCP soruları
from-openapi MCP'yi Claude Code'a nasıl eklerim?
Terminalinizde claude mcp add mcp-from-openapi -- npx -y mcp-from-openapi komutunu çalıştırın. Her projede kullanılabilir olması için --scope user ekleyin.
from-openapi MCP'yi Cursor'a nasıl eklerim?
~/.cursor/mcp.json dosyasını açın ve yukarıdaki yükleme bölümünde gösterilen Cursor yapılandırmasını kullanarak sunucuyu mcpServers altına ekleyin.
Kütüphane, OpenAPI spesifikasyonlarındaki parametre çakışmalarını nasıl yönetiyor?
Aynı parametre adının path, query veya body gibi farklı konumlarda göründüğü çakışmaları otomatik olarak tespit eder ve bunları yeniden adlandırarak çözer.
Bunu Claude veya OpenAI gibi farklı AI istemcileriyle kullanabilir miyim?
Evet; her istemcinin kabul ettiği şemaları oluşturarak Claude, OpenAI ve Gemini dahil olmak üzere belirli istemci uyumluluk hedeflerini destekler.
Araçlar için token kullanımını yönetmeye yardımcı oluyor mu?
Evet; araç başına token maliyetini tahmin eden ve eşik değerlere ulaşıldığında sizi uyaran context-budget raporları içerir.
Hangi kimlik doğrulama yöntemleri destekleniyor?
Kütüphane; Bearer, Basic, Digest, API Key, OAuth2, OpenID, mTLS, HMAC ve AWS Sig V4 için framework bağımsız destek sunar.