openapi-to-mcp

openapi-to-mcp is a skill for Claude Code from mcp-use/mcp-use. It costs 235 tokens per session (5,109 once invoked), scanned C, original, MIT.

A workflow for turning an OpenAPI or Swagger document—a machine-readable description of a REST web API—into an MCP server. MCP lets AI assistants call defined tools, with each API operation becoming a tool.

In plain words
What is it for?
Use it to generate, test, authenticate, and deploy an MCP server that exposes an existing REST API to compatible AI clients.
Why use it?
It avoids manually rewriting an API’s operations, parameters, validation rules, descriptions, and authentication details for an AI assistant. The API specification remains the source of those details.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: names the AskUserQuestion tool.

Part of the all-skills plugin — 4 skills shipped together

Good fit Use it to generate, test, authenticate, and deploy an MCP server that exposes an existing REST API to compatible AI clients.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mcp-use/mcp-use/openapi-to-mcp
About the project

mcp-use is a TypeScript framework for building, testing, and deploying MCP servers and interactive MCP applications for AI agents and clients such as ChatGPT and Claude. Developers use it to define typed tools, connect React views to those tools, inspect behavior, and ship agent-facing applications.

mcp-use/mcp-use · 10,589 stars · on GitHub · manufact.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mcp-use/mcp-use --skill openapi-to-mcp
Clone the repo
git clone --depth 1 https://github.com/mcp-use/mcp-use

Made for: Claude Code.

Or install all-skills, the plugin that ships this one along with the rest of its 4 skills.

Its marketplace also offers this one on its own, as the plugin openapi-to-mcp/plugin install openapi-to-mcp after adding the marketplace above.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for openapi-to-mcp

