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
10 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 APIs into MCP tools, enabling seamless integration with MCP-compatible applications.

Installation

Prerequisites

  • Python 3.8 or higher
  • Git

Setup Instructions

Clone the repository:

# 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 Service

Activate the virtual environment:

# On Windows
.venv/Scripts/activate

# On Linux/Mac
source .venv/bin/activate

Start the main server:

uv run run.py

Start the configuration UI (optional):

uv run run_config_ui.py

Usage Guide

Configuring APIs

You can configure HTTP-4-MCP in two ways:

Method 1: Visual Configuration (Recommended)

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

Method 2: JSON Configuration

Create or edit a JSON configuration file with your API details:

{
  "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"
        },
        "updateTime": {
          "path": "updateTime",
          "desc": "Data update time"
        },
        "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, use the SSE (Server-Sent Events) endpoint:

# Example connection URL
sse_url = "http://localhost:8000/mcp/sse"

Special Features

cURL Import

You can easily import API configurations by pasting a cURL command:

  1. Go to the web configuration interface
  2. Click on the cURL import option
  3. Paste your cURL command, for example:
curl -X GET 'https://api.example.com/weather?city=beijing'
  1. The system will automatically generate the configuration

Global Configuration Options

The server can be configured with the following parameters:

  • host: Server address (default: "0.0.0.0")
  • port: Server port (default: 8000)
  • debug: Debug mode (default: false)
  • log_level: Logging level (default: "info")

Getting Help

If you encounter any issues:

  • Submit an issue on the GitHub repository
  • Join the discussion group
  • Consult the project wiki

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