🚀 HTTP-4-MCP Middleware Server

🚀 HTTP-4-MCP Middleware Server

site icon
2025.03.31 6
JavaScriptAPI转换中间件服务开发效率
HTTP-4-MCP 是一个强大的中间件服务器,能够将常规的 HTTP 接口转换为 MCP(Model Control Protocol)接口。通过简单的配置,您的 HTTP API 可以立即成为 MCP 工具。它支持实时数据流、可视化配置、热重载等功能,适用于需要快速转换和扩展 HTTP API 的场景。
View on GitHub

Overview

🌟 基本能力

产品定位

HTTP-4-MCP 是一个中间件服务器,专注于将 HTTP 接口转换为 MCP 接口,提供快速、灵活的 API 转换和扩展能力。

核心功能

  • 🔄 HTTP to MCP: 一键将 HTTP API 转换为 MCP 接口
  • 📝 JSON Configuration: 简单直观的配置方式
  • 🌊 SSE Support: 支持实时数据流
  • 🎨 Visual Configuration: 拖拽式界面配置 API
  • 🔥 Hot Reload: 即时更新配置无需重启
  • 📊 Complete Monitoring: 详细的日志和错误跟踪
  • 🛡️ Secure & Reliable: 内置错误处理和参数验证

适用场景

  • 需要将现有 HTTP API 快速转换为 MCP 接口的场景
  • 需要实时数据流的应用
  • 需要灵活配置和快速迭代的 API 开发

工具列表

  • Visual Configuration Interface: 提供拖拽式界面配置 API
  • cURL Import Support: 支持直接粘贴 cURL 命令生成配置
  • Real-time Request Test: 实时测试请求和响应

常见问题解答

  • 如何启动服务? 使用 uv run run.py 启动主服务器,uv run run_config_ui.py 启动配置 UI。
  • 如何配置 API? 可以通过可视化界面或 JSON 配置文件进行配置。

🚀 使用教程

使用依赖

# Clone repository
git clone https://gitee.com/tght1211/http-for-mcp-server.git
# or git clone https://github.com/tght1211/http-for-mcp-server.git

cd http-for-mcp-server

# Install dependencies (recommended using uv package manager)
uv venv
uv pip install -r requirements.txt

安装教程

# Activate virtual environment
.venv/Scripts/activate  # Windows
source .venv/bin/activate  # Linux/Mac

# Start main server
uv run run.py

# Start configuration UI (optional)
uv run run_config_ui.py

调试方式

  1. 访问 http://localhost:8002 使用可视化界面配置 API。
  2. 使用 uv run run.py 启动服务后,可以通过日志查看运行状态和错误信息。
  3. 实时测试请求和响应,确保配置正确。

许可证

该项目遵循 MulanPSL-2.0 开源许可条款,请参阅 MulanPSL-2.0 了解完整条款。