通过观察HTTP API流量,自动生成MCP(模型上下文协议)服务器。
概览
通过观察HTTP API流量,自动生成MCP(模型上下文协议)服务器。 mcpify 监控 HTTP 请求到你的服务器,并自动为每个发现的端点创建 MCP 工具。AI 助手随后可以调用这些工具与你的 API 交互。 1. 启动您的 API 服务器(例如,在 localhost:3000)2.运行 mcpify 以观察流量: 3. 调用你的服务器的 API(使用你的应用、curl、Postman 等)。4. 每个唯一端点在 http://localhost:8081/mcp 作为 MCP 工具可用。 mcpify 会自动保存发现的工具和配置: - : ~/.config/mcpify/config.json- : ~/库/应用支持/mcpify/config.json 发现的工具会在重启后持续存在。如果你运行mcpify而不带--target,它会使用最后观察到的服务器。 mcpify 现在可以自动将相关的 API 端点分组到逻辑工具组中。
概述(AI 翻译)
通过观察HTTP API流量,自动生成MCP(模型上下文协议)服务器。
演示
它的作用
mcpify 监控 HTTP 请求到你的服务器,并自动为每个发现的端点创建 MCP 工具。AI 助手随后可以调用这些工具与你的 API 交互。
安装
快速启动
-
启动您的 API 服务器(例如,在 localhost:3000 上)
-
运行 mcpify 以观察流量:
-
调用你的服务器的 API 调用(使用你的应用、curl、Postman 等)。
-
每个唯一端点在[[T0]处作为MCP工具可用。
持久配置
mcpify 会自动保存发现的工具和配置:
- Linux:
~/.config/mcpify/config.json - macOS:
~/Library/Application Support/mcpify/config.json
发现的工具会在重启后持续存在。如果你运行mcpify而不使用--target,它会使用最后观察到的服务器。
分组功能
mcpify 现在可以自动将相关的 API 端点分组为逻辑工具组。这使 AI 助手更容易理解和交互,通过按资源或功能组织端点(例如,所有 /users 端点被分组)。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
mcpify
Automatically generate MCP (Model Context Protocol) servers by observing HTTP API traffic.
Demo
What it does
mcpify watches HTTP requests to your server and automatically creates MCP tools for each discovered endpoint. AI assistants can then call these tools to interact with your APIs.
Installation
brew tap nilayyadav/mcpify
brew install mcpify
Quick Start
- Start your API server (e.g., on localhost:3000)
- Run mcpify to observe traffic:
sudo mcpify --target http://localhost:3000
- Make API calls to your server (using your app, curl, Postman, etc.)
- Each unique endpoint becomes available as an MCP tool at
http://localhost:8081/mcp
Persistent Configuration
mcpify automatically saves discovered tools and configuration:
- Linux:
~/.config/mcpify/config.json - macOS:
~/Library/Application Support/mcpify/config.json
Discovered tools persist across restarts. If you run mcpify without --target, it will use the last observed server.
# First run - discovers and saves tools
sudo mcpify --target http://localhost:3000
# Later runs - automatically uses saved target and loads existing tools
sudo mcpify
Grouping Feature
mcpify can now automatically group related API endpoints into logical tool groups. This makes it easier for AI assistants to understand and interact with your API by organizing endpoints by resource or functionality (e.g., all /users endpoints are grouped together).
How Grouping Works
- Endpoints are analyzed and grouped based on URL patterns and HTTP methods.
- Each group is exposed as a collection of related tools in the MCP server.
- Grouping improves discoverability and usability for large APIs.
Grouping is enabled by default. You can control grouping behavior with the following command line flag:
sudo mcpify --target http://localhost:3000 --grouping
Grouped tools are available at http://localhost:8081/mcp as usual, but now organized by group.
Configuration
Environment Variables
export LLM="openai/gpt-oss-120b:together"
export LLM_ENDPOINT="https://router.huggingface.co/v1"
export LLM_API_KEY="HF_TOKEN"
Command Line Options
sudo -E mcpify --target http://localhost:3000 \
--max-tools 100 \
--use-llm \
--verbose
| Flag | Description | Default |
|---|---|---|
--target |
Target server URL to observe (uses saved target if omitted) | - |
--mcp-port |
MCP server port | 8081 |
--mcp-name |
Name of the MCP server | mcpify |
--max-tools |
Maximum number of tools to capture | 100 |
--use-llm |
Enable LLM for tool name generation | false |
--verbose |
Enable verbose logging | false |
--grouping |
Enable grouping of related API endpoints | true |
Requirements
- macOS or Linux
- Root/sudo privileges (for packet capture)
- Target server running on HTTP (not HTTPS)
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →