KM

kadykov/mcp-openapi-schema-explorer

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

76 stars 14 forks 质量 86 趋势 20MIT

kadykov/mcp-openapi-schema-explorer 是从 https://github.com/kadykov/mcp-openapi-schema-explorer. 导入的 MCP 服务器候选

概览

kadykov/mcp-openapi-schema-explorer 是从 https://github.com/kadykov/mcp-openapi-schema-explorer. 导入的 MCP 服务器候选

概述(AI 翻译)

一个MCP(模型上下文协议)服务器,通过MCP资源模板提供高效的令牌访问OpenAPI(v3.0)和Swagger(v2.0)规范。

项目目标

该项目的主要目标是让MCP客户端(如Cline或Claude Desktop)能够在无需将整个文件加载到LLM上下文窗口的情况下,探索大型OpenAPI规范的结构和细节。它通过MCP资源模板公开规范的部分内容实现这一目标,这些模板为只读数据探索提供了参数化访问模式。

该服务器支持从本地文件路径和远程 HTTP/HTTPS URL 加载规范。Swagger v2.0 规范在加载时会自动转换为 OpenAPI v3.0。

注: 本服务器提供资源模板(非预枚举资源)。MCP客户端通过resources/templates/list协议方法访问这些模板。有关资源模板的更多信息,请参见MCP资源模板文档。

为什么选择MCP资源模板?

模型上下文协议定义了资源和工具。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP OpenAPI Schema Explorer

An MCP (Model Context Protocol) server that provides token-efficient access to OpenAPI (v3.0) and Swagger (v2.0) specifications via MCP Resource Templates.

Project Goal

The primary goal of this project is to allow MCP clients (like Cline or Claude Desktop) to explore the structure and details of large OpenAPI specifications without needing to load the entire file into an LLM’s context window. It achieves this by exposing parts of the specification through MCP Resource Templates, which provide parameterized access patterns for read-only data exploration.

This server supports loading specifications from both local file paths and remote HTTP/HTTPS URLs. Swagger v2.0 specifications are automatically converted to OpenAPI v3.0 upon loading.

Note: This server provides resource templates (not pre-enumerated resources). MCP clients access these templates through the resources/templates/list protocol method. For more information about resource templates, see the MCP Resource Templates documentation.

Why MCP Resource Templates?

The Model Context Protocol defines both Resources and Tools.

  • Resources: Represent data sources (like files, API responses). They are ideal for read-only access and exploration by MCP clients.
    • Resource Templates: A special type of resource that uses parameterized URIs (e.g., openapi://paths/{path}/{method}), allowing dynamic access without pre-enumerating all possible values.
  • Tools: Represent executable actions or functions, often used by LLMs to perform tasks or interact with external systems.
在 GitHub 查看完整 README

安装

npx -y mcp-openapi-schema-explorer@latest <path-or-url-to-spec> --output-format yaml
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "My API Spec (npx)": { "command": "npx", "args": [ "-y", "mcp-openapi-schema-explorer@latest", "<path-or-url-to-spec>", "--output-format", "yaml" ], "env": {} } } }