@@ -15,12 +15,12 @@ This guide focuses on deploying Model Context Protocol (MCP) servers for product
1515 <Step title = " Install Dependencies" >
1616 Make sure you have the required packages installed:
1717 ```bash
18- pip install "praisonaiagents[ mcp] >=0.0.81 "
18+ pip install "praisonaiagents[ mcp] "
1919 ```
2020
2121 For the multi-agent example with search capabilities:
2222 ```bash
23- pip install "praisonaiagents[ mcp] >=0.0.81 " duckduckgo-search
23+ pip install "praisonaiagents[ mcp] " duckduckgo-search
2424 ```
2525 </Step >
2626 <Step title = " Create MCP Server Files" >
@@ -30,12 +30,12 @@ This guide focuses on deploying Model Context Protocol (MCP) servers for product
3030 ```python
3131 from praisonaiagents import Agent
3232
33- agent = Agent(name="TweetAgent", instructions="Create a Tweet based on the topic provided")
33+ agent = Agent(instructions="Create a Tweet based on the topic provided")
3434 agent.launch(port=8080, host="0.0.0.0", protocol="mcp")
3535 ```
3636
3737 ** Multi-Agent MCP Server with Custom Tools**
38-
38+
3939 Create a file named ` simple-mcp-multi-agents-server.py ` :
4040 ```python
4141 from praisonaiagents import Agent, Agents
@@ -52,10 +52,44 @@ This guide focuses on deploying Model Context Protocol (MCP) servers for product
5252 } )
5353 return results
5454
55- agent = Agent(name="SearchAgent", instructions="You Search the internet for information", tools=[ internet_search_tool] )
56- agent2 = Agent(name="SummariseAgent", instructions="You Summarise the information")
55+ agent = Agent(instructions="You Search the internet for information", tools=[ internet_search_tool] )
56+ agent2 = Agent(instructions="You Summarise the information")
57+
58+ agents = Agents(agents=[ agent, agent2] )
59+ agents.launch(port=8080, host="0.0.0.0", protocol="mcp")
60+ ```
61+
62+ ** Simple Multi-Agent MCP Server**
63+
64+ Create a file named ` simple-multi-agents-server.py ` :
65+ ```python
66+ from praisonaiagents import Agent, Agents
67+
68+ agent = Agent(instructions="You Search the internet for information")
69+ agent2 = Agent(instructions="You Summarise the information")
70+
71+ agents = Agents(agents=[ agent, agent2] )
72+ agents.launch(port=8080, host="0.0.0.0", protocol="mcp")
73+ ```
74+ ```python
75+ from praisonaiagents import Agent, Agents
76+ from duckduckgo_search import DDGS
77+
78+ def internet_search_tool(query: str):
79+ results = [ ]
80+ ddgs = DDGS()
81+ for result in ddgs.text(keywords=query, max_results=5):
82+ results.append({
83+ " title" : result .get (" title" , " " ),
84+ " url" : result .get (" href" , " " ),
85+ " snippet" : result .get (" body" , " " )
86+ } )
87+ return results
88+
89+ agent = Agent(instructions="You Search the internet for information", tools=[ internet_search_tool] )
90+ agent2 = Agent(instructions="You Summarise the information")
5791
58- agents = Agents(name="MultiAgents", agents=[ agent, agent2] )
92+ agents = Agents(agents=[ agent, agent2] )
5993 agents.launch(port=8080, host="0.0.0.0", protocol="mcp")
6094 ```
6195 </Step >
@@ -86,7 +120,7 @@ This guide focuses on deploying Model Context Protocol (MCP) servers for product
86120
87121 Create a ` requirements.txt ` file:
88122 ```
89- praisonaiagents[ mcp] >=0.0.81
123+ praisonaiagents[ mcp]
90124 duckduckgo-search # Only needed for the multi-agent example
91125 ```
92126 </Step >
0 commit comments