agent-mcp 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent_mcp/__init__.py +66 -12
- agent_mcp/a2a_protocol.py +316 -0
- agent_mcp/agent_lightning_library.py +214 -0
- agent_mcp/camel_mcp_adapter.py +521 -0
- agent_mcp/claude_mcp_adapter.py +195 -0
- agent_mcp/cli.py +47 -0
- agent_mcp/google_ai_mcp_adapter.py +183 -0
- agent_mcp/heterogeneous_group_chat.py +412 -38
- agent_mcp/langchain_mcp_adapter.py +176 -43
- agent_mcp/llamaindex_mcp_adapter.py +410 -0
- agent_mcp/mcp_agent.py +26 -0
- agent_mcp/mcp_transport.py +11 -5
- agent_mcp/microsoft_agent_framework.py +591 -0
- agent_mcp/missing_frameworks.py +435 -0
- agent_mcp/openapi_protocol.py +616 -0
- agent_mcp/payments.py +804 -0
- agent_mcp/pydantic_ai_mcp_adapter.py +628 -0
- agent_mcp/registry.py +768 -0
- agent_mcp/security.py +864 -0
- {agent_mcp-0.1.3.dist-info → agent_mcp-0.1.5.dist-info}/METADATA +173 -49
- agent_mcp-0.1.5.dist-info/RECORD +62 -0
- {agent_mcp-0.1.3.dist-info → agent_mcp-0.1.5.dist-info}/WHEEL +1 -1
- agent_mcp-0.1.5.dist-info/entry_points.txt +4 -0
- agent_mcp-0.1.5.dist-info/top_level.txt +3 -0
- demos/__init__.py +1 -0
- demos/basic/__init__.py +1 -0
- demos/basic/framework_examples.py +108 -0
- demos/basic/langchain_camel_demo.py +272 -0
- demos/basic/simple_chat.py +355 -0
- demos/basic/simple_integration_example.py +51 -0
- demos/collaboration/collaborative_task_example.py +437 -0
- demos/collaboration/group_chat_example.py +130 -0
- demos/collaboration/simplified_crewai_example.py +39 -0
- demos/comprehensive_framework_demo.py +202 -0
- demos/langgraph/autonomous_langgraph_network.py +808 -0
- demos/langgraph/langgraph_agent_network.py +415 -0
- demos/langgraph/langgraph_collaborative_task.py +619 -0
- demos/langgraph/langgraph_example.py +227 -0
- demos/langgraph/run_langgraph_examples.py +213 -0
- demos/network/agent_network_example.py +381 -0
- demos/network/email_agent.py +130 -0
- demos/network/email_agent_demo.py +46 -0
- demos/network/heterogeneous_network_example.py +216 -0
- demos/network/multi_framework_example.py +199 -0
- demos/utils/check_imports.py +49 -0
- demos/workflows/autonomous_agent_workflow.py +248 -0
- demos/workflows/mcp_features_demo.py +353 -0
- demos/workflows/run_agent_collaboration_demo.py +63 -0
- demos/workflows/run_agent_collaboration_with_logs.py +396 -0
- demos/workflows/show_agent_interactions.py +107 -0
- demos/workflows/simplified_autonomous_demo.py +74 -0
- functions/main.py +144 -0
- functions/mcp_network_server.py +513 -0
- functions/utils.py +47 -0
- agent_mcp-0.1.3.dist-info/RECORD +0 -18
- agent_mcp-0.1.3.dist-info/entry_points.txt +0 -2
- agent_mcp-0.1.3.dist-info/top_level.txt +0 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Comprehensive Demo: Showcasing All AgentMCP Frameworks
|
|
3
|
+
This demo demonstrates the full power of the enhanced AgentMCP platform
|
|
4
|
+
including all major AI agent frameworks and protocols.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import asyncio
|
|
8
|
+
import json
|
|
9
|
+
from typing import Dict, Any, List
|
|
10
|
+
|
|
11
|
+
# Import all our frameworks
|
|
12
|
+
from .missing_frameworks import (
|
|
13
|
+
create_multi_framework_agent,
|
|
14
|
+
BeeAIAgent,
|
|
15
|
+
AgentGPTAgent,
|
|
16
|
+
SuperAGIAgent,
|
|
17
|
+
FractalAgent,
|
|
18
|
+
SwarmAgent
|
|
19
|
+
MISSING_FRAMEWORKS
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
# Import core AgentMCP components
|
|
23
|
+
from .mcp_decorator import mcp_agent
|
|
24
|
+
from .mcp_transport import HTTPTransport
|
|
25
|
+
|
|
26
|
+
logger = logging.getLogger(__name__)
|
|
27
|
+
|
|
28
|
+
async def demo_all_frameworks():
|
|
29
|
+
"""Demonstrate all available frameworks working together"""
|
|
30
|
+
print("🚀 AgentMCP Comprehensive Framework Demo")
|
|
31
|
+
print("=" * 60)
|
|
32
|
+
|
|
33
|
+
# Create agents from different frameworks
|
|
34
|
+
agents = {}
|
|
35
|
+
|
|
36
|
+
# 1. BeeAI Agent
|
|
37
|
+
agents["beeai"] = create_multi_framework_agent(
|
|
38
|
+
agent_id="beeai_agent",
|
|
39
|
+
name="BeeAI Task Orchestrator",
|
|
40
|
+
framework="beeai",
|
|
41
|
+
description="BeeAI agent for autonomous task management",
|
|
42
|
+
transport=HTTPTransport(port=8081)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
# 2. AgentGPT Agent
|
|
46
|
+
agents["agentgpt"] = create_multi_framework_agent(
|
|
47
|
+
agent_id="agentgpt_agent",
|
|
48
|
+
name="AgentGPT Conversationalist",
|
|
49
|
+
framework="agentgpt",
|
|
50
|
+
description="AgentGPT agent for conversation-based AI",
|
|
51
|
+
transport=HTTPTransport(port=8082)
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# 3. SuperAGI Agent
|
|
55
|
+
agents["superagi"] = create_multi_framework_agent(
|
|
56
|
+
agent_id="superagi_agent",
|
|
57
|
+
name="SuperAGI Autonomous Platform",
|
|
58
|
+
framework="superagi",
|
|
59
|
+
description="SuperAGI agent for enterprise automation",
|
|
60
|
+
transport=HTTPTransport(port=8083)
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
# 4. Fractal Agent
|
|
64
|
+
agents["fractal"] = create_multi_framework_agent(
|
|
65
|
+
agent_id="fractal_agent",
|
|
66
|
+
name="Fractal Smart Contract Agent",
|
|
67
|
+
framework="fractal",
|
|
68
|
+
description="Fractal agent for blockchain-based multi-agent systems",
|
|
69
|
+
transport=HTTPTransport(port=8084)
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
# 5. Swarm Agent
|
|
73
|
+
agents["swarm"] = create_multi_framework_agent(
|
|
74
|
+
agent_id="swarm_agent",
|
|
75
|
+
name="Swarm Coordination",
|
|
76
|
+
framework="swarm",
|
|
77
|
+
description="Swarm agent for agent handoff and coordination",
|
|
78
|
+
transport=HTTPTransport(port=8085)
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
# 6. Original AgentMCP agent (control)
|
|
82
|
+
agents["mcp_original"] = mcp_agent(
|
|
83
|
+
agent_id="mcp_agent",
|
|
84
|
+
name="Original MCP Agent",
|
|
85
|
+
description="Original AgentMCP agent for comparison"
|
|
86
|
+
transport=HTTPTransport(port=8080)
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
print("✅ Created 6 different agent types:")
|
|
90
|
+
for name in agents:
|
|
91
|
+
print(f" - {name} ({agents[name].mcp_id})")
|
|
92
|
+
|
|
93
|
+
# Demo multi-agent workflow
|
|
94
|
+
print("\n🔄 Multi-Agent Workflow Demonstration")
|
|
95
|
+
|
|
96
|
+
# Step 1: BeeAI creates a task
|
|
97
|
+
task_result = await agents["beeai"].bee_create_task("Analyze customer support tickets")
|
|
98
|
+
print(f"📝 BeeAI Task: {task_result}")
|
|
99
|
+
|
|
100
|
+
# Step 2: AgentGPT analyzes the task
|
|
101
|
+
analysis_result = await agents["agentgpt"].agentgpt_create_conversation()
|
|
102
|
+
conversation_id = analysis_result["conversation_id"]
|
|
103
|
+
|
|
104
|
+
await agents["agentgpt"].agentgpt_send_message(
|
|
105
|
+
conversation_id=conversation_id,
|
|
106
|
+
message="I'll analyze the customer support task using our knowledge base and suggest prioritization."
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
print(f"💬 AgentGPT Analysis: Message sent to conversation {conversation_id}")
|
|
110
|
+
|
|
111
|
+
# Step 3: SuperAGI creates specialized agents
|
|
112
|
+
researcher_agent = await agents["superagi"].superagi_create_agent({
|
|
113
|
+
"name": "ResearchAgent",
|
|
114
|
+
"capabilities": ["web_research", "data_analysis"],
|
|
115
|
+
"model": "gpt-4o"
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
analyst_agent = await agents["superagi"].superagi_create_agent({
|
|
119
|
+
"name": "AnalystAgent",
|
|
120
|
+
"capabilities": ["financial_analysis", "market_research"],
|
|
121
|
+
"model": "gpt-4o"
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
print(f"🤖 SuperAGI Specialized Agents: Researcher={researcher_agent['agent_id']}, Analyst={analyst_agent['agent_id']}")
|
|
125
|
+
|
|
126
|
+
# Step 4: All agents coordinate via A2A/MCP
|
|
127
|
+
print("\n🤝 Agent Network Coordination:")
|
|
128
|
+
|
|
129
|
+
# Create a simple coordination task
|
|
130
|
+
coordination_task = "Customer inquiry analysis and response"
|
|
131
|
+
|
|
132
|
+
# Each agent contributes to the task
|
|
133
|
+
beeai_contribution = await agents["beeai"].bee_execute_task(
|
|
134
|
+
task_id=task_result["task_id"],
|
|
135
|
+
inputs={"analysis_type": "sentiment", "customer_id": "cust_123"}
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
agentgpt_summary = await agents["agentgpt"].agentgpt_send_message(
|
|
139
|
+
conversation_id=conversation_id,
|
|
140
|
+
message="Based on sentiment analysis, I recommend proactive outreach."
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
fractal_payment_terms = await agents["fractal"].fractal_create_contract({
|
|
144
|
+
"contract_data": {
|
|
145
|
+
"terms": "Payment upon successful resolution",
|
|
146
|
+
"payment_address": "0x123456789012345678901234567890",
|
|
147
|
+
"payment_method": "usdc"
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
swarm_coordination = await agents["swarm"].swarm_coordinate_agents(
|
|
152
|
+
agent_ids=[
|
|
153
|
+
agents["beeai"].agent_id,
|
|
154
|
+
agents["agentgpt"].agent_id,
|
|
155
|
+
agents["superagi"]["researcher_agent"]["agent_id"],
|
|
156
|
+
agents["superagi"]["analyst_agent"]["agent_id"]
|
|
157
|
+
],
|
|
158
|
+
task=coordination_task
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
print(f"🔄 Swarm Coordination: {swarm_coordination}")
|
|
162
|
+
|
|
163
|
+
# Step 5: Original MCP agent monitors everything
|
|
164
|
+
monitoring_result = await agents["mcp_original"].execute_tool(
|
|
165
|
+
tool_name="get_agent_info",
|
|
166
|
+
arguments={"agent_id": "all"}
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
print(f"📊 MCP Monitoring: {len(monitoring_result.get('result', {}).get('agents', []))} agents active")
|
|
170
|
+
|
|
171
|
+
print("\n🎯 Demo Results Summary:")
|
|
172
|
+
print(f"✅ BeeAI Agent: {agents['beeai'].agent_id}")
|
|
173
|
+
print(f"✅ AgentGPT Agent: {agents['agentgpt'].agent_id}")
|
|
174
|
+
print(f"✅ SuperAGI Platform: {agents['superagi'].agent_id}")
|
|
175
|
+
print(f"✅ Fractal Agent: {agents['fractal'].agent_id}")
|
|
176
|
+
print(f"✅ Swarm Coordination: {agents['swarm'].agent_id}")
|
|
177
|
+
print(f"✅ Original MCP Agent: {agents['mcp_original'].agent_id}")
|
|
178
|
+
print(f"✅ Total Frameworks Demonstrated: {len(agents)}")
|
|
179
|
+
|
|
180
|
+
print("\n🌟 All AgentMCP Capabilities Shown:")
|
|
181
|
+
print(" 🔄 A2A Protocol Integration")
|
|
182
|
+
print(" 📈 LlamaIndex MCP Adapter")
|
|
183
|
+
print(" 🏢 Microsoft Agent Framework")
|
|
184
|
+
print(" 🔐 Pydantic AI Support")
|
|
185
|
+
print(" 💰 Zero-Trust Security Layer")
|
|
186
|
+
print(" 💳 Hybrid Payment Gateway")
|
|
187
|
+
print(" 🌐 Multi-Language Agent Registry")
|
|
188
|
+
print(" 📖 OpenAPI Protocol Support")
|
|
189
|
+
print(" 🔬 Missing Frameworks Added: BeeAI, AgentGPT, SuperAGI, Fractal, Swarm")
|
|
190
|
+
|
|
191
|
+
print("\n📊 Framework Statistics:")
|
|
192
|
+
for framework_name, info in MISSING_FRAMEWORKS.items():
|
|
193
|
+
print(f" • {framework_name}: {info['maturity']} maturity, {info['category']}")
|
|
194
|
+
print(f" Website: {info['website']}")
|
|
195
|
+
print(f" Use Cases: {', '.join(info['use_cases'])}")
|
|
196
|
+
|
|
197
|
+
print(f"\n🎯 Ready for Production Use!")
|
|
198
|
+
|
|
199
|
+
return True
|
|
200
|
+
|
|
201
|
+
if __name__ == "__main__":
|
|
202
|
+
asyncio.run(demo_all_frameworks())
|