Skip to main content

FastMCP services via HTTP.

Project description

FastMCP-HTTP

FastMCP-HTTP is a Python package that provides a HTTP REST client-server solution for MCP. It offers a unified interface for accessing tools, prompts and resources through HTTP endpoints.

Installation

From PyPI

pip install fastmcp-http

From source

To build and install the package from source:

  1. Clone the repository
  2. Navigate to the project directory
  3. Install build and twine
    python -m pip install build
    
  4. Build the package:
    python -m build
    
  5. Install the package:
    pip install dist/fastmcp_http-X.Y.Z-py3-none-any.whl
    

Examples

FastMCPHttpServer

from fastmcp_http.server import FastMCPHttpServer

mcp = FastMCPHttpServer("MyServer", description="My MCP Server")

@mcp.tool()
def my_tool(text: str) -> str:
    return f"Processed: {text}"

if __name__ == "__main__":
    mcp.run_http(register_server=False, port=15151)

FastMCPHttpClient

from fastmcp_http.client import FastMCPHttpClient


def main():
    client = FastMCPHttpClient("http://127.0.0.1:15151")

    tools = client.list_tools()
    print(tools)

    result = client.call_tool("my_tool", {"text": "Hello, World!"})
    print(result)


if __name__ == "__main__":
    main()

Project details


Download files

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

Source Distribution

fastmcp_http-0.1.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

fastmcp_http-0.1.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file fastmcp_http-0.1.3.tar.gz.

File metadata

  • Download URL: fastmcp_http-0.1.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for fastmcp_http-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cc55f42c52ba38027ef3fae2d4dcbd81d47881d4f460ab8382066db050522e19
MD5 e3f48b5d83ea55f28dbd7e0c02ae75b1
BLAKE2b-256 3734bd48eb768220fdc28c6dda2749feaf9210b56102496cb79e3a8d8d6eaebf

See more details on using hashes here.

File details

Details for the file fastmcp_http-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fastmcp_http-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for fastmcp_http-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c3dde077b2b01462dfae14286e381f56629b012522e425dce6f880caa55c2059
MD5 ab14db3e1ce6f7eac7bddf67d7487b48
BLAKE2b-256 43ce0d470fc1f5c4924275ef2dd6837bf4d7f551ffbd31bdfa3d20d77d842db8

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