How rubenszimbres/a2a_adk_mcp works
Project Type and Purpose
• This is a multi-agent, security-focused data processing pipeline built on the Agent-to-Agent (A2A) protocol with Model Context Protocol (MCP) integration.
• Purpose: accept client queries, run them through a security pipeline (threat detection, SQL execution, PII masking), and return sanitized results.
File Structure
Top-Level Directories and Files:
• agents/ – ADK agent definitions and eval sets
• clients/ – A2A client code and query script
• servers/ – A2A server implementations, MCP server, task manager
• data/ – Sample dataset (CSV) and SQLite DB
• evaluation/ – Security test scenarios and scoring scripts
• examples/ – Tutorial notebook
• utilities/ – Shared types and helper functions
• main.py, readme.md, requirements.txt, salaries.db
Architectural Clues:
– servers run multiple A2A endpoints (Judge, SQL, Mask, MCP)
– agents implement business logic for each pipeline stage
– MCP server provides specialized SQL tools
– evaluation folder contains automated tests for security and correctness
README for Additional Insights
– Layers: A2A Protocol → ADK Framework → MCP Server
– Core components: A2A Servers, ADK Agents (Judge, SQL, Mask), MCP Server, Task Manager
– Pipeline flow:
Client Request → A2A Server → Judge Agent → SQL Agent → Mask Agent → Client Response
– Key technologies: Python 3.8+, aiohttp, FastAPI, Google ADK, Uvicorn, SQLite, MCP
a. Clients:
• a2a_client.py / query_MCP_ADK_A2A.py – initiates pipeline requests
b. A2A Server Layer:
• run_servers.py / a2a_servers.py – host endpoints for each agent
• server_mcp.py – MCP tool provider
• task_manager.py – orchestrates cross-agent calls
c. Agents (ADK Layer):
• mcp_agent.py – wraps MCP tools for SQL
• agent.py, mcp_agent and mcp eval sets – implement Judge, SQL, Mask logic
d. Database & Data Stores:
• salaries.db – underlying data source
• Updated_Salaries_Data.csv – seed data
e. External Services:
• Model Armor API (threat detection)
• Google Generative AI (LLM models)
• (Optional) Cloud secret manager or env files
Relationships and Data Flow
– Client → A2A Server (HTTP/gRPC)
– A2A Server → Task Manager
– Task Manager sequences: Judge Agent → SQL Agent (via MCP Server & DB) → Mask Agent
– Mask Agent → A2A Server → Client
– MCP Server ↔ SQL Agent communicates over stdio or local socket
– Agents call external APIs (LLM, Model Armor) as side channels
Architectural Patterns and Principles
– Layered architecture: client, API/server, agent business logic, data store
– Pipeline/middleware pattern: sequential processing steps
– Micro-service style: each agent and MCP server runs in its own process
– Dependency inversion: Task Manager abstracts agent interactions
– Security by design: input validation (Judge), controlled DB access (SQL), DLP (Mask)
Relevant Technologies and Frameworks
– Python, FastAPI / aiohttp, Uvicorn
– Google ADK for agent creation
– MCP for SQL tool integration
– SQLite for data persistence
– JSON for configuration and test scenarios