
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
Take our 90+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!
Towards AI has published Building LLMs for Production—our 470+ page guide to mastering LLMs with practical projects and expert insights!

Discover Your Dream AI Career at Towards AI Jobs
Towards AI has built a jobs board tailored specifically to Machine Learning and Data Science Jobs and Skills. Our software searches for live AI jobs each hour, labels and categorises them and makes them easily searchable. Explore over 40,000 live jobs today with Towards AI Jobs!
Note: Content contains the views of the contributing authors and not Towards AI.