OpenAPI 模式模型上下文协议服务器
一个模型上下文协议 (MCP) 服务器,用于向 Claude 等大型语言模型 (LLM) 公开 OpenAPI 架构信息。该服务器允许 LLM 通过一组专用工具探索和理解 OpenAPI 规范。
特征
通过命令行参数加载指定的任何 OpenAPI 模式文件(JSON 或 YAML)
探索 API 路径、操作、参数和模式
查看详细的请求和响应架构
查找组件定义和示例
在整个 API 规范中进行搜索
获取 YAML 格式的回复,以便更好地理解 LLM
用法
命令行
使用特定的模式文件运行 MCP 服务器:
Claude 桌面集成
要将此 MCP 服务器与 Claude Desktop 一起使用,请编辑您的claude_desktop_config.json
配置文件:
配置文件的位置:
macOS/Linux:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows:
$env:AppData\Claude\claude_desktop_config.json
克劳德代码集成
要将此 MCP 服务器与 Claude Code CLI 一起使用,请按照以下步骤操作:
将 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验证 MCP 服务器是否已注册
# List all configured servers claude mcp list # Get details for your OpenAPI schema server claude mcp get openapi-schema如果需要,删除服务器
claude mcp remove openapi-schema使用 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
:跨路径、操作和模式搜索
示例
尝试的示例查询:
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
一个 MCP 服务器,用于向 Claude 等 LLM 公开 OpenAPI 模式信息。该服务器允许 LLM 通过一组专用工具探索和理解大型 OpenAPI 模式,而无需将整个模式加载到上下文中
Related Resources
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol (MCP) server that lets you seamlessly use OpenAI's models right from Claude.Last updated -9068MIT License
- -securityAlicense-qualityA MCP server that exposes GraphQL schema information to LLMs like Claude. This server allows an LLM to explore and understand large GraphQL schemas through a set of specialized tools, without needing to load the whole schema into the contextLast updated -1742MIT License
- -securityAlicense-qualityAn MCP server that connects any MCP client (like Claude or Cursor) with the browser using browser-use, allowing clients to utilize existing LLMs without requiring additional API keys.Last updated -74Apache 2.0
- -securityFlicense-qualityAn MCP server that integrates with Claude to provide smart documentation search capabilities across multiple AI/ML libraries, allowing users to retrieve and process technical information through natural language queries.Last updated -