mcp-openapi-schema

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Supports integration with Claude Desktop on Linux through configuration file located at ~/Library/Application Support/Claude/claude_desktop_config.json.

  • Supports integration with Claude Desktop on macOS through configuration file located at ~/Library/Application Support/Claude/claude_desktop_config.json.

  • Processes OpenAPI schema files in YAML format and presents schema information in YAML format for better LLM comprehension.

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

一个模型上下文协议 (MCP) 服务器,用于向 Claude 等大型语言模型 (LLM) 公开 OpenAPI 架构信息。该服务器允许 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
  • Windows: $env:AppData\Claude\claude_desktop_config.json

克劳德代码集成

要将此 MCP 服务器与 Claude Code CLI 一起使用,请按照以下步骤操作:

  1. 将 OpenAPI Schema 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
  2. 验证 MCP 服务器是否已注册
    # List all configured servers claude mcp list # Get details for your OpenAPI schema server claude mcp get openapi-schema
  3. 如果需要,删除服务器
    claude mcp remove openapi-schema
  4. 使用 Claude Code 中的工具配置完成后,您可以通过询问有关 OpenAPI 模式的问题在 Claude Code 会话中调用该工具。

尖端:

  • 使用-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.
-
security - not tested
F
license - not found
-
quality - not tested

一个 MCP 服务器,用于向 Claude 等 LLM 公开 OpenAPI 模式信息。该服务器允许 LLM 通过一组专用工具探索和理解大型 OpenAPI 模式,而无需将整个模式加载到上下文中

  1. Features
    1. Usage
      1. Command Line
      2. Claude Desktop Integration
      3. Claude Code Integration
    2. MCP Tools
      1. Examples
        ID: 9yqbiz3hwx