MCP Server Hub#
Currently, our different projects are using various MCP servers. To streamline and unify the process, we plan to implement a HUB MCP server that can handle multiple MCP Servers and reuse components.
- User Interface: User can view MCP servers from
MCP HUB
- MCP Hub: Service that manages multiple MCP servers metadata
- MCP Servers: Different
MCP server
and their metadata automatically register toMCP HUB
graph TD
E[User Interface] --> A[MCP Hub]
A --> B[MCP Server 1];
A --> C[MCP Server 2];
A --> D[MCP Server 3];
A --> e[MCP Server 4];
Implementation#
-
Prerequisites:
fastmcp
fastapi
npx @modelcontextprotocol/inspector
: tool to debug MCP servers.
-
MCP Hub: FastAPI
register
endpoint: Each MCP server will call it to register metadata into this MCP Hubservers
endpoint: list all MCP Servers' detail
- MCP Server: FastMCP and FastAPI
- Create MCP server :
tool
,resources
,prompts
etc. - FastAPI server: Mount MCP server to FastAPI APP
- Create MCP server :
MCP Hub & Server#
Once MCP server start at the background, it will register itself to the MCP hub. The MCP hub is responsible for inquiring about available servers and managing the metadata of these servers.
Next...#
Once MCP Hub is running, we can create a client to interact with the MCP hub and choose a server from the available servers. You can use below frameworks to connect MCP server
langchain
google adk
fastmcp client
- ...