- Published on
PyCon Greece 2025: Building AI Agents with MCP, A2A, and FastAPI
- Authors
- Name
- Petros Savvakis
- @PetrosSavvakis
PyCon Greece 2025: Building AI Agents with MCP, A2A, and FastAPI
đ Estimated reading time: 9 minutes
I had the joy of presenting at PyCon Greece for the first time and it was genuinely special. The hallway track, volunteer energy, the spontaneous networking chats at coffee tables⌠the python community is magnificent. Thank you to everyone who attended, asked sharp questions, and shared your stories. It reminded me why OSS and Python thrive.
With that spirit of curiosity in mind, letâs shift gears and talk about LLMs and AI the foundations behind them and then jump into the presentation and code.
The Probabilistic Era of AI (and why it matters)
Dismissal is a common reaction when witnessing AIâs rate of progress. People struggle to reconcile their world model with what AI can now do and how. Weâve crossed from deterministic software (inputs map cleanly to outputs) into a domain where models return distributions over possible outputs. That changes how we build.
Like Gian Segato from Anthropic[1] said(in a really great Article): weâre leaving the classical world of functions F: X â Y
, and entering a "quantum-like regime" where F'
consumes an effectively open-ended input space and returns stochastic outputs. The same prompt can yield different, yet useful, answers. This isnât a bug; itâs the feature that lets users navigate ambiguity.
This state really reminds me of my MSc Degree in Robotics and how we modeled uncertainty in perception and control. We relied on probabilistic methods such as Kalman filters and Model Predictive Control (MPC) to represent knowledge as distributions rather than single points, allowing robots to act coherently in the presence of noisy, incomplete, or ambiguous data. In a parallel way, LLMs maintain probability distributions over potential continuations, enabling them to generate consistent and context-aware outputs under uncertainty, much like control systems reason about uncertain states to guide robust decision-making, but let's not derail ourselves into robotics.
So some practical implications:
- Minimum Viable Intelligence (MVI): Donât over-constrain the model chasing 100% reliability. Keep just enough latitude for emergence, while meeting your marketâs tolerance for unpredictability.
- Empiricism over dogma: Treat model behavior as something to be discovered. When the base model changes, be willing to re-architect prompts, tools, even UX.
- Data as the operating system: You need downstream data loopsâsegmentation, evals, and production telemetry that capture trajectories, not just funnels.
This framing helps explain why agent systems feel powerful: they let us decompose uncertainty across roles, tools, and evidence sources while preserving flexibility.
What I Demoed: MultiâAgent System with MCP + A2A
The repo demonstrates a pragmatic, production-lean architecture where:
Note: This repository is for learning purposes and experimentation only. It is not intended to showcase production grade patterns or strict Python best practices.
- FastAPI serves a simple UI and REST endpoints.
- Entry Agent explores tech trends via MCP-connected tools (Brave Search, Hacker News), summarizes findings, and extracts repos.
- Specialist Agent analyzes detected repos (stars/forks/activity, growth potential) and returns structured insights.
- A2A (agent-to-agent) protocol connects agents for delegation and composition.
- MCP provides a standard way to access external tools and data as capabilities.
(Everything is containerized)
Key endpoints exposed by the service:
GET /health
GET /api/v1/mcp/status
GET /api/v1/agents/status
POST /api/v1/trends
POST /api/v1/repositories
POST /api/v1/combined-analysis
POST /api/v1/chat
System Overview
At a glance, the architecture comprises:
- Agent Manager (
app/services/agent_manager.py
): orchestrates lifecycle, routes requests, monitors health. - Entry Agent (
app/agents/entry_agent.py
): trend analysis, HN + Brave via MCP, general chat; delegates to Specialist. - Specialist Agent (
app/agents/specialist_agent.py
): repo intelligence metrics, correlations, growth assessment. - A2A Service (
app/services/a2a_service.py
): registers agents, handles agent-to-agent messaging and optional ASGI endpoints. - MCP Client Manager (
app/utils/mcp_client.py
): manages MCP connections (Hacker News MCP â , Brave Search MCP â , GitHub MCP â ď¸ fallback, Filesystem MCP â ď¸ disabled by default).
- User â UI â FastAPI â Entry Agent â MCP tools â AI analysis â Response
- Entry Agent â A2A â Specialist Agent â (GitHub API/MCP) â Intelligence report
Architecture diagram:
Why this design
- Decoupled capabilities: MCP abstracts external tools, swap or add servers without rewriting agent logic.
- Composable intelligence: A2A enables targeted delegation and clear boundaries between exploration and deep analysis.
- Operational clarity: Health/status endpoints surface which MCP servers/agents are live.
From Slides to Takeaways
A few highlights from the talk:
- Agent systems benefit from a clear split of concerns: discovery vs. specialization.
- Scoring signals matter: HN recency/points, web relevance/quality, repo health normalize and combine.
- Expect fallbacks: when a tool/server is down, degrade to direct APIs or cached signals.
- Treat prompts and tools as versioned contracts; audit changes like code.
If you want to tinker, start the stack, enable MCP servers you need, and try /api/v1/combined-analysis
with a trend like âfunction calling frameworksâ and see how the pipeline composes signals and insights.
Related Reading
- My protocol deep-dive: MCP vs ACP: AI Protocols for Context and Agent Orchestration
- Repo architecture and README on GitHub:
https://github.com/Aherontas/Pycon_Greece_2025_Presentation_Agents
- Gian Segatoâs article on the probabilistic nature of AI: The Probabilistic Era of AI
Huge thanks to the PyCon Greece organizers, volunteers, speakers, and attendees. You made my first PyCon a warm, inspiring experience. See you next year with this same amazing community. đ
References
- GitHub repo:
Pycon_Greece_2025_Presentation_Agents
https://github.com/Aherontas/Pycon_Greece_2025_Presentation_Agents
- [1] Segato, G. (2024). The Probabilistic Era of AI. Retrieved from https://giansegato.com/essays/probabilistic-era