
AI Engineer’s Handbook to MCP Architecture
Last Updated on April 28, 2025 by Editorial Team
Author(s): Vatsal Saglani
Originally published on Towards AI.
Part 2: Building the Servers First
In the previous blog, we laid out our nano-MCP architecture and built a mental model of the entire system containing the LLM Host, an MCP Client, and tiny focused MCP Servers. In this blog, we’ll build those servers first, so no LLMs yet, just pure FastAPI, Pydantic, and Docker Compose.
We’ll:
Create a File Management Server exposing four tools: create_file, read_file, update_file, and show_folder_tree.Develop a Run Command Server exposing a single run_command tool.Integrate them together with a shared Docker volume, so files you create in one show up in the other.Dive into FastAPI route definitions, Pydantic request models, and a docker-compose-yml that makes it all local-dev friendly.
Code comes to life at the edges. When we talk about MCP, the servers represent those edges, the actual muscle that executes commands manages files, and does the real work. The model thinks, the client routes, but without servers, nothing happens in the real world.
Hence, we build those edges first. We will create the two specialized servers as mentioned above. Both expose their capability as well-defined tools, ready to be discovered by our MCP Client hub.
Along the way, we’ll learn the basics of idempotent API design, schema-driven validation with… Read the full blog for free on Medium.
Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.
Published via Towards AI