✨ feat: Generic Tool-Calling A2A Agent#93
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new Generic Agent implementation that integrates with the A2A (Agent-to-Agent) protocol, supporting multiple MCP (Model Context Protocol) servers for dynamic tool loading and LLM-based task orchestration.
- Implements a flexible agent that connects to one or more MCP servers to provide various capabilities
- Uses LangGraph for orchestration and supports streaming responses via the A2A protocol
- Includes configuration management, tracing setup, and comprehensive error handling
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
graph.py |
Implements LangGraph workflow with MCP client integration and tool binding |
config.py |
Defines Pydantic configuration settings for LLM, MCP, and agent parameters |
agent.py |
Implements A2A agent executor with event handling and graph execution logic |
__init__.py |
Sets up OpenTelemetry tracing for observability |
pyproject.toml |
Specifies project dependencies and build configuration |
README.md |
Provides documentation for features, configuration, and usage |
Dockerfile |
Defines container image for deployment |
.dockerignore |
Excludes virtual environment from Docker context |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Looks great. Can you include the instructions to run in that are in the PR into the agent's README? |
|
Thank you, the environmental variables needed and Kagenti deployment instructions are in the README! I'm still working through some of the feedback, should be ready by EOD tomorrow. |
|
Perfect. I was able to connect this to both the Flight MCP tool and the weather tool at the same time and it worked interchangeably. This will be super useful for testing and demonstration, including testing the MCP gateway. Thank you! I'll check back when you are completed with the updates! |
132b950 to
429228b
Compare
Signed-off-by: Peter Zhao <peterzhao080@gmail.com>
429228b to
5a81565
Compare
|
Thank you, glad to hear that you were able to run it successfully! I made some updates, should be all set and let me know of any feedback you have. |
Summary
Created a new generic tool-calling LangGraph agent that can connect to multiple MCP servers and choose the proper tools to fulfill user requests. The agent is tool and LLM agnostic and works with any OpenAI-compatible API.
Features
Configuration
The agent is configured via environment variables:
Usage Example
Once deployed, the agent can handle requests like:
The agent automatically selects the appropriate tool from connected MCP servers and returns formatted results. It will also be compatible with the future MCP Gateway's single unified MCP endpoint.
Screenshots
Related issue(s)
Works with MCP servers implemented in #90, #91
Fixes #86