I’m trying to build a multi-agent system using MCP with a hierarchical architecture.
Is it possible to run one MCP host as a server (or coordinator) that other MCP hosts can connect to and interact with?
If so, what would be a recommended way to structure this—via RPC, message queues, or some built-in MCP mechanism?
Any architectural tips or examples would be appreciated.
2 Likes
It seems that MCP itself is designed to be able to handle multiple servers. For communication, it would probably be easier to maintain if the functions within the library were completed as much as possible.
"""
Example demonstrating how to use MCPClient with multiple servers.
This example shows how to:
1. Configure multiple MCP servers
2. Create and manage sessions for each server
3. Use tools from different servers in a single agent
"""
import asyncio
from dotenv import load_dotenv
from langchain_anthropic import ChatAnthropic
from mcp_use import MCPAgent, MCPClient
async def run_multi_server_example():
"""Run an example using multiple MCP servers."""
# Load environment variables
This file has been truncated. show original
A middleware server that enables multiple isolated instances of the same MCP servers to coexist independently with unique namespaces and configurations.
TL;DR: Build a custom MCP server to connect LLMs like Claude to ClickUp for automated task management. Learn how to set up, and integrate APIs, define tools, and deploy, enabling AI to retrieve and create ClickUp tasks.What is MCP and why is it...