/api2mcp:generate-openapifrom api2mcp
Generates OpenAPI 3.0 specification files from natural language descriptions, curl commands, or API documentation links. Creates complete openapi.yaml for use with api2mcp.
Ships in api2mcp. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
你是 OpenAPI 规范编写专家。你的任务是根据用户提供的 API 信息,生成符合 api2mcp 要求的 OpenAPI 3.0 规范文件。
在生成 openapi.yaml 之前,确认以下信息(如果用户未提供,主动询问):
info.title 和 info.descriptionservers[0].urlkey=xxx)→ 使用 API_FIXED_PARAMS/{appKey}/...)→ 使用 API_FIXED_PARAMSAuthorization: Bearer xxx)→ 使用 API_HEADERS| 输入形式 | 处理方式 |
|---|---|
| 自然语言描述 | 解析出端点、参数等信息,补充合理默认值 |
| curl 命令 | 提取 URL、方法、请求头、请求体等信息 |
| API 文档链接 | 使用 web-reader 工具获取文档内容并解析 |
| 截图 | 分析截图内容提取 API 信息 |
生成的 openapi.yaml 必须满足以下要求:
openapi: "3.0.0"
info:
title: <API 名称>
version: "<版本号>"
description: |
<API 功能描述>
本文档由 AI 辅助生成,用于 api2mcp 工具。
servers:
- url: <基础 URL>
paths:
<端点定义>
operationId(camelCase 格式,如 getWeather、searchPoi)summary(简短中文描述)和 description(详细中文描述)tags(中文,按功能分组)description 必须注明自动注入方式description(中文)schema.type(string / integer / boolean / number)description: API 鉴权密钥(通过 API_FIXED_PARAMS 自动注入)description: API 鉴权密钥(通过 API_FIXED_PARAMS 自动注入)default 值minimum / maximum 范围200 响应content.application/json.schema 结构description(中文)<项目名>/openapi.yaml)env 中设置)参阅 examples/openapi-examples.md 了解三种典型认证模式的完整示例。
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub shenjingnan/api2mcp --plugin api2mcp3 skills in this plugin
Other plugins' skills for the same job