Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b82238

Browse files
modified image server and images
1 parent 0d4bbb7 commit 6b82238

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

mcp_crewai/images/MCP_Diagram.png

1.21 MB
Loading
1.34 MB
Loading

mcp_crewai/main.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
],
2121
)
2222

23+
github_server_params=StdioServerParameters(
24+
command="npx",
25+
args=[
26+
"-y",
27+
"@modelcontextprotocol/server-github",
28+
],
29+
env={"GITHUB_PERSONAL_ACCESS_TOKEN": os.getenv("GITHUB_PERSONAL_ACCESS_TOKEN")},
30+
)
31+
32+
2333
brave_search_params=StdioServerParameters(
2434
command="npx",
2535
args=[
@@ -36,7 +46,8 @@
3646
],
3747
env={"OPENAI_API_KEY": os.getenv("OPENAI_API_KEY"), "OPENAI_ORGANIZATION": os.getenv("OPENAI_ORGANIZATION")},
3848
)
39-
all_tools=[server_params, brave_search_params, image_server_params]
49+
50+
all_tools=[server_params, brave_search_params, image_server_params, github_server_params]
4051
with MCPServerAdapter(all_tools) as tools:
4152
print(f"Available tools from Stdio MCP server: {[tool.name for tool in tools]}")
4253

@@ -50,14 +61,14 @@
5061
)
5162

5263
task = Task(
53-
description="""I need you to research Model Context Protocol, then create an image of a diagram on how basic mcp works.""",
54-
expected_output="A confirmation that the image was created.",
64+
description="""I need you to research Model Context Protocol and create an in-depth diagram on how it works.""",
65+
expected_output="A summary of the brave search results and a successful image creation.",
5566
agent=agent,
5667
)
5768

5869
summary_task = Task(
5970
description="Summarize the results of the task and create a text file in the downloads folder (check allowed folders) and save the summary to this file.",
60-
expected_output="A summary of the results of the task in a text file in the downloads folder.",
71+
expected_output="A summary of the brave search results in a text file in the downloads folder.",
6172
agent=agent,
6273
)
6374

mcp_crewai/servers/image_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ def image_creation_openai(query: str, image_name: str) -> str:
3737
return {"success": False, "error": str(e)}
3838

3939
if __name__ == "__main__":
40-
mcp.run(transport="stdio")
41-
print("Image Creation MCP Server running stdio")
40+
print("Image Creation MCP Server running stdio")
41+
mcp.run(transport="stdio")

0 commit comments

Comments
 (0)