Token导航 LogoToken导航TokenDH.com
OpenAPI Schema MCP logo
运维云端stdio官方级别未说明来源级核验

OpenAPI Schema MCP

MCP Server

mcp-openapi-schema

一个为大型语言模型(LLMs)提供OpenAPI规范解析和探索功能的服务器,支持加载、查询和搜索API规范。

工具数

0

提示词数

0

GitHub Stars

47

资源数

0
JavaScriptClaude云端部署Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

hannesj

提供方

hannesj

最后核验

2026/5/17 20:22

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y mcp-openapi-schema

详细介绍

OpenAPI模式模型上下文协议服务器

一个模型上下文协议(MCP)服务器,将OpenAPI模式信息暴露给像Claude这样的大型语言模型(LLM)。该服务器允许LLM通过一组专用工具探索和理解OpenAPI规范。

特性

  • 加载通过命令行参数指定的任何OpenAPI模式文件(JSON或YAML)
  • 探索API路径、操作、参数和架构
  • 查看详细的请求和响应模式
  • 查找组件定义和示例
  • 搜索整个API规范
  • 获取YAML格式的响应,以更好地理解LLM

用法

命令行

使用特定的架构文件运行MCP服务器:

# Use the default openapi.yaml in current directory
npx -y mcp-openapi-schema

# Use a specific schema file (relative path)
npx -y mcp-openapi-schema ../petstore.json

# Use a specific schema file (absolute path)
npx -y mcp-openapi-schema /absolute/path/to/api-spec.yaml

# Show help
npx -y mcp-openapi-schema --help

Claude桌面集成

要将此MCP服务器与Claude Desktop一起使用,请编辑您的 claude_desktop_config.json 配置文件:

{
  "mcpServers": {
    "OpenAPI Schema": {
      "command": "npx",
      "args": ["-y", "mcp-openapi-schema", "/ABSOLUTE/PATH/TO/openapi.yaml"]
    }
  }
}

配置文件的位置:

  • macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 窗户: $env:AppData\Claude\claude_desktop_config.json

Claude代码集成

要将此MCP服务器与Claude Code CLI一起使用,请执行以下步骤:

  1. 将OpenAPI模式MCP服务器添加到Claude代码中
   # Basic syntax
   claude mcp add openapi-schema npx -y mcp-openapi-schema

   # Example with specific schema
   claude mcp add petstore-api npx -y mcp-openapi-schema ~/Projects/petstore.yaml
  1. 验证MCP服务器是否已注册
   # List all configured servers
   claude mcp list

   # Get details for your OpenAPI schema server
   claude mcp get openapi-schema
  1. 如果需要,请删除服务器
   claude mcp remove openapi-schema
  1. 使用Claude Code中的工具

配置后,您可以在Claude Code会话中通过询问有关OpenAPI模式的问题来调用该工具。

提示:

  • 使用 -s--scope 旗与 project (默认)或 global 指定配置的存储位置
  • 为具有不同名称的不同API添加多个MCP服务器

MCP工具

服务器为LLM与OpenAPI模式交互提供了以下工具:

  • list-endpoints:列出所有API路径及其HTTP方法,其中包含嵌套对象结构中的摘要
  • get-endpoint:获取有关特定终结点的详细信息,包括参数和响应
  • get-request-body:获取特定终结点和方法的请求体架构
  • get-response-schema:获取特定终结点、方法和状态代码的响应架构
  • get-path-parameters:获取特定路径的参数
  • list-components:列出所有架构组件(架构、响应、参数等)
  • get-component:获取特定组件的详细定义
  • list-security-schemes:列出所有可用的安全方案
  • get-examples:获取特定组件或终结点的示例
  • search-schema:跨路径、操作和架构搜索

例子

要尝试的示例查询:

What endpoints are available in this API?
Show me the details for the POST /pets endpoint.
What parameters does the GET /pets/{petId} endpoint take?
What is the request body schema for creating a new pet?
What response will I get from the DELETE /pets/{petId} endpoint?
What schemas are defined in this API?
Show me the definition of the Pet schema.
What are the available security schemes for this API?
Are there any example responses for getting a pet by ID?
Search for anything related to "user" in this API.

目录标签

目录标签

JavaScriptClaude云端部署OpenAPI解析本地部署API探索LLM工具模式查询API规范

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

mcp-openapi-schema

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP