PA

ptzagk/a2a_adk_mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 15 forks 质量 52 趋势 0Apache-2.0

Multi-Agent Systems with Google's Agent Development Kit + A2A + MCP

概览

This project implements a security-focused data processing pipeline using the Agent-to-Agent (A2A) protocol combined with Model Context Protocol (MCP) integration. The system provides secure database queries through a multi-agent architecture. The system utilizes a layered architecture: 1. : Provides standardized communication between clients and agent services 2. : Manages agent behavior and tool integration 3. : Provides specialized SQL and data processing tools - : Handle client requests and agent communication - : Process natural language requests using specialized tools - : Provides SQL query and database interaction tools - : Coordinate task execution across agents The system implements a security pipeline with three specialized agents: 1. : Evaluates input for security threats (SQL injection, XSS, etc.) 2. : Performs database queries and analysis using MCP tools 3.

README

以下为原文 README 节选,完整内容请查看原文。

Agent-to-Agent (A2A) Security Pipeline with MCP Integration

This project implements a security-focused data processing pipeline using the Agent-to-Agent (A2A) protocol combined with Model Context Protocol (MCP) integration. The system provides secure database queries through a multi-agent architecture.

System Architecture

The system utilizes a layered architecture:

  1. A2A Protocol Layer: Provides standardized communication between clients and agent services
  2. ADK Framework Layer: Manages agent behavior and tool integration
  3. MCP Server Layer: Provides specialized SQL and data processing tools

Components

  • A2A Servers: Handle client requests and agent communication
  • ADK Agents: Process natural language requests using specialized tools
  • MCP Server: Provides SQL query and database interaction tools
  • Task Managers: Coordinate task execution across agents

Agent Pipeline

The system implements a security pipeline with three specialized agents:

  1. Judge Agent: Evaluates input for security threats (SQL injection, XSS, etc.)
  2. SQL Agent: Performs database queries and analysis using MCP tools
  3. Mask Agent: Applies privacy protection to sensitive data in results

Flow Diagram

Client Request → A2A Server → Judge Agent → SQL Agent → Mask Agent → Client Response

Key Features

  • Security Threat Detection: Identifies and blocks malicious inputs via tool and Model Armor
  • SQL Query Analysis: Processes database queries using natural language
  • PII Data Protection: Masks personally identifiable information in results using DLP
  • A2A Protocol Compliance: Implements standardized agent communication
  • MCP Integration: Leverages Model Context Protocol tools for enhanced capabilities

Installation

Prerequisites

  • Python 3.8+
  • aiohttp
  • FastAPI
  • Google ADK
  • Google Generative AI packages
  • uvicorn

Setup

  1. Clone the repository
  2. Install dependencies: pip install -r requirements.txt
  3. Configure API keys in environment variables (even better, use secret manager)
  4. Have fun

Usage

Starting the Servers

Run the adk web script to run the chat interface:

adk web

This will start:

  • Judge Server (port 10002)
  • Mask Server (port 10003)
  • SQL Server (port 10004)
  • MCP Server

Making Requests

Run the query_MCP_ADK_A2A.py script to query the multi-agent system:

python ./clients/query_MCP_ADK_A2A.py

This will use the a2a_client.py module to make requests to the pipeline:

Core Files

  • a2a_client.py: Client for A2A communication
  • a2a_servers.py: Server implementations for A2A protocol
  • query_MCP_ADK_A2A.py: Main pipeline implementation
  • run_servers.py: Server startup and coordination
  • server_mcp.py: MCP server implementation
  • task_manager.py: Task coordination for agent communication
  • mcp_agent.py: Integration between ADK and MCP

MCP Integration

在 GitHub 查看完整 README

安装

docker run -p 8000:8000 -e GOOGLE_API_KEY=your_api_key adk-multi-agent adk web
新手?先看 mcpskill.org 教程 →