You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Complete MCP v2.0 rewrite with real-world examples and enterprise support
- Rebuilt MCP implementation from scratch following JSON-RPC 2.0 specification
- Added transport abstraction layer supporting stdio and SSE transports
- Created production-ready Zerodha Kite MCP integration example (no mocks)
- Implemented proper MCP initialization handshake and error handling
- Added comprehensive README section documenting MCP v2.0 improvements
- Fixed RegistryAgent initialization bug in discovery module
- Enhanced FastMCPAgent with multi-server support and async operations
- Added real portfolio analysis and trading assistant capabilities
- Maintained backward compatibility with migration guide
- Removed all mock data in favor of actual MCP server integrations
-**Agent Flow UI**: Visual workflow editor for building and managing agent networks with drag-and-drop interface
33
37
-**Agent Discovery**: Built-in support for agent registry and discovery with full Google A2A protocol compatibility
34
38
-**LangChain Integration**: Seamless integration with LangChain's tools and agents
@@ -780,15 +784,193 @@ Python A2A can be used to build a wide range of AI systems:
780
784
-**Educational Workflows**: Design step-by-step learning processes with feedback loops
781
785
-**Visual Learning**: Use the Agent Flow UI to teach agent concepts through interactive visualization
782
786
787
+
## 🔌 Enhanced MCP (Model Context Protocol) Support
788
+
789
+
Python A2A features a completely redesigned MCP implementation that provides robust, production-ready integration with MCP servers and tools. Our MCP support has been rebuilt from the ground up to follow the official JSON-RPC 2.0 specification.
790
+
791
+
### 🚀 What's New in MCP v2.0
792
+
793
+
-**Proper JSON-RPC 2.0 Implementation**: Complete rewrite to follow the official MCP specification
794
+
-**Transport Abstraction**: Support for both stdio and Server-Sent Events (SSE) transports
795
+
-**Backward Compatibility**: Seamless migration from previous MCP implementations
796
+
-**Real-World Examples**: Production-ready examples with actual services (no mocks!)
797
+
-**Enterprise Integration**: Support for external MCP servers like Zerodha Kite MCP
798
+
799
+
### 🏗️ Architecture Overview
800
+
801
+
```python
802
+
from python_a2a.mcp import MCPClient, FastMCPAgent
803
+
804
+
# The new MCPClient follows JSON-RPC 2.0 specification
805
+
client = MCPClient(
806
+
url="https://mcp-server.example.com/sse", # SSE transport
807
+
transport="sse"
808
+
)
809
+
810
+
# Or use stdio transport for local servers
811
+
client = MCPClient(
812
+
command=["python", "local_mcp_server.py"],
813
+
transport="stdio"
814
+
)
815
+
816
+
# FastMCPAgent provides easy integration with A2A agents
Copy file name to clipboardExpand all lines: docs/guides/mcp.rst
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,46 @@ The Model Context Protocol (MCP) is a standardized way for AI agents to access e
14
14
15
15
Python A2A provides comprehensive support for MCP through the ``FastMCP`` implementation and the ``A2AMCPAgent`` class.
16
16
17
+
Key Feature: Easy MCP Attachment
18
+
-------------------------------
19
+
20
+
**One of the unique features of python-a2a is the ability to easily attach any MCP server to agents**, giving them instant access to tools and capabilities. This works with:
21
+
22
+
- Remote MCP servers (via SSE/HTTP transport)
23
+
- Local MCP servers (via stdio transport)
24
+
- FastMCP servers (in-process Python tools)
25
+
- Any standard MCP-compliant server
26
+
27
+
Quick Example
28
+
~~~~~~~~~~~~
29
+
30
+
.. code-block:: python
31
+
32
+
from python_a2a.mcp import A2AMCPAgent
33
+
34
+
# Create an agent with multiple MCP servers attached
35
+
agent = A2AMCPAgent(
36
+
name="Super Assistant",
37
+
description="An AI assistant with many tools",
38
+
mcp_servers={
39
+
# Remote MCP server (SSE transport)
40
+
"weather": "https://weather-mcp.example.com",
41
+
42
+
# Local command-based MCP server (stdio transport)
0 commit comments