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:
- 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-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.4.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.4.tar.gz.
File metadata
- Download URL: fastmcp_http-0.1.4.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 |
f5db289c1208281da23dc634cc95a040cf69113ff70da9f07db3ce27cfc99bf1
|
|
| MD5 |
455049aaf6d9b08eedc0e4bbb409b1b0
|
|
| BLAKE2b-256 |
1cad21dd124158abe85d51036b24ee2b07101bdf790cb2e900840a15a093a3d4
|
File details
Details for the file fastmcp_http-0.1.4-py3-none-any.whl.
File metadata
- Download URL: fastmcp_http-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.5 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 |
7741d440155028e8f58f59b1196829b5fa4ebb72e2413be6280c18d1218e450a
|
|
| MD5 |
5312ea37c79bf5310544bdc1262f9741
|
|
| BLAKE2b-256 |
b447031ba3907b0f16f5f1097ee101fb219038a6c6cac23d06709713a59f7037
|