DEV Community

Cover image for I built a fully tested Agentic AI system with LangGraph + MCP and open-sourced the whole thing
zkaria gamal
zkaria gamal

Posted on

I built a fully tested Agentic AI system with LangGraph + MCP and open-sourced the whole thing

Most LLM tutorials stop at "here's how to call the OpenAI API."

Mine doesn't.

I just shipped v1.1.0 of Agentic AI Tutorial โ€” a 5-chapter open-source repo that takes you from your first raw API call all the way to a production-style multi-node autonomous agent with a CI pipeline, pytest suite, and MCP server integration.

Here's what's inside and why I built it the way I did.


๐Ÿ—๏ธ The Architecture (Chapter 5)

The final agent uses a LangGraph StateGraph with 4 decoupled nodes:

  • Router โ€” classifies user intent with a cheap, fast LLM call
  • Execute โ€” runs a LangChain ReAct agent bound to a local FastMCP server
  • Summarize โ€” converts raw tool JSON into natural language
  • Conversation โ€” handles chitchat directly, skipping tool execution entirely

Architecture

The MCP server exposes math and email tools over SSE. The agent never touches your credentials directly โ€” it talks to the server, which acts as a secure boundary.


๐Ÿงช Why I Added Tests to an AI Project

Here's the uncomfortable truth about agentic systems: they don't fail loudly. They drift.

Change one node prompt, and suddenly the router misclassifies 20% of requests. No exception thrown. No stack trace. Just wrong output that you may not catch until a user reports it.

So v1.1.0 ships with:

  • A pytest suite that validates each node's logic and MCP tool contracts independently โ€” no live API calls needed
  • A GitHub Actions CI workflow that runs on every push across multiple Python versions
  • A custom conftest.py reporter that gives real-time output with zero buffering lag
pytest Chapter5/SimpleChatAgent/ -v
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“š Full Roadmap (All 5 Chapters)

Chapter Focus
1 LLM fundamentals โ€” OpenAI, Gemini, Ollama, streaming
2 LangChain, LCEL, chains, tool binding
3 Memory, entity tracking, RAG with Chroma/FAISS
4 LangGraph agents โ€” ReAct, Router, Multi-Agent, Human-in-the-Loop
5 Multi-node agent + FastMCP Server + CI/pytest

๐Ÿš€ Get Started in 3 Commands

git clone https://github.com/zkzkGamal/Agentic-AI-Tutorial.git
cd Agentic-AI-Tutorial
pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

Each chapter has its own .env.example. Ollama users can run everything 100% locally, no API keys needed.


If this saves you time or teaches you something new, a โญ on the repo helps others find it.

๐Ÿ‘‰ github.com/zkzkGamal/Agentic-AI-Tutorial

Happy to answer questions in the comments โ€” what agentic patterns are you building?

Top comments (0)