TA

tyktechnologies/api-to-mcp

Developer tools

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

52 stars 21 forks Качество 70 Тренд 0MIT

tyktechnologies/api-to-mcp — кандидат на сервер MCP, импортированный из https://github.com/tyktechnologies/api-to-mcp.

Обзор

tyktechnologies/api-to-mcp — кандидат на сервер MCP, импортированный из https://github.com/tyktechnologies/api-to-mcp.

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

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

Обзор

Этот проект создает динамический MCP-сервер, который преобразует спецификации OpenAPI в инструменты MCP. Он обеспечивает бесшовную интеграцию REST API с помощниками ИИ через протокол Model Context, превращая любой API в инструмент, доступный для ИИ.

Особенности

Динамическая загрузка спецификаций OpenAPI из URL-адресов HTTP/HTTPS Поддержка наложений OpenAPI, загружаемых из файлов или URL HTTP/HTTPS Настраиваемое отображение операций OpenAPI на инструменты MCP

  • Продвинутая фильтрация операций с использованием шаблонов шаров как для траекторий OperationId, так и для URL-адресов Комплексная обработка параметров с сохранением формата и метаданных о местоположении Обработка аутентификации API Метаданные OpenAPI (название, версия, описание), используемые для настройки MCP-сервера
  • Иерархическое описание запасных частей (описание операции → резюме операции → резюме пути) Поддержка пользовательских HTTP-заголовков через переменные среды и CLI Заголовок X-MCP для отслеживания и идентификации запросов API

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

README

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

OpenAPI to MCP Server

A tool that creates MCP (Model Context Protocol) servers from OpenAPI/Swagger specifications, enabling AI assistants to interact with your APIs. Create your own branded and customized MCPs for specific APIs or services.

Overview

This project creates a dynamic MCP server that transforms OpenAPI specifications into MCP tools. It enables seamless integration of REST APIs with AI assistants via the Model Context Protocol, turning any API into an AI-accessible tool.

Features

  • Dynamic loading of OpenAPI specs from file or HTTP/HTTPS URLs
  • Support for OpenAPI Overlays loaded from files or HTTP/HTTPS URLs
  • Customizable mapping of OpenAPI operations to MCP tools
  • Advanced filtering of operations using glob patterns for both operationId and URL paths
  • Comprehensive parameter handling with format preservation and location metadata
  • API authentication handling
  • OpenAPI metadata (title, version, description) used to configure the MCP server
  • Hierarchical description fallbacks (operation description → operation summary → path summary)
  • Custom HTTP headers support via environment variables and CLI
  • X-MCP header for API request tracking and identification
  • Support for custom x-mcp extensions at the path level to override tool names and descriptions

Using with AI Assistants

This tool creates an MCP server that allows AI assistants to interact with APIs defined by OpenAPI specifications. The primary way to use it is by configuring your AI assistant to run it directly as an MCP tool.

Setting Up in Claude Desktop

  1. Ensure you have Node.js installed on your computer

  2. Open Claude Desktop and navigate to Settings > Developer

  3. Edit the configuration file (or it will be created if it doesn’t exist):

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  4. Add this configuration (customize as needed):

{
  "mcpServers": {
    "api-tools": {
      "command": "npx",
      "args": [
        "-y",
        "@tyk-technologies/api-to-mcp@latest",
        "--spec",
        "https://petstore3.swagger.io/api/v3/openapi.json"
      ],
      "enabled": true
    }
  }
}
  1. Restart Claude Desktop
  2. You should now see a hammer icon in the chat input box. Click it to access your API tools.

Customizing the Configuration

You can adjust the args array to customize your MCP server with various options:

{
  "mcpServers": {
    "my-api": {
      "command": "npx",
      "args": [
        "-y",
        "@tyk-technologies/api-to-mcp@latest",
        "--spec",
        "./path/to/your/openapi.json",
        "--overlays",
        "./path/to/overlay.json,https://example.com/api/overlay.json",
        "--whitelist",
        "getPet*,POST:/users/*",
        "--targetUrl",
        "https://api.example.com"
      ],
Открыть полный README на GitHub

Установка

npx -y @tyk-technologies/api-to-mcp@latest --spec https://petstore3.swagger.io/api/v3/openapi.json
Новичок в MCP? Начните с руководства на mcpskill.org →

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

{ "mcpServers": { "api-tools": { "command": "npx", "args": [ "-y", "@tyk-technologies/api-to-mcp@latest", "--spec", "https://petstore3.swagger.io/api/v3/openapi.json" ], "enabled": true } } }