HTTP-4-MCP configuration tool allows you to easily convert HTTP API to MCP tool without writing code
Project description
๐ HTTP-4-MCP Middleware Server
๐ Introduction
HTTP-4-MCP is a powerful middleware server that magically transforms regular HTTP interfaces into MCP (Model Control Protocol) interfaces. With simple configuration, your HTTP API becomes an MCP tool instantly!
โจ Key Features
- ๐ HTTP to MCP: One-click conversion of HTTP APIs to MCP interfaces
- ๐ JSON Configuration: Simple and intuitive configuration
- ๐ SSE Support: Real-time data streaming
- ๐จ Visual Configuration: Drag-and-drop interface for API configuration
- ๐ฅ Hot Reload: Instant configuration updates without restart
- ๐ Complete Monitoring: Detailed logging and error tracking
- ๐ก๏ธ Secure & Reliable: Built-in error handling and parameter validation
๐จโ๐ป Author Information
๐ธ System Demo
๐ฅ๏ธ Intuitive Visual Configuration Interface
๐ Powerful API Conversion
๐ cURL Import Support
๐ Tool Description
๐ Quick Start
๐ฆ Installation
# 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
๐ฎ Start Service
# 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
๐ฏ Usage Guide
1๏ธโฃ Configure API
Method 1: ๐จ Visual Configuration (Recommended)
- Visit
http://localhost:8002 - Click "Add New Interface"
- Fill in configuration parameters
- Save and apply instantly!
Method 2: ๐ JSON Configuration
{
"tools": [
{
"name": "weather_api",
"description": "Get real-time weather information for a specified city, including temperature, humidity, weather conditions, wind direction, and wind speed.\n \n This tool uses a two-step query process:\n 1. First, get the precise location ID through city name\n 2. Then, query real-time weather data using the location ID\n \n Example usage:\n - Get weather information for \"Beijing\"\n - Get real-time weather conditions for \"Shanghai\"\n - Query temperature and humidity for \"Guangzhou\"\n \n Returns formatted weather information text, including city name, weather conditions, temperature, humidity, wind direction, and wind speed.",
"url": "https://devapi.qweather.com/v7/weather/now",
"method": "GET",
"params": {
"location": {
"type": "string",
"desc": "City name or ID",
"required": true,
"default": "101010100"
},
"key": {
"type": "string",
"desc": "API key",
"required": true,
"default": "05a3e2c04b65416e912088b76a7a487e"
},
"lang": {
"type": "string",
"desc": "Language",
"required": false,
"default": "zh"
},
"unit": {
"type": "string",
"desc": "Unit system",
"required": false,
"default": "m"
}
},
"headers": {
"User-Agent": "weather-app/1.0"
},
"response": {
"code": {
"path": "code",
"desc": "Response status code"
},
"updateTime": {
"path": "updateTime",
"desc": "Data update time"
},
"fxLink": {
"path": "fxLink",
"desc": "Detailed weather information link"
},
"now": {
"path": "now",
"desc": "Real-time weather data object"
},
"now_obsTime": {
"path": "now.obsTime",
"desc": "Actual observation time"
},
"now_temp": {
"path": "now.temp",
"desc": "Current temperature (Celsius)"
},
"now_feelsLike": {
"path": "now.feelsLike",
"desc": "Feels like temperature (Celsius)"
},
"now_icon": {
"path": "now.icon",
"desc": "Weather icon code"
},
"now_text": {
"path": "now.text",
"desc": "Weather phenomenon text description"
},
"now_wind360": {
"path": "now.wind360",
"desc": "Wind direction 360-degree angle"
},
"now_windDir": {
"path": "now.windDir",
"desc": "Wind direction description"
},
"now_windScale": {
"path": "now.windScale",
"desc": "Wind scale"
},
"now_windSpeed": {
"path": "now.windSpeed",
"desc": "Wind speed (km/h)"
},
"now_humidity": {
"path": "now.humidity",
"desc": "Relative humidity percentage"
},
"now_precip": {
"path": "now.precip",
"desc": "Precipitation (mm)"
},
"now_pressure": {
"path": "now.pressure",
"desc": "Atmospheric pressure (hPa)"
},
"now_vis": {
"path": "now.vis",
"desc": "Visibility (km)"
},
"now_cloud": {
"path": "now.cloud",
"desc": "Cloud coverage percentage"
},
"now_dew": {
"path": "now.dew",
"desc": "Dew point temperature (Celsius)"
}
},
"response_mode": "metadata"
}
]
}
2๏ธโฃ Connect to MCP
# SSE connection URL
ws_url = "http://localhost:8000/mcp/sse"
๐ ๏ธ Project Structure
๐ฆ http-for-mcp-server
โฃ ๐ config/ # Configuration files
โฃ ๐ demo/ # Example code
โฃ ๐ static/ # Static resources
โฃ ๐ mcp_server.py # Main server
โฃ ๐ config_ui.py # Configuration UI
โฃ ๐ run.py # Startup script
โ ๐ requirements.txt # Dependencies
๐ Configuration Reference
๐ง Global Configuration
| Configuration | Description | Default |
|---|---|---|
| ๐ host | Server address | "0.0.0.0" |
| ๐ port | Server port | 8000 |
| ๐ debug | Debug mode | false |
| ๐ log_level | Log level | "info" |
๐ Special Features
๐ cURL Import
Paste cURL command directly, automatically generate configuration:
curl -X GET 'https://api.example.com/weather?city=beijing'
๐จ Pixel Art Interface
- ๐ฎ Game-like configuration experience
- ๐ฏ Drag-and-drop parameter setting
- ๐ Real-time request test
- ๐ Automatically generate configuration
๐ค Contribution Guide
- ๐ด Fork this repository
- ๐ง Create feature branch
- ๐ Submit changes
- ๐ Push branch
- ๐ฌ Submit Pull Request
๐ Get Help
- ๐ง Submit Issue
- ๐ฌ Join Discussion Group
- ๐ View Wiki
๐ Open Source License
This project uses the MIT license - see LICENSE file
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_http_4_mcp-1.0.0.tar.gz.
File metadata
- Download URL: iflow_mcp_http_4_mcp-1.0.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ac056461bdcb2675abb0e370a317da228e4e2830e9bc3fc1bb176685be97000
|
|
| MD5 |
1ebac0459a76fbc75441c82a27c6d638
|
|
| BLAKE2b-256 |
c1b1f561776bef6bff3f6dc789469dacab05d240ffbb5fc26a0fb1d0aef92880
|
File details
Details for the file iflow_mcp_http_4_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_http_4_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9c614fae887acf0505af12f9a8d6772c042e41a23d402d78a3fd8594029e13b
|
|
| MD5 |
0647cf653eb3e07a48eb264dbf0dbf91
|
|
| BLAKE2b-256 |
01fac9f9ad4de2cd0465104506d09dbb9506e6cac6496ea10d5d5a90e88e121d
|