Skip to content
/ ag2a Public

AG2A: AutoGen Agent-to-Agent - A library for AutoGen (AG2) agents with MCP capabilities exposed as A2A agents

License

Notifications You must be signed in to change notification settings

niechen/ag2a

Repository files navigation

AG2A: AutoGen Agent-to-Agent

A framework for creating AG2 (formerly AutoGen) agents that communicate using the A2A Protocol and leverage tools via MCP.

Overview

AG2A makes it simple to:

  1. Define agents using JSON specifications
  2. Connect AG2 agents with MCP-powered tools
  3. Expose agents via the standardized A2A protocol
  4. Build multi-agent systems that communicate seamlessly

Installation

# Install from PyPI pip install ag2a # Install with dev dependencies pip install ag2a[dev]

Quick Start

Define an Agent Specification

Create a JSON file with your agent's specification:

{ "name": "MyAssistant", "system_message": "You are a helpful assistant that answers questions concisely.", "model": "gpt-4o", "temperature": 0.7 }

Run the Agent

Start the agent server:

# Export your API key export OPENAI_API_KEY=your-api-key-here # Run the agent with your specification python -m ag2a --spec agent_spec.json --port 8080

Connect to the Agent

The agent now exposes an A2A protocol endpoint at http://localhost:8080. You can connect to it using any A2A-compatible client.

Adding MCP Tools

To use MCP tools, add an mcp_command to your agent spec:

{ "name": "YoutubeAssistant", "system_message": "You can help with analyzing YouTube videos.", "model": "gpt-4o", "mcp_command": "mcp-youtube" }

Using Structured Response Models

For agents that need structured output, you can specify a Pydantic response model:

python -m ag2a --spec agent_spec.json --response-model my_module.ResponseModel

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

AG2A: AutoGen Agent-to-Agent - A library for AutoGen (AG2) agents with MCP capabilities exposed as A2A agents

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages