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 pip
pip install fastmcp-http
From source
To build and install the package from source:
- Clone the repository
- Navigate to the project directory
- Install build and twine
python -m pip install build
- Build the package:
python -m build
- Install the package:
pip install dist/fastmcp_http-0.1.0-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.1.tar.gz
(4.6 kB
view details)
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 fastmcp_http-0.1.1.tar.gz.
File metadata
- Download URL: fastmcp_http-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e578858f0162fecea295e0cfefe5565cd4b64176f081981f363ced16ea891280
|
|
| MD5 |
e7318b37cf86f105dda239c790adda16
|
|
| BLAKE2b-256 |
3a5d9fbc4d50f295cea5aad6d8e4c726bb45c4df5581442408ba0cec18cc1a3c
|
File details
Details for the file fastmcp_http-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fastmcp_http-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33f5a49fc4e4ebe013090ae2c77f03a47292bc161148911e11e28a7bfe69434a
|
|
| MD5 |
c44effd260be83634e590f97b505985c
|
|
| BLAKE2b-256 |
9245de645b0b28eb0965b6ca340966f9d1f590987128c539c027a0186929d369
|