OpenAPI 사양을 MCP tool 정의로 변환하며, 자동 매개변수 충돌 해결 및 내장 HTTP 요청 빌더 기능을 제공합니다.
다른 이름 agentfront/mcp-from-openapi
- 스타
- 12
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 11월 12일
- 라이선스
- Apache-2.0
from-openapi MCP란?
from-openapi은(는) MCP server입니다. OpenAPI 사양을 MCP tool 정의로 변환하며, 자동 매개변수 충돌 해결 및 내장 HTTP 요청 빌더 기능을 제공합니다.
프로젝트 README에서 생성된 요약
from-openapi MCP server 정보
REST API와 AI 에이전트 사이의 간극을 메우려는 개발자는 이 라이브러리를 사용하여 OpenAPI 사양을 즉시 사용 가능한 MCP tool 정의로 변환할 수 있습니다. 경로, 쿼리 또는 요청 바디와 같이 서로 다른 위치에 동일한 이름이 나타나는 매개변수 충돌 문제를 처리하는 까다로운 작업을 자동화합니다. 명시적인 매퍼와 내장된 요청 빌더를 제공하여 수동 조립 없이 HTTP 요청이 올바르게 구성되도록 보장합니다.
이 도구는 Node.js 또는 Cloudflare Workers와 같은 V8 isolate에서 작동하며 URL, 파일 또는 JSON 객체로부터 사양을 로드하는 것을 지원합니다. 다양한 AI 클라이언트를 위한 특화된 기능을 포함하고 있어, 사용자가 Claude, OpenAI 또는 Gemini를 대상으로 설정하여 생성된 스키마가 각 모델이 수용하는 형식과 일치하도록 할 수 있습니다. 또한 SSRF 방지 및 Bearer, OAuth2, AWS Sig V4를 포함한 다양한 인증 체계 지원과 같은 보안 기능을 제공합니다.
단순한 변환을 넘어, analyzeToolSet을 통한 토큰 예산 보고서 및 사양의 누락을 식별하는 린팅(linting)과 같은 큐레이션 기능을 제공합니다. 사용자는 태그, 메서드 또는 경로 glob을 사용하여 도구를 필터링함으로써 에이전트를 위한 정교한 기능 세트를 구성할 수 있습니다.
활용 사례
- 1API 매개변수 명명 충돌 해결HTTP 요청의 서로 다른 부분에서 발생하는 중복 매개변수의 이름을 자동으로 변경하여 스키마 충돌을 방지합니다.
- 2클라이언트별 도구 스키마 생성Claude, OpenAI 또는 Gemini의 요구 사항에 맞춰 특화된 형식의 JSON 스키마를 생성합니다.
- 3HTTP 요청 구성 자동화복잡한 쿼리 직렬화 및 multipart 바디를 포함하여 도구 입력을 유효한 HTTP 요청으로 직접 변환합니다.
- 4AI 토큰 소비 모니터링도구 세트의 토큰 비용을 추정하여 AI 에이전트의 정확도 저하를 방지합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
from-openapi MCP 설치 방법
형식 확인: 2026년 11월 10일Cursor에 추가Goose에 추가Claude Code에 from-openapi MCP 설치
$ claude mcp add mcp-from-openapi -- npx -y mcp-from-openapiCursor에 from-openapi MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"mcp-from-openapi": {
"command": "npx",
"args": [
"-y",
"mcp-from-openapi"
]
}
}
}VS Code에 from-openapi MCP 설치
.vscode/mcp.json
{
"servers": {
"mcp-from-openapi": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-from-openapi"
]
}
}
}VS Code CLI에 from-openapi MCP 설치
$ code --add-mcp '{"name":"mcp-from-openapi","type":"stdio","command":"npx","args":["-y","mcp-from-openapi"]}'Claude Desktop에 from-openapi MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"mcp-from-openapi": {
"command": "npx",
"args": [
"-y",
"mcp-from-openapi"
]
}
}
}Codex에 from-openapi MCP 설치
$ codex mcp add mcp-from-openapi -- npx -y mcp-from-openapiCodex config.toml에 from-openapi MCP 설치
~/.codex/config.toml
[mcp_servers.mcp-from-openapi] command = "npx" args = ["-y", "mcp-from-openapi"]
Gemini CLI에 from-openapi MCP 설치
$ gemini mcp add -s user mcp-from-openapi npx -- -y mcp-from-openapiGemini settings.json에 from-openapi MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"mcp-from-openapi": {
"command": "npx",
"args": [
"-y",
"mcp-from-openapi"
]
}
}
}자동 검사
2026년 11월 14일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능agentfront/mcp-from-openapi is public and reachablegithub.com/agentfront/mcp-from-openapi ↗통과
- 패키지가 이 저장소를 소스로 명시mcp-from-openapi names agentfront/mcp-from-openapi as sourcenpmjs.com/package/mcp-from-openapi ↗통과
- 빌드 출처(Sigstore 증명)Sigstore attestation for mcp-from-openapinpmjs.com/package/mcp-from-openapi/v/2.9.3#provenance ↗통과
- 오픈 소스 라이선스 (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-11-12github.com/agentfront/mcp-from-openapi ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음No popular package one edit away from mcp-from-openapi통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음0 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기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 질문
from-openapi MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add mcp-from-openapi -- npx -y mcp-from-openapi를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
from-openapi MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
OpenAPI 사양의 매개변수 충돌을 어떻게 처리하나요?
경로(path), 쿼리(query), 바디(body) 등 서로 다른 위치에 동일한 매개변수 이름이 나타나는 경우, 이름을 자동으로 변경하여 충돌을 감지하고 해결합니다.
Claude 또는 OpenAI와 같은 다양한 AI 클라이언트와 함께 사용할 수 있나요?
네, 각 클라이언트가 수용하는 스키마를 생성함으로써 Claude, OpenAI, Gemini를 포함한 특정 클라이언트 호환성을 지원합니다.
도구의 토큰 사용량 관리에 도움이 되나요?
네, 도구별 토큰 비용을 추정하는 컨텍스트 예산 보고서를 제공하며, 임계값에 도달하면 경고를 보냅니다.
지원되는 인증 방식은 무엇인가요?
Bearer, Basic, Digest, API Key, OAuth2, OpenID, mTLS, HMAC, AWS Sig V4를 프레임워크에 구애받지 않고 지원합니다.