
一个用于协调模型上下文协议(MCP)服务器的中央注册表和HTTP接口。
概览
该仓库由两个互补组成部分组成。 MCP 注册表是一种服务器解决方案,用于管理和协调多个 MCP(模型上下文协议)服务器。它提供:- MCP 服务器的中央注册 - 动态端口分配 - 注册服务器的健康监测 - 跨所有注册服务器统一访问工具 FastMCP-HTTP 是一个 Python 包,提供 HTTP REST 客户端-服务器解决方案。它提供了一个统一的界面,通过 HTTP 端点访问工具、提示符和资源。 FastMCPHttpServer 为 MCP 提供了 HTTP 服务器解决方案。 FastMCPHttp客户端提供同步和异步接口,用于与FastMCP服务器交互。它也被扩展为作为MCP注册服务器的客户端。 MCP 注册表服务器作为多个 MCP 服务器的中央协调器。它负责服务器注册、健康监测,并提供统一界面以访问所有连接服务器间的工具。
概述(AI 翻译)
该仓库由两个互补组成部分组成。
MCP 注册表是一种服务器解决方案,管理和协调多个 MCP(模型上下文协议)服务器。它提供:
- MCP服务器的中央注册
- 动态端口分配
- 注册服务器的健康监测
- 跨所有注册服务器统一访问工具
FastMCP-HTTP 是一个 Python 包,提供 HTTP REST 客户端-服务器解决方案。它提供了一个统一的界面,通过 HTTP 端点访问工具、提示符和资源。
组成部分
HTTP 服务器
FastMCPHttpServer 为 MCP 提供了 HTTP 服务器解决方案。
HTTP 客户端
FastMCPHttp客户端提供同步和异步接口,用于与FastMCP服务器交互。 它被扩展为也可以作为MCP注册表服务器的客户端。
注册表服务器
MCP 注册表服务器作为多个 MCP 服务器的中央协调器。它负责服务器注册、健康监测,并提供统一界面以访问所有连接服务器间的工具。
MCP探险者
MCP 资源管理器提供了图形用户界面,用于与 MCP 服务器及其工具交互。
安装
本页由 AI 翻译,技术细节请以原文为准。
README
MCP Registry & FastMCP-HTTP
This repository is a combination of two complementary components.
MCP Registry is a server solution that manages and coordinates multiple MCP (Model Context Protocol) servers. It provides:
- Central registration for MCP servers
- Dynamic port allocation
- Health monitoring of registered servers
- Unified access to tools across all registered servers
FastMCP-HTTP is a Python package that provides an HTTP REST client-server solution for MCP. It offers a unified interface for accessing tools, prompts and resources through HTTP endpoints.
Components
HTTP Server
The FastMCPHttpServer provides an HTTP server solution for MCP.
HTTP Client
The FastMCPHttpClient offers both synchronous and asynchronous interfaces to interact with FastMCP servers. It is extended to also function as a client to the MCP registry server.
Registry Server
The MCP Registry Server acts as a central coordinator for multiple MCP servers. It handles server registration, health monitoring, and provides a unified interface to access tools across all connected servers.
MCP Explorer
The MCP Explorer provides a graphical user interface for interacting with MCP servers and their tools.
Installation
- Clone the repository
- Install the dependencies:
pip install -r requirements.txt
Examples
Using the registry server
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()
FastMCPHttpClient
from fastmcp_http.client import FastMCPHttpClient
def main():
# Connect to the registry server
client = FastMCPHttpClient("http://127.0.0.1:31337")
servers = client.list_servers()
print(servers)
tools = client.list_tools()
print(tools)
result = client.call_tool("my_tool", {"text": "Hello, World!"})
print(result)
if __name__ == "__main__":
main()
Standalone
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()
Usage
- Start the MCP Registry (start_registry_server.py)
- Start an MCP server (and verify that it is properly registered in the registry)
- Start a client and connect to the registry url
License
MIT License
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →