HTTP Bridge MCP server

Middleware server that enables secure interaction with HTTP APIs through a configurable bridge, allowing dynamic integration with external web services without requiring direct HTTP access.
Back to servers
Setup instructions
Provider
Tght1211
Release date
Mar 31, 2025
Language
Python
Stats
12 stars

HTTP-4-MCP is a powerful middleware server that transforms regular HTTP interfaces into MCP (Model Control Protocol) interfaces. With simple configuration, you can instantly convert your HTTP API into an MCP tool without complex implementation work.

Installation

To install and set up the HTTP-4-MCP middleware server:

# 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

Starting the Server

After installation, you need to start both the main server and optionally the configuration UI:

# 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

Configuration Options

You can configure your HTTP APIs to be exposed as MCP interfaces using two methods:

Visual Configuration (Recommended)

  1. Visit http://localhost:8002 in your web browser
  2. Click "Add New Interface"
  3. Fill in the configuration parameters
  4. Save and apply your changes instantly

JSON Configuration

You can also configure your APIs by editing a JSON configuration file:

{
  "tools": [
      {
          "name": "weather_api",
          "description": "Get real-time weather information for a specified city, including temperature, humidity, weather conditions, 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"
              },
              "now_temp": {
                  "path": "now.temp",
                  "desc": "Current temperature (Celsius)"
              },
              "now_text": {
                  "path": "now.text",
                  "desc": "Weather phenomenon text description"
              }
          },
          "response_mode": "metadata"
      }
  ]
}

Connecting to MCP

To connect to the MCP server using Server-Sent Events (SSE):

# SSE connection URL
ws_url = "http://localhost:8000/mcp/sse"

Special Features

cURL Import

The system supports direct pasting of cURL commands to automatically generate configurations:

curl -X GET 'https://api.example.com/weather?city=beijing'

Global Configuration Options

Configuration Description Default
host Server address "0.0.0.0"
port Server port 8000
debug Debug mode false
log_level Log level "info"

Key Features

  • HTTP to MCP Conversion: 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

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "http-4-mcp" '{"command":"python","args":["run.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "http-4-mcp": {
            "command": "python",
            "args": [
                "run.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "http-4-mcp": {
            "command": "python",
            "args": [
                "run.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later