Content
# AG2A: AutoGen Agent-to-Agent
A framework for creating [AG2](https://github.com/ag2ai/ag2) (formerly AutoGen) agents that communicate using the [A2A Protocol](https://google.github.io/A2A) and leverage tools via [MCP](https://modelcontextprotocol.io/).
## 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
```bash
# 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:
```json
{
"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:
```bash
# 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:
```json
{
"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:
```bash
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.