You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"What is the current time in Cape Town? What restaurants are open right now?"
97
+
"What listings are available in Cape Town for 2 people for 3 nights from 1 to 4 August 2025?"
113
98
)
114
99
)
115
100
```
@@ -188,9 +173,9 @@ if __name__ == "__main__":
188
173
189
174
1.**Error Handling**: Always include proper error handling for MCP server connections and operations.
190
175
191
-
2.**Resource Cleanup**: Use `MCPTools` as an async context manager to ensure proper cleanup of resources:
176
+
2.**Resource Cleanup**: Use `MCPTools`or `MultiMCPTools`as an async context manager to ensure proper cleanup of resources:
192
177
```python
193
-
asyncwith MCPTools(server_params) as mcp_tools:
178
+
asyncwith MCPTools(command) as mcp_tools:
194
179
# Your agent code here
195
180
```
196
181
@@ -208,12 +193,15 @@ You are a filesystem assistant. Help users explore files and directories.
208
193
209
194
## Understanding server Parameters
210
195
211
-
The `server_params` parameter to `MCPTools` is used to configure the connection to the MCP server. It contains the following keys:
196
+
The recommended way to configure `MCPTools` or `MultiMCPTools` is to use the `command` parameter.
197
+
198
+
Alternatively, you can use the `server_params` parameter with `MCPTools` to configure the connection to the MCP server.
199
+
It contains the following keys:
212
200
-`command`: The command to run the MCP server.
213
201
- Use `npx` for mcp servers that can be installed via npm (or `node` if running on Windows).
214
202
- Use `uvx` for mcp servers that can be installed via uvx.
215
203
-`args`: The arguments to pass to the MCP server.
216
-
-`env`: Optional environment variables to pass to the MCP server. Remember to include all current environment variables in the `env` dictionary.
204
+
-`env`: Optional environment variables to pass to the MCP server. Remember to include all current environment variables in the `env` dictionary. If `env` is not provided, the current environment variables will be used.
0 commit comments