Show HN: AI-powered web service combining FastAPI, Pydantic-AI, and MCP servers (github.com)

🤖 AI Summary
This open-source demo (from a PyCon tutorial) shows how to build a production-ready AI web service by combining FastAPI (async HTTP API), Pydantic-AI (type-safe, schema-driven agent models and A2A agent-to-agent protocol), and Model Context Protocol (MCP) servers as pluggable tools. The system runs an AgentManager orchestrating General, Entry and Specialist agents that collaborate via Pydantic-AI’s A2A messages to fetch Brave Search and Hacker News results (MCP servers active), optionally analyze GitHub repos and filesystem data (disabled by default), then return ranked trend cards with scores, links and AI-written summaries. Public endpoints include /api/v1/trends, /repositories, /combined-analysis and /assistant; responses indicate routing to chat or trends and include correlation tracking, retries and structured outputs. Significance for AI/ML practitioners: it demonstrates type-safe agent design, schema-driven tool integration, and scalable, sandboxed tool execution via MCPs—patterns useful for reproducible, auditable AI services. Key technical takeaways: Docker/Docker Compose deployment, OpenAI API (required), optional GITHUB_TOKEN and Brave API key, structured scoring algorithms (weighted relevance + quality for web/HN), testability (pytest, mypy), and easy extension by adding MCP servers or creating agents inheriting BaseAgent. The repo includes quick-start scripts, health/status endpoints, observability tips (logs, debug), and concrete examples for integrating custom MCP tools and automating repository analysis.
Loading comments...
loading comments...