agent-mcp 0.1.0__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.
@@ -0,0 +1,474 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-mcp
3
+ Version: 0.1.0
4
+ Summary: A bridge agent to enable agents with Model Context Protocol capabilities to be added to a Multi-agent Collaboration Network (MCN) to run on a Multi-agent Collaboration Platform (MCP)
5
+ Home-page: https://github.com/geniusgeek/agent-mcp
6
+ Author: Samuel Ekpe
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/geniusgeek/agent-mcp
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Requires-Python: >=3.11
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: autogen
18
+ Requires-Dist: langchain
19
+ Requires-Dist: langchain-openai
20
+ Requires-Dist: langchain-community
21
+ Requires-Dist: crewai>=0.11.0
22
+ Requires-Dist: langgraph>=0.0.15
23
+ Requires-Dist: openai>=1.12.0
24
+ Requires-Dist: fastapi==0.104.1
25
+ Requires-Dist: uvicorn==0.24.0
26
+ Requires-Dist: sse-starlette==1.8.2
27
+ Requires-Dist: firebase-admin==6.4.0
28
+ Requires-Dist: python-multipart==0.0.6
29
+ Requires-Dist: python-dotenv==1.0.0
30
+ Requires-Dist: google-cloud-firestore==2.13.1
31
+ Requires-Dist: aiohttp==3.9.1
32
+ Requires-Dist: duckduckgo-search==4.1.1
33
+ Dynamic: home-page
34
+ Dynamic: requires-python
35
+
36
+ # AgentMCP: Multi-Agent Collaboration Platform
37
+
38
+ ## Put Your Agent to Work in 30 Seconds
39
+
40
+ ```python
41
+ pip install agent-mcp # Step 1: Install
42
+ ```
43
+
44
+ ```python
45
+ from agent_mcp import mcp_agent # Step 2: Import
46
+
47
+ @mcp_agent(name="MyAgent") # Step 3: Add one line - that's it! 🎉
48
+ class MyAgent:
49
+ def analyze(self, data):
50
+ return "Analysis complete!"
51
+ ```
52
+
53
+ ## What is AgentMCP?
54
+
55
+ AgentMCP is a revolutionary Multi-agent Collaboration Platform (MCP) that implements the Model Context Protocol (MCP) to enable seamless collaboration between AI agents. With a single decorator, developers can transform any agent into an MCP-compatible agent that can participate in the Multi-agent Collaboration Network (MCN).
56
+
57
+ ### 🎯 One Decorator = Infinite Possibilities
58
+
59
+ When you add `@mcp_agent`, your agent instantly becomes:
60
+ - 🌐 Connected to the Multi-agent Collaboration Network (MCN)
61
+ - 🤝 Ready to work with any other agent on the network
62
+ - 🔌 Framework-agnostic (works with Langchain, CrewAI, Autogen, or any custom implementation)
63
+ - 🧠 Empowered to communicate, share context, and collaborate with specialized agents globally
64
+
65
+ No complex setup. No infrastructure headaches. Just one line of code to join the world's largest AI agent collaboration network!
66
+
67
+ ### 💡 It's Like Uber for AI Agents
68
+
69
+ Just like Uber connects drivers and riders, AgentMCP connects AI agents:
70
+ - **Your Agent**: Has specific skills? Put them to work!
71
+ - **Need Help?** Tap into a global network of specialized agents
72
+ - **No Lock-in**: Works with any framework or custom implementation
73
+ - **One Line**: That's all it takes to join the network
74
+
75
+ ### 🔌 Availability & Connection
76
+
77
+ Just like Uber drivers, agents can go online and offline:
78
+ - **Active**: Your agent is online when your app is running
79
+ - **Discoverable**: Other agents can find yours when it's online
80
+ - **Smart Routing**: Tasks only go to available agents
81
+ - **Auto Recovery**: Handles disconnections gracefully
82
+
83
+ ```python
84
+ @mcp_agent(name="MyAgent")
85
+ class MyCustomAgent:
86
+ @register_tool("analyze", "Analyze given data")
87
+ def analyze_data(self, data):
88
+ return "Analysis results"
89
+ ```
90
+
91
+ ### 🎯 What Just Happened?
92
+
93
+ Your agent just joined the world's largest AI agent collaboration network! It can now:
94
+
95
+ - 🌐 Work with specialized agents from around the world
96
+ - 🤝 Collaborate on complex tasks automatically
97
+ - 🔌 Connect with any framework (Langchain, CrewAI, Autogen, etc.)
98
+ - 🧠 Share context and knowledge with other agents
99
+
100
+
101
+ The platform unifies various AI frameworks (Langchain, CrewAI, Autogen, LangGraph) under a single protocol, allowing agents to communicate and collaborate regardless of their underlying implementation.
102
+
103
+ The platform uses a flexible coordinator-worker architecture with HTTP/FastAPI for communication, allowing agents to work together regardless of their underlying framework.
104
+
105
+ ## Features
106
+
107
+ ### Core Features
108
+ - **One-Line Integration**: Transform any agent into an MCP agent with a single decorator
109
+ - **Automatic Network Registration**: Agents automatically join the MCN upon creation
110
+ - **Framework Agnostic**: Works with any AI framework or custom implementation
111
+ - **Built-in Adapters**: Ready-to-use adapters for:
112
+ - Langchain (Chain-of-thought reasoning)
113
+ - CrewAI (Role-based collaboration)
114
+ - Autogen (Autonomous agents)
115
+ - LangGraph (Workflow orchestration)
116
+
117
+ ### Architecture
118
+ - **Coordinator-Worker Pattern**: Centralized task management with distributed execution
119
+ - **FastAPI Integration**: Modern, high-performance HTTP communication
120
+ - **Asynchronous Processing**: Non-blocking task execution and message handling
121
+ - **Flexible Transport Layer**: Extensible communication protocols
122
+
123
+ ## 🛠 Features That Just Work
124
+
125
+ ### 🤖 For Your Agent
126
+ - **Auto-Registration**: Instant network access
127
+ - **Tool Discovery**: Find and use other agents' capabilities
128
+ - **Smart Routing**: Messages go to the right agent automatically
129
+ - **Built-in Memory**: Share and access collective knowledge
130
+
131
+ ### 👩‍💻 For Developers
132
+ - **Framework Freedom**: Use any AI framework you love
133
+ - **Zero Config**: No complex setup or infrastructure
134
+ - **Simple API**: Everything through one decorator
135
+ - **Full Control**: Your agent, your rules
136
+
137
+ ## 🚀 Quick Start
138
+
139
+ ### 1️⃣ Install
140
+ ```bash
141
+ pip install agent-mcp
142
+ ```
143
+
144
+ ### 2️⃣ Decorate
145
+ ```python
146
+ from agent_mcp import mcp_agent
147
+
148
+ @mcp_agent()
149
+ class MyAgent:
150
+ def work(self): pass
151
+ ```
152
+
153
+ ### 3️⃣ That's it! 🎉
154
+ Your agent is now part of the network!
155
+
156
+ ## 🔥 Supported Frameworks
157
+
158
+ Works seamlessly with:
159
+ - **Langchain** - For chain-of-thought reasoning
160
+ - **CrewAI** - For role-based agent teams
161
+ - **Autogen** - For autonomous agents
162
+ - **LangGraph** - For complex agent workflows
163
+ - **Custom Agents** - Your code, your way!
164
+
165
+ ### 💎 Premium Features
166
+ - **Agent Discovery**: Find the right agent for any task
167
+ - **Smart Routing**: Messages flow to the right place
168
+ - **Collective Memory**: Shared knowledge across agents
169
+ - **Real-time Monitoring**: Track your agent's work
170
+
171
+ ## 📚 Examples
172
+
173
+ ### 🤖 Add AI to Any Agent
174
+
175
+ ```python
176
+ from agent_mcp import mcp_agent
177
+
178
+ # Your existing agent - no changes needed!
179
+ class MyMLAgent:
180
+ def predict(self, data):
181
+ return self.model.predict(data)
182
+
183
+ # Add one line to join the network
184
+ @mcp_agent(name="MLPredictor")
185
+ class NetworkEnabledMLAgent(MyMLAgent):
186
+ pass # That's it! All methods become available to other agents
187
+ ```
188
+
189
+ ### 🤝 Instant Collaboration
190
+
191
+ ```python
192
+ # Your agent can now work with others!
193
+ results = await my_agent.collaborate({
194
+ "task": "Analyze this dataset",
195
+ "steps": [
196
+ {"agent": "DataCleaner", "action": "clean"},
197
+ {"agent": "MLPredictor", "action": "predict"},
198
+ {"agent": "Analyst", "action": "interpret"}
199
+ ]
200
+ })
201
+ ```
202
+
203
+ ## 🔗 Network API
204
+
205
+ ### 🌐 Global Agent Network
206
+
207
+ Your agent automatically joins our hosted network at `https://mcp-server-ixlfhxquwq-ew.a.run.app`
208
+
209
+ ### 🔑 Authentication
210
+
211
+ All handled for you! The `@mcp_agent` decorator:
212
+ 1. Registers your agent
213
+ 2. Gets an access token
214
+ 3. Maintains the connection
215
+
216
+ ### 📂 API Methods
217
+
218
+ ```python
219
+ # All of these happen automatically!
220
+
221
+ # 1. Register your agent
222
+ response = await network.register(agent)
223
+
224
+ # 2. Discover other agents
225
+ agents = await network.list_agents()
226
+
227
+ # 3. Send messages
228
+ await network.send_message(target_agent, message)
229
+
230
+ # 4. Receive messages
231
+ messages = await network.receive_messages()
232
+ ```
233
+
234
+ ### 🚀 Advanced Features
235
+
236
+ ```python
237
+ # Find agents by capability
238
+ analysts = await network.find_agents(capability="analyze")
239
+
240
+ # Get agent status
241
+ status = await network.get_agent_status(agent_id)
242
+
243
+ # Update agent info
244
+ await network.update_agent(agent_id, new_info)
245
+ ```
246
+
247
+ All of this happens automatically when you use the `@mcp_agent` decorator!
248
+
249
+ ## 🏛 Architecture
250
+
251
+ ### 🌐 The Network
252
+
253
+ ```mermaid
254
+ graph TD
255
+ A[Your Agent] -->|@mcp_agent| B[MCP Network]
256
+ B -->|Discover| C[AI Agents]
257
+ B -->|Collaborate| D[Tools]
258
+ B -->|Share| E[Knowledge]
259
+ ```
260
+
261
+ ### 🧰 How It Works
262
+
263
+ 1. **One Decorator** `@mcp_agent`
264
+ - Transforms your agent
265
+ - Handles registration
266
+ - Sets up communication
267
+
268
+ 2. **Instant Access**
269
+ - Global agent directory
270
+ - Automatic discovery
271
+ - Smart routing
272
+
273
+ 3. **Built-in Adapters**
274
+ - Langchain 🧩
275
+ - CrewAI 👨‍💻
276
+ - Autogen 🤖
277
+ - LangGraph 📈
278
+
279
+ 3. **Task Management**
280
+ ```python
281
+ task = {
282
+ "task_id": "research_project",
283
+ "steps": [
284
+ {
285
+ "agent": "LangchainWorker",
286
+ "task_id": "research",
287
+ "description": "Research topic"
288
+ },
289
+ {
290
+ "agent": "CrewAIWorker",
291
+ "task_id": "analysis",
292
+ "depends_on": ["research"]
293
+ }
294
+ ]
295
+ }
296
+ ```
297
+
298
+ ### Registering Custom Tools
299
+
300
+ ```python
301
+ from mcp_agent import MCPAgent
302
+
303
+ # Create an MCP-enabled agent
304
+ agent = MCPAgent(name="ToolAgent")
305
+
306
+ # Define a custom tool function
307
+ def calculate_sum(a: int, b: int):
308
+ """Calculate the sum of two numbers."""
309
+ result = a + b
310
+ return {"status": "success", "result": result}
311
+
312
+ # Register the custom tool
313
+ agent.register_mcp_tool(
314
+ name="math_sum",
315
+ description="Calculate the sum of two numbers",
316
+ func=calculate_sum,
317
+ a_description="First number to add",
318
+ b_description="Second number to add"
319
+ )
320
+
321
+ # Use the custom tool
322
+ result = agent.execute_tool("math_sum", a=5, b=7)
323
+ print(f"5 + 7 = {result}")
324
+ ```
325
+
326
+ ### 🔗 Network Benefits
327
+
328
+ - **Auto-Discovery**: Find the right agents for any task
329
+ - **Smart Routing**: Tasks go to the best available agent
330
+ - **Progress Tracking**: Real-time updates on your tasks
331
+ - **Error Handling**: Automatic retries and fallbacks
332
+
333
+ ## Model Context Protocol Support
334
+
335
+ The MCPAgent implements the Model Context Protocol, which provides a standardized way for AI systems to share context and capabilities. This implementation supports:
336
+
337
+ ### Context Management
338
+
339
+ ```python
340
+ # Set context
341
+ agent.update_context("key", "value")
342
+
343
+ # Get context
344
+ value = agent.get_context("key")
345
+
346
+ # List all context keys
347
+ keys = agent.execute_tool("context_list")
348
+
349
+ # Remove context
350
+ agent.execute_tool("context_remove", key="key_to_remove")
351
+ ```
352
+
353
+ ### 🧠 Smart Protocol
354
+
355
+ ### 🔗 Multiple Ways to Connect
356
+
357
+ ```python
358
+ # 1. Simple Function Calls
359
+ result = agent.call("analyze", data=my_data)
360
+
361
+ # 2. OpenAI Compatible
362
+ result = agent.run({
363
+ "name": "analyze",
364
+ "arguments": {"data": my_data}
365
+ })
366
+
367
+ # 3. Natural Language
368
+ result = agent.process(
369
+ "Please analyze this data and "
370
+ "send the results to the visualization team"
371
+ )
372
+ ```
373
+
374
+ ### 🤓 Smart Features
375
+
376
+ - **Auto-Detection**: Understands different call formats
377
+ - **Context Aware**: Maintains conversation history
378
+ - **Tool Discovery**: Finds the right tools for the job
379
+ - **Error Recovery**: Handles failures gracefully
380
+
381
+ ### MCP Information
382
+
383
+ You can retrieve information about an agent's MCP capabilities:
384
+
385
+ ```python
386
+ info = agent.execute_tool("mcp_info")
387
+ print(f"Agent ID: {info['id']}")
388
+ print(f"Agent Version: {info['version']}")
389
+ print(f"Available Tools: {len(info['tools'])}")
390
+ ```
391
+
392
+ ## Advanced Examples
393
+
394
+ The project includes several advanced examples that demonstrate the full potential of MCPAgent:
395
+
396
+ ### 1. MCPFeaturesDemo
397
+
398
+ Run `python mcp_features_demo.py` to see a step-by-step demonstration of all MCPAgent features:
399
+ - Context management operations
400
+ - Custom tool registration and usage
401
+ - Using agents as tools
402
+ - LLM integration with context
403
+
404
+ This is the best example to start with to understand the core capabilities of MCPAgent.
405
+
406
+ ### 2. Agent Network
407
+
408
+ Run `python agent_network_example.py` to start an interactive agent network example:
409
+ - Simulates a social network of agents
410
+ - Each agent has a specialized role (Coordinator, Researcher, Analyst, etc.)
411
+ - Agents can communicate with each other through tool calls
412
+ - You can interact with any agent and broadcast messages
413
+ - Human input is fully supported
414
+
415
+ This example demonstrates how MCPAgent enables creating complex agent networks where agents can call and interact with each other.
416
+
417
+ ### 3. Collaborative Project
418
+
419
+ Run `python collaborative_task_example.py` to start a collaborative project simulation:
420
+ - Team of agents working together on a shared project
421
+ - Shared workspace context with research, analysis, and tasks
422
+ - Task assignment and progress tracking
423
+ - Full conversation history captured
424
+ - Human input for setting topics and interacting with agents
425
+
426
+ This example showcases how MCPAgent can be used in a structured collaborative environment where agents share a workspace and contribute to a common goal.
427
+
428
+ ## LangGraph Implementation
429
+
430
+ MCPAgent has also been implemented for LangGraph, providing the same Model Context Protocol capabilities within the LangGraph framework:
431
+
432
+ ```python
433
+ from mcp_langgraph import MCPNode, MCPReactAgent, create_mcp_langgraph
434
+ from langchain_openai import ChatOpenAI
435
+
436
+ # Create a LLM
437
+ llm = ChatOpenAI(model="gpt-4o")
438
+
439
+ # Create a LangGraph with MCP capabilities
440
+ graph = create_mcp_langgraph(
441
+ llm,
442
+ name="SimpleMCPGraph",
443
+ system_message="You are a helpful assistant that uses context to answer questions."
444
+ )
445
+
446
+ # Access the MCP agent for the graph
447
+ mcp_agent = graph.mcp_agent
448
+
449
+ # Add context to the MCP agent
450
+ mcp_agent.update_context("user_info", {
451
+ "name": "Alice",
452
+ "occupation": "Data Scientist"
453
+ })
454
+
455
+ # Run the graph with a user query
456
+ from langchain_core.messages import HumanMessage
457
+
458
+ question = "What should I learn next in my field?"
459
+ initial_state = {"messages": [HumanMessage(content=question)]}
460
+ result = graph.invoke(initial_state)
461
+ ```
462
+
463
+ ### LangGraph Examples
464
+
465
+ The project includes several examples that demonstrate how to use the MCP protocol with LangGraph:
466
+
467
+ 1. **Basic LangGraph Example**
468
+ Run `python langgraph_example.py` to see a step-by-step demonstration of MCPNode with LangGraph.
469
+
470
+ 2. **LangGraph Agent Network**
471
+ Run `python langgraph_agent_network.py` to start an interactive agent network built with LangGraph.
472
+
473
+ 3. **LangGraph Collaborative Project**
474
+ Run `python langgraph_collaborative_task.py` to start a collaborative project simulation with LangGraph agents.
@@ -0,0 +1,5 @@
1
+ agent_mcp-0.1.0.dist-info/METADATA,sha256=NEQQA5P-eE3oo2ncarW9OGO1LQREM-SjmJN5VusVrRc,14325
2
+ agent_mcp-0.1.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
3
+ agent_mcp-0.1.0.dist-info/entry_points.txt,sha256=6wJ3TtpqqkX4cL5kz1ZUCc7f8xUI7bUbDk4oSXMQswE,61
4
+ agent_mcp-0.1.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
+ agent_mcp-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (78.1.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mcp-agent = autonomous_agent_workflow:main
@@ -0,0 +1 @@
1
+