Skip to content

Commit d880484

Browse files
committed
added MCP example
1 parent d91cc11 commit d880484

24 files changed

+187
-744
lines changed

mcp_neo4j_client.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
from strands import Agent
55
from strands.tools.mcp.mcp_client import MCPClient
66

7-
# IMPORT MODELLO MISTRAL
7+
# IMPORT MISTRAL MODEL
88
from strands.models.mistral import MistralModel
99
import os
1010
MISTRAL_API_KEY = os.getenv("MISTRAL_API_KEY")
1111

1212
def create_streamable_http_transport():
13-
# L’URL deve essere quello del tuo server FastMCP
13+
# The URL must be the one of your FastMCP server
1414
return streamablehttp_client("http://localhost:8000/mcp/")
1515

1616

1717
def main():
18-
# 1) Crea client MCP
18+
# 1) Create the MCP client
1919
streamable_http_mcp_client = MCPClient(create_streamable_http_transport)
2020

2121
with streamable_http_mcp_client:
22-
# 2) Lista tool MCP
22+
# 2) List available MCP tools
2323
tools = streamable_http_mcp_client.list_tools_sync()
24-
print("TOOLS disponibili:", [getattr(t, "name", t.mcp_tool.name) for t in tools])
24+
print("Available TOOLS:", [getattr(t, "name", t.mcp_tool.name) for t in tools])
2525

26-
# 3) Crea l'agente con Mistral
26+
# 3) Create the agent using Mistral
2727
agent = Agent(
2828
tools=tools,
2929
model=MistralModel(
@@ -34,17 +34,17 @@ def main():
3434
),
3535
)
3636

37-
# 4) Esegui domanda tramite agente
37+
# 4) Ask a question through the agent
3838
response = agent("What is 125 plus 375?")
39-
print("Risposta agente:", response)
39+
print("Agent response:", response)
4040

41-
# 5) Oppure invoca il tool direttamente
41+
# 5) Or directly call a tool
4242
result = streamable_http_mcp_client.call_tool_sync(
4343
tool_use_id="tool-1",
4444
name="neo4j_query",
4545
arguments={"x": 125, "y": 375},
4646
)
47-
print("Risultato calcolatore:", result["content"][0]["text"])
47+
print("Calculator result:", result["content"][0]["text"])
4848

4949

5050
if __name__ == "__main__":

mcp_neo4j_client2.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

mcp_neo4j_client3.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

mcp_neo4j_mistral_example.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

mcp_neo4j_mistral_example1.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

mcp_neo4j_mistral_example2.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

mcp_neo4j_mistral_example3.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

mcp_neo4j_server-without-neo4j.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)