mcp-hub

MCP.Pizza Chef: tianyaXs

mcp-hub is a FastAPI-based MCP client framework that acts as a central orchestrator for multiple MCP-compliant tool servers. It connects to these servers via Server-Sent Events (SSE), aggregates their tools, and uses large language models to interpret user queries and invoke the appropriate tools automatically. It supports cluster configurations, health checks, and automatic reconnections to ensure robust and scalable operations.

Unmaintained · No commits in 15 months.

Use This MCP client To

Aggregate tools from multiple MCP-compliant servers for unified access Orchestrate tool invocation based on natural language queries Manage MCP tool servers in a clustered environment Maintain persistent SSE connections with automatic reconnection Perform health checks on connected MCP tool servers Enable LLM-driven workflows across distributed tool servers

README

MCP Client

Introduction

This project is a FastAPI-based application acting as a central client and orchestrator for multiple MCP (Meta Call Protocol) compliant tool servers. It connects to these tool servers via SSE (Server-Sent Events), aggregates their available tools, and leverages a large language model (LLM) to understand user queries and intelligently invoke the appropriate tools. It also includes health checks and an automatic reconnection mechanism to enhance system robustness.

Read this in other languages: [English] [中文]

Main Features

  • MCP Client: Connects to MCP-compliant tool servers via SSE.
  • MCP Service Cluster Configuration: This client service can be configured in a cluster mode to manage multiple tool servers.
  • Tool Aggregation: Automatically discovers and aggregates tools from all connected servers.
  • LLM Integration: Utilizes large language models to understand natural language queries.
  • Tool Invocation: Routes tool execution requests to the correct server based on LLM decisions.
  • Health Checks: Periodically checks the status of connected services via an HTTP /health endpoint.
  • Auto Disconnect & Reconnect: Automatically disconnects unresponsive or timed-out services and periodically attempts to reconnect failed or disconnected ones.
  • API Interface: Provides HTTP APIs for registering new MCP services, sending queries, and checking health.
  • Flexible Configuration: Configured via a pyproject.toml file.

Prerequisites

  • Python 3.10+
  • uv (Recommended Python package installer and virtual environment manager)

Installation & Setup

mcp-hub FAQ

How does mcp-hub connect to MCP tool servers?
It connects via Server-Sent Events (SSE) to maintain real-time communication.
Can mcp-hub manage multiple tool servers simultaneously?
Yes, it supports cluster configurations to orchestrate multiple MCP tool servers.
How does mcp-hub handle tool discovery?
It automatically discovers and aggregates tools from all connected MCP servers.
What role do large language models play in mcp-hub?
LLMs interpret user queries and intelligently invoke the appropriate tools.
Does mcp-hub support fault tolerance?
Yes, it includes health checks and automatic reconnection mechanisms for robustness.
Is mcp-hub limited to a specific LLM provider?
No, it is provider-agnostic and can integrate with models like OpenAI, Claude, and Gemini.
What technology stack is mcp-hub built on?
It is built using FastAPI, a modern Python web framework.
Can mcp-hub be used in production environments?
Yes, its cluster mode and health monitoring features make it suitable for production use.