Skip to main content

Add your description here

Project description

MCP Http Server

📋 Project Overview

MCP Http Server is a Model Context Protocol (MCP) server implemented based on the Python httpx library. It supports HTTP request operations via a REST API, including various methods like GET, POST, PUT, and DELETE, aiming to simplify integration with various Web APIs.

🚀 Quick Start

Dependencies

  • Python 3.x
  • httpx library
  • uv (recommended package manager)

Installation and Startup

Clone the project

git clone https://github.com/one-matrix/mcp-http.git
cd mcp-http-server

Please replace one-matrix with the actual username or project URL.

Install dependencies

Using uv (recommended):

uv pip install .

Or using pip:

pip install .

Start the server

Please add the actual startup command in your project, e.g., python server.py or uv run server.py.

🛠️ Available Tools

This service provides the following core tools for Web API interaction:

1. http_get

  • Description: Executes a GET request to the specified URL.
  • Parameters:
    • url (str): The target URL, e.g., https://api.example.com/data.
    • params (dict, optional): A dictionary of URL query parameters.
  • Returns: Status code (int) and response content (str).

2. http_post

  • Description: Executes a POST request to the specified URL, optionally with a data body.
  • Parameters:
    • url (str): The target URL.
    • params (dict, optional): A dictionary of URL query parameters.
    • body (dict, optional): A dictionary for the JSON request body.
    • headers (dict, optional): Request headers. Defaults to include Content-Type: application/json.
  • Returns: Status code (int) and response content (str).

3. http_put

  • Description: Executes a PUT request to the specified URL, optionally with a data body.
  • Parameters:
    • url (str): The target URL.
    • params (dict, optional): A dictionary of URL query parameters.
    • body (dict, optional): A dictionary for the JSON request body.
    • headers (dict, optional): Request headers. Defaults to include Content-Type: application/json.
  • Returns: Status code (int) and response content (str).

4. http_delete

  • Description: Executes a DELETE request to the specified URL.
  • Parameters:
    • url (str): The target URL.
    • params (dict, optional): A dictionary of URL query parameters.
  • Returns: Status code (int) and response content (str).

The original document described this as a "status code string"; typically, the status code is an integer, and the response content might be empty or a simple confirmation message. This has been adjusted for consistency.

🤝 Integration with Claude Desktop

You can integrate this MCP Http Server with Claude Desktop.

Method 1: Using uv to start

Add the following configuration to your claude_desktop_config.json file:

{
  "mcpServers": {
    "mcp-httpx": {
      "command": "uv",
      "args": [
        "--directory",
        "one-matrix/mcp-http", // Replace with the path to the parent directory of the mcp-http-server project
        "run",
        "server.py" // Replace with the actual server startup script
      ]
    }
  }
}

📜 License

This project is open-sourced under the MIT License. You are free to use, modify, and distribute this software. For specific terms, please refer to the LICENSE file in the project repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_http-0.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file mcp_http-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_http-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for mcp_http-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e537584c385c99485765d9747a283615a789b89a0948d350afc5f3b164695514
MD5 57b4577e7c5622281d70049b4e464b4d
BLAKE2b-256 a7729e1acc7643602c18375944d7657396d0d7ffebd10b5ae754895a9c39e350

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page