README.md
[![agentmods](https://agentmods.dev/badge/skills/mcp-use/mcp-use/openapi-to-mcp/github.svg)](https://agentmods.dev/skills/mcp-use/mcp-use/openapi-to-mcp)
Your own site
<a href="https://agentmods.dev/skills/mcp-use/mcp-use/openapi-to-mcp"><img src="https://agentmods.dev/badge/skills/mcp-use/mcp-use/openapi-to-mcp/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for openapi-to-mcp

Your own site · 80×15
<a href="https://agentmods.dev/skills/mcp-use/mcp-use/openapi-to-mcp"><img src="https://agentmods.dev/badge/skills/mcp-use/mcp-use/openapi-to-mcp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 235 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,109 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 12 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 28
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium MCP Rug Pull · line 54
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 64
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 67
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 72
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 220
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 221
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 224
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 225
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 228
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 257
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 277
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00235 $0.05109
Opus 5 $0.00118 $0.02554
Sonnet 5 $0.00047 $0.01022
Haiku 4.5 $0.00023 $0.00511

Measured 5d ago against content hash 91563ad18624, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

openapi-to-mcp scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

If you see "Failed to resolve import" or stale tool definitions in either layer: `rm -rf .mcp-use && npm run dev`.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

**Transport must be streamable HTTP, not stdio.** mcp-use's `server.listen(port)` sets up the streamable-HTTP transport at `/mcp` — that's the right choice for every server this skill generates. Don't substitute stdio. S
skills/openapi-to-mcp/SKILL.md · 311 lines

How it starts

The opening of the file, as written. The whole thing — 311 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Build an MCP server from an OpenAPI spec

Turn an existing REST API — described by an OpenAPI 3.x or Swagger 2.0 document — into an MCP server. Each operation in the spec becomes one MCP tool the LLM can call. The server runs locally for testing and ships to Manufact / mcp-use cloud with one command.

This skill is the end-to-end recipe: scope → ingest spec → map operations → scaffold → generate tools → wire auth → test → deploy.

Core philosophy: the spec is the contract

The OpenAPI document is the source of truth. Tool names, descriptions, parameter shapes, and auth requirements all come from the spec — they should not be invented. This matters because:

  • The LLM trusts descriptions. If the spec says summary: "Get current weather for a city", that's exactly what the LLM will read when deciding whether to call the tool. Hand-rolled summaries drift; spec-derived summaries stay in sync if the API changes.
  • Zod schemas mirror OpenAPI schemas. Every parameter — path, query, body — becomes a field in one zod object. Required/optional, enums, min/max, and descriptions all carry over. The LLM uses the schema to figure out what to ask the user for.
  • Auth lives outside the spec. OpenAPI declares the auth scheme but never the secret. Secrets come from env vars; the spec tells you which env vars to require.

When in doubt, prefer mechanical fidelity to the spec over creativity. The LLM is doing the creative part — talking to the user — and only needs a faithful, well-typed handle on the API.

Process

1. Scope the request (use AskUserQuestion)

Before writing code, lock five things via the AskUserQuestion tool. All five are about the API and what to build — deployment is a separate question we ask later in step 10, when the user can actually evaluate it against a working server.

  • Spec source: a file path in the workspace, a URL (e.g., https://api.example.com/openapi.json), or pasted into chat. If pasted, save it to openapi.yaml or openapi.json first.
  • Server base URL: take it from servers[0].url in the spec if present; otherwise ask. Multiple servers entries are common (prod / staging) — confirm which one.
  • Auth scheme: read components.securitySchemes. If multiple, ask which to use. If the API needs an API key or token, ask which env var should hold it (API_KEY, OPENAI_API_KEY, etc.). Don't ask for the secret itself — never put it in the conversation or commit it.
  • Operation filter: large specs (Stripe, GitHub) have hundreds of endpoints. Ask whether to expose all operations, a tag (pets, users), or a hand-picked list. Default to "all" for specs under ~30 operations; ask above that. See references/mapping-rules.md for filtering patterns.
  • Widgets: ask whether any operations should render a widget in the chat (a React component shown inline next to the LLM's reply), or whether this is a pure tools-only server. The default for an OpenAPI wrapper is tools-only — the LLM reads JSON and talks. Pick widgets only when the user wants a richer UI for specific responses (a map for a geocoding endpoint, a chart for a metrics endpoint, a card list for a search result). This answer drives the scaffold template in step 3: tools-only → --template blank, any widgets → --template mcp-apps (which ships the resources/ widget infrastructure pre-wired). If the user wants widgets on most operations, the mcp-apps-builder skill is usually a better fit than this one — flag that and confirm before proceeding.

Read the full file on GitHub · 311 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago Changed 91563ad18624
  2. 9d ago First seen · 311 lines · 235 tokens per session scan C cac791e2b652

Subscribe to this mod's changes

openapi-to-mcp is a skill published in the GitHub repository mcp-use/mcp-use (10,589 stars, last pushed 3d ago), licensed MIT. It adds 235 tokens to every session and 5,109 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

design-mcp-server

Design the tool surface, resources, and service layer for a new MCP server. Use when starting a new server, planning a major feature expansion, or when the user describes a domain/API they want to expose via MCP. Produces a design doc at docs/design.md that drives implementation.

cyanheads/obsidian-mcp-server · 62 tokens

api-telemetry

Catalog of OpenTelemetry instrumentation built into framework @cyanheads/mcp-ts-core — spans, metrics, completion logs, env config, runtime caveats, custom instrumentation patterns, and cardinality rules. Use when enabling OTel export, adding custom spans or metrics in services, debugging missing telemetry, looking up…

cyanheads/obsidian-mcp-server · 85 tokens

api-mirror

Stand up a persistent, self-refreshing local mirror of a bulk upstream dataset with the MirrorService (@cyanheads/mcp-ts-core/mirror). Use when a server wraps a large or slow API and should query a synced local index (embedded SQLite + FTS5) instead of paginating the live API per request.

cyanheads/obsidian-mcp-server · 68 tokens

api-services

API reference for built-in service providers (LLM, Speech, Graph). Use when looking up service interfaces, provider capabilities, or integration patterns.

cyanheads/obsidian-mcp-server · 32 tokens

cmdb-patterns

Create ServiceNow CIs and cmdbrelci relationships, walk upstream/downstream impact, detect orphan/stale CIs, and align discovered CIs with the proper sysclassname hierarchy.

serac-labs/serac · 43 tokens

csm-patterns

Build ServiceNow Customer Service Management — customeraccount, customercontact, sncustomerservicecase routing, service entitlements with usage decrement, and Customer Portal case submission widgets.

serac-labs/serac · 39 tokens