MCP HubMCP Hub
ARadRareness

mcp-registry

by: ARadRareness

A central registry and HTTP interface for coordinating Model Context Protocol (MCP) servers.

15created 26/12/2024
Visit
registry
HTTP

📌Overview

Purpose: The MCP Registry & FastMCP-HTTP framework aims to streamline the management and interaction of multiple MCP servers through a centralized registry and a unified HTTP client-server solution.

Overview: This repository comprises two main components: MCP Registry, which serves as a coordinating server for multiple MCP servers, enhancing registration, health monitoring, and access to tools; and FastMCP-HTTP, a Python package providing a RESTful client-server interface for seamless interaction with various MCP resources.

Key Features:

  • Centralized MCP Registry: Offers a single point for registering multiple MCP servers, dynamic port allocation, and health monitoring, ensuring organized server management.

  • FastMCPHTTP Client and Server: Facilitates both synchronous and asynchronous communication with MCP servers, providing an intuitive interface for tool access and interaction through HTTP endpoints.


MCP Registry & FastMCP-HTTP

This repository combines two complementary components: MCP Registry and FastMCP-HTTP.

Overview

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 offering an HTTP REST client-server solution for MCP. It provides a unified interface to access tools, prompts, and resources through HTTP endpoints.

Components

HTTP Server

The FastMCPHttpServer provides an HTTP server solution for MCP.

HTTP Client

The FastMCPHttpClient offers 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

  1. Clone the repository
  2. Install 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

  1. Start the MCP Registry (start_registry_server.py)
  2. Start an MCP server (verify it is properly registered in the registry)
  3. Start a client and connect to the registry URL

License

MIT License