MCP YAML API

by molavec

Integrations

  • Supports environment variable interpolation for API tokens and sensitive data through .env files, allowing secure storage of credentials used in API configurations.

  • Provides installation through the npm package registry with global installation support via 'npm install -g mcp-yaml-api'.

  • Enables defining and configuring multiple API endpoints using YAML syntax, supporting various HTTP methods, parameter generation, and request configurations.

MCP YAML API

一个模型上下文协议 (MCP) 服务器,它可以根据 YAML 文件中定义的 API 配置创建工具。此服务器允许您通过在 YAML 配置文件中定义 API 端点来创建 MCP 工具,从而轻松地将外部 API 集成到您的 MCP 生态系统中。

特征

  • 使用 YAML 配置多个 API 端点
  • 支持所有 HTTP 方法(GET、POST、PATCH、PUT、DELETE)
  • 敏感数据的环境变量插值
  • 从 URL 模板自动生成参数
  • 用于创建工具的工厂模式
  • 完整的 MCP 服务器实现

安装

npm install -g mcp-yaml-api

配置

在您的项目中创建一个api.yaml文件:

apis: getUser: url: https://api.example.com/users/{id} method: GET api-token: ${API_TOKEN} content: headers: Accept: application/json

为您的 API 令牌创建一个.env文件:

API_TOKEN=your_api_token_here

用法

运行 MCP 服务器:

mcp-yaml-api

服务器将为api.yaml文件中定义的每个 API 端点创建 MCP 工具。

YAML 配置

YAML 文件中的每个 API 端点都应该具有:

  • url :端点 URL(支持{id}等路径参数)
  • method :HTTP 方法(GET、POST、PATCH、PUT、DELETE)
  • api-token :API 令牌(支持环境变量)
  • content :请求配置
    • headers :请求标头
    • body :请求主体模式(用于 POST、PUT、PATCH)

示例配置

请参阅api.yaml以获取包含所有 HTTP 方法的完整示例。

贡献

  1. 分叉存储库
  2. 创建你的功能分支
  3. 提交你的更改
  4. 推送到分支
  5. 创建新的 Pull 请求

执照

麻省理工学院

-
security - not tested
F
license - not found
-
quality - not tested

模型上下文协议服务器根据 YAML 文件中定义的 API 配置创建工具,允许轻松将外部 API 集成到 MCP 生态系统中而无需编码。

  1. 特征
    1. 安装
      1. 配置
        1. 用法
          1. YAML 配置
            1. 示例配置
              1. 贡献
                1. 执照

                  Related MCP Servers

                  • -
                    security
                    A
                    license
                    -
                    quality
                    MCP Server simplifies the implementation of the Model Context Protocol by providing a user-friendly API to create custom tools and manage server workflows efficiently.
                    Last updated -
                    4
                    3
                    TypeScript
                    MIT License
                  • -
                    security
                    A
                    license
                    -
                    quality
                    MCP Server provides a simpler API to interact with the Model Context Protocol by allowing users to define custom tools and services to streamline workflows and processes.
                    Last updated -
                    13
                    2
                    TypeScript
                    MIT License
                  • -
                    security
                    A
                    license
                    -
                    quality
                    An MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.
                    Last updated -
                    2
                    Python
                    MIT License
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol server that exposes over 200+ APIs from API.market as MCP resources, allowing large language models to discover and interact with various APIs through natural language commands.
                    Last updated -
                    111
                    2
                    TypeScript
                    MIT License
                    • Apple

                  View all related MCP servers

                  ID: 01spoor8mp