HM

hannesj/mcp-openapi-schema

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

50 stars 14 forks Качество 53 Тренд 0

hannesj/mcp-openapi-schema - кандидат на сервер MCP, импортированный из https://github.com/hannesj/mcp-openapi-schema.

Обзор

hannesj/mcp-openapi-schema - кандидат на сервер MCP, импортированный из https://github.com/hannesj/mcp-openapi-schema.

Обзор (машинный перевод)

Сервер Model Context Protocol (MCP), который предоставляет информацию о схеме OpenAPI для моделей большого языка (LLM), таких как Claude. Этот сервер позволяет LLM исследовать и понимать спецификации OpenAPI с помощью набора специализированных инструментов.

Особенности

Загрузите любой файл схемы OpenAPI (JSON или YAML), указанный в аргументе командной строки. Исследуйте пути API, операции, параметры и схемы

  • Посмотреть подробные схемы запросов и ответов
  • Просмотреть определения компонентов и примеры Поиск по всей спецификации API Получите ответы в формате YAML для лучшего понимания LLM

Использование

Командная строка

Запустите MCP-сервер с определенным файлом схемы:

###Интеграция рабочего стола

Чтобы использовать этот 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, выполните следующие действия:

1.Добавить MCP-сервер OpenAPI Schema в Claude Code

2.** Проверить, зарегистрирован ли MCP-сервер**

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

OpenAPI Schema Model Context Protocol Server

A Model Context Protocol (MCP) server that exposes OpenAPI schema information to Large Language Models (LLMs) like Claude. This server allows an LLM to explore and understand OpenAPI specifications through a set of specialized tools.

Features

  • Load any OpenAPI schema file (JSON or YAML) specified via command line argument
  • Explore API paths, operations, parameters, and schemas
  • View detailed request and response schemas
  • Look up component definitions and examples
  • Search across the entire API specification
  • Get responses in YAML format for better LLM comprehension

Usage

Command Line

Run the MCP server with a specific schema file:

# 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 Desktop Integration

To use this MCP server with Claude Desktop, edit your claude_desktop_config.json configuration file:

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

Location of the configuration file:

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

Claude Code Integration

To use this MCP server with Claude Code CLI, follow these steps:

  1. Add the OpenAPI Schema MCP server to Claude Code

    # 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. Verify the MCP server is registered

    # List all configured servers
    claude mcp list
    
    # Get details for your OpenAPI schema server
    claude mcp get openapi-schema
    
  3. Remove the server if needed

    claude mcp remove openapi-schema
    
  4. Use the tool in Claude Code

    Once configured, you can invoke the tool in your Claude Code session by asking questions about the OpenAPI schema.

Tips:

  • Use the -s or --scope flag with project (default) or global to specify where the configuration is stored
  • Add multiple MCP servers for different APIs with different names

MCP Tools

The server provides the following tools for LLMs to interact with OpenAPI schemas:

  • list-endpoints: Lists all API paths and their HTTP methods with summaries in a nested object structure
  • get-endpoint: Gets detailed information about a specific endpoint including parameters and responses
  • get-request-body: Gets the request body schema for a specific endpoint and method
Открыть полный README на GitHub

Установка

npx -y mcp-openapi-schema /ABSOLUTE/PATH/TO/openapi.yaml
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

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