Understanding MCP Architecture: Single-Server vs Multi-Server Cl…
@commitbyrajat
About Understanding MCP Architecture: Single-Server vs Multi-Server Cl…
MCP architecture demo with single-server & multi-server clients using LangGraph, AI-driven tool calls, and async communication.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"langgraph-mcp-integration": {
"command": "python",
"args": [
"server/weather_server.py"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is Understanding MCP Architecture: Single-Server vs Multi-Server Clients?
This blog post explains the Multi-Client Protocol (MCP) architecture by comparing single-server and multi-server clients. It provides example MCP servers for math operations and weather information, along with client scripts that use LangGraph’s ReAct agent and GPT‑4o to invoke tools. It is intended for developers building AI‑driven applications that need to interact with multiple external services.
How to use Understanding MCP Architecture: Single-Server vs Multi-Server Clients?
Clone the repository, sync dependencies with rye sync, start the weather server (rye run python server/weather_server.py), then run either rye run python client/single_server_client.py or rye run python client/multi_server_client.py. The blog shows how to define MCP servers using FastMCP and clients using MultiServerMCPClient with stdio and SSE transports.
Key features of Understanding MCP Architecture: Single-Server vs Multi-Server Clients
- Example Math server with
addandmultiplytools - Example Weather server with a
get_weathertool - Single‑server client using stdio transport
- Multi‑server client supporting both stdio and SSE transports
- Integration with LangGraph ReAct agent and GPT‑4o model
- Sequence diagram illustrating the full MCP communication flow
Use cases of Understanding MCP Architecture: Single-Server vs Multi-Server Clients
- Solving a mathematical expression by invoking a remote math server
- Querying current weather from a dedicated weather server
- Running both math and weather queries concurrently through a multi‑server client
FAQ from Understanding MCP Architecture: Single-Server vs Multi-Server Clients
What transports do the example servers use?
The Math server runs with stdio transport; the Weather server runs with SSE (Server‑Sent Events) transport.
How do I start the servers?
Run python server/math_server.py (uses stdio) and python server/weather_server.py (uses SSE). The blog shows starting the weather server in the background with &.
What tools are available on the example servers?
The Math server exposes add(a, b) and multiply(a, b). The Weather server exposes get_weather(location) which returns a hardcoded sunny string.
What dependencies are required?
The repository uses rye for dependency management. You must run rye sync before executing the scripts. The code also relies on mcp, langgraph, and other Python packages.
Can I use the multi‑server client with other MCP servers?
Yes. The MultiServerMCPClient dictionary accepts any number of server configurations with command/args (for stdio) or url (for SSE) and transport. This allows connecting to arbitrary MCP servers.
Frequently asked questions
What transports do the example servers use?
The Math server runs with `stdio` transport; the Weather server runs with `SSE` (Server‑Sent Events) transport.
How do I start the servers?
Run `python server/math_server.py` (uses stdio) and `python server/weather_server.py` (uses SSE). The blog shows starting the weather server in the background with `&`.
What tools are available on the example servers?
The Math server exposes `add(a, b)` and `multiply(a, b)`. The Weather server exposes `get_weather(location)` which returns a hardcoded sunny string.
What dependencies are required?
The repository uses `rye` for dependency management. You must run `rye sync` before executing the scripts. The code also relies on `mcp`, `langgraph`, and other Python packages.
Can I use the multi‑server client with other MCP servers?
Yes. The `MultiServerMCPClient` dictionary accepts any number of server configurations with `command`/`args` (for stdio) or `url` (for SSE) and `transport`. This allows connecting to arbitrary MCP servers.
Basic information
More Reasoning MCP servers
Agentic Radar
splx-aiA security scanner for your LLM agentic workflows
Deno Sandbox MCP Server
bewt85An MCP server that allows you to run TypeScript, JavaScript, and Python code in a sandbox on your local machine using the Deno® sandbox. This server provides a controlled environment for executing code with explicit permission controls.
Sandbox Mcp
pottekkatA Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
Task Planner MCP Server
CaptainCrouton89An MCP (Model Context Protocol) server that helps AI assistants (like Claude) break down complex tasks into manageable steps, track progress, and manage a hierarchical task list.
End-to-End Agentic AI Automation Lab
MDalamin5This repository contains hands-on projects, code examples, and deployment workflows. Explore multi-agent systems, LangChain, LangGraph, AutoGen, CrewAI, RAG, MCP, automation with n8n, and scalable agent deployment using Docker, AWS, and BentoML.
Comments