mcpField
M
Meta API MCP Server

Meta API MCP Server

本地服务
savhascelik.github.io开发工具1259 周前更新

关于 Meta API MCP Server

Meta API MCP Server 是 API 网关,可将配置的 HTTP API 和 Postman Collection 转为 MCP 工具,供 MCP 客户端使用,并配有可视化编辑器。

主要功能

  1. 01在单一服务中管理多个 API
  2. 02将 Postman Collection 转为工具
  3. 03支持常见 HTTP 方法
  4. 04支持 API Key 或 Bearer 认证
  5. 05从文件或 URL 加载配置
  6. 06通过可视化编辑器创建并校验配置

适用场景

  1. 01向 MCP 客户端开放现有 HTTP 端点
  2. 02将 Postman Collection 转为 MCP 工具
  3. 03编辑并校验 API 配置文件

MCP 相关

它将已配置的 API 作为工具提供给 MCP 客户端,也可分析 Postman Collection 并将其转换为兼容 MCP 的工具。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"meta-api": {
"command": "npx",
"args": [
"-y",
"meta-api-mcp-server"
],
"env": {
"YOUR_API_KEY": "<YOUR_API_KEY>"
}
}
}
}
启动命令npx -y meta-api-mcp-server
需要配置的环境变量
YOUR_API_KEY密钥If the api you are connecting to requires api_key, you can use this variable and you can also define different variables

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmmeta-api-mcp-server1.0.4

工具

69

收录的工具列表 · 更新于 3 周前

参数类型必填说明
limitinteger否每页结果数,默认值为 10,最大值为 100。
ending_beforestring否用于分页的游标。费用的 ID。
starting_afterstring否用于分页的游标。费用的 ID。

详细介绍

Meta API MCP Server

一个适用于 Model Context Protocol(MCP)的元 API 网关服务。你可以通过 MCP 将任意 API 连接到大模型(Claude、GPT 等)。这使 AI 助手能够直接与 API 交互并访问真实世界的数据源。

功能

  • 🔄 多 API 支持:通过单个服务管理多个 API
  • 🛠️ 使用 JSON 配置文件轻松添加 API
  • 📋 自动将 Postman 集合转换为 MCP 工具
  • 🔌 全面支持 HTTP API(GET、POST、PUT、DELETE、PATCH)
  • 🔒 支持多种身份验证方式(API Key、Bearer Token)
  • 📁 从本地文件或远程 URL 加载配置
  • 📑 支持配置文件列表

API 编辑器工具

我们开发了一款易于使用的编辑器工具,用于创建或编辑 JSON 配置文件:

MCP API 编辑器

安装

使用 NPM 全局安装(推荐)
npm install -g meta-api-mcp-server
从源代码安装
git clone https://github.com/savhascelik/meta-api-mcp-server.git
cd meta-api-mcp-server
npm install

使用方法

作为命令行工具使用
# Load from default api-configs/ folder
meta-api-mcp-server

# Specify a configuration file (in the directory where you run the server, there should be a folder with this name and structured json in it)
meta-api-mcp-server path/to/config.json

# Load from a specific folder
meta-api-mcp-server path/to/configs/

# Load from a remote URL
meta-api-mcp-server https://example.com/api-config.json

# Load from a remote configuration list
meta-api-mcp-server https://example.com/config-list.json

# Load from a Postman Collection ( your filename must contain the word ‘postman’, I'll bind it to a variable when I have time )
meta-api-mcp-server path/to/My-API.postman_collection.json
与 Cursor 或其他 MCP 客户端配合使用

要连接 Cursor 等 MCP 客户端,请按如下方式配置 mcp.json 文件:

{
  "mcpServers": {
    "myApiServer": { 
      "command": "meta-api-mcp-server",
      "args": [
        
      ],
      "env": {
         "MCP_CONFIG_SOURCE":"api-configs/flexweather-endpoints.json",
        "API_KEY": "your-api-key-here"
      }
    }
  }
}
{
  "mcpServers": {
    "myApiServer": { 
      "command": "meta-api-mcp-server",
      "args": [
        "server.js",
        "path/to/api-config.json"
      ],
      "env": {
        "EXAMPLE_API_KEY": "your-api-key-here"
      }
    }
  }
}
{
  "mcpServers": {

    "flexweather": { 
      "command": "node",
      "args": [
        "server.js"
        
      ],
      "env": {
        "MCP_CONFIG_SOURCE":"api-configs/flexweather-endpoints.json"
      }
    }
  }
}
{
  "mcpServers": {
     "lemonsqueezy": { 
      "command": "node",
      "args": [
        "server.js"
        
      ],
      "env": {
        "MCP_CONFIG_SOURCE":"api-configs/lemon-squeezy-api.json",
        "LEMON_SQUEEZY_API_KEY": ""
      
      }
    }
  }
}

Postman 集合转换

现在,使用现有的 Postman 集合搭配 Meta API MCP Server 非常简单!无需编写任何代码,即可使用数百种现成的 API。

  1. 导出 Postman 集合(使用 v2.1.0 格式)
  2. 使用集合文件启动 Meta API MCP Server:
meta-mcp my-collection.postman_collection.json
  1. 服务将自动:

    • 分析所有端点
    • 检测身份验证方式
    • 提取路径/查询参数
    • 分析请求正文结构
    • 创建 MCP 工具
  2. 将 API 密钥添加到 .env 文件中(服务会告知应使用哪个环境变量)

支持的 Postman 集合功能
  • ✅ 多级文件夹结构
  • ✅ Bearer Token 身份验证
  • ✅ API Key 身份验证
  • ✅ 路径参数
  • ✅ 查询参数
  • ✅ 请求头
  • ✅ JSON 请求正文
  • ✅ Postman 变量(例如 {{api_url}})

API 编辑器工具

我们开发了一款易于使用的编辑器工具,用于创建或编辑 JSON 配置文件:

MCP API 编辑器

使用这个网页工具,你可以:

  • 通过可视化界面创建 API 配置
  • 编辑现有的 JSON 配置
  • 将 Postman 集合转换为兼容 MCP 的配置文件
  • 验证配置文件
  • 将配置导出为 JSON

Postman 集合: 你可以将现有的 Postman 集合上传到编辑器工具,并自动将其转换为兼容 MCP 的配置。这样,你就可以快速使用现有集合,而无需从头配置 API。

该编辑器让你可以轻松管理工具名称、参数和所有其他配置选项。

项目结构

代码库采用模块化组织方式,便于维护和扩展:

meta-api-mcp-server/
├── serve.js
├── api-configs/            # Default config directory
└── package.json

API 配置文件格式

你可以使用以下 JSON 格式手动配置 API:

{
  "apiId": "my-api",
  "handlerType": "httpApi",
  "baseUrl": "https://api.example.com",
  "authentication": {
    "type": "bearerToken",
    "envVariable": "MY_API_TOKEN"
  },
  "endpoints": [
    {
      "mcpOperationId": "getUsers",
      "description": "Get a list of users",
      "targetPath": "/users",
      "targetMethod": "GET",
      "parameters": [
        {
          "name": "page",
          "in": "query",
          "required": false,
          "type": "integer",
          "description": "Page number"
        }
      ]
    }
  ]
}

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。