We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1dafb09 commit 32efe84Copy full SHA for 32efe84
1 file changed
strands_examples/nova_act_strands.py
@@ -1,4 +1,5 @@
1
import os
2
+import shutil
3
4
from mcp import StdioServerParameters, stdio_client
5
from strands import Agent
@@ -8,10 +9,19 @@
8
9
# Step 1: Define MCP stdio parameters
10
NOVA_ACT_API_KEY = os.getenv("NOVA_ACT_API_KEY")
11
12
+# Find the available Python command
13
+python_cmd = "python"
14
+if shutil.which("python3") is not None:
15
+ python_cmd = "python3"
16
+elif shutil.which("python") is not None:
17
+ python_cmd = "python"
18
+else:
19
+ raise RuntimeError("Neither 'python' nor 'python3' command was found in PATH")
20
+
21
nova_act_client = MCPClient(
22
lambda: stdio_client(
23
StdioServerParameters(
- command="python",
24
+ command=python_cmd,
25
args=["nova_act_mcp_server.py"],
26
env={"NOVA_ACT_API_KEY": NOVA_ACT_API_KEY},
27
),
0 commit comments