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
Copy file name to clipboardExpand all lines: docs/tools/mcp-tools.md
+101Lines changed: 101 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,8 @@ The following examples demonstrate how to use `MCPToolset` within the `adk web`
48
48
49
49
This Python example demonstrates connecting to a local MCP server that provides file system operations.
50
50
51
+
=== "Python"
52
+
51
53
#### Step 1: Define your Agent with `MCPToolset`
52
54
53
55
Create an `agent.py` file (e.g., in `./adk_agent_samples/mcp_agent/agent.py`). The `MCPToolset` is instantiated directly within the `tools` list of your `LlmAgent`.
@@ -108,6 +110,58 @@ Ensure you have an `__init__.py` in the same directory as `agent.py` to make it
108
110
from . import agent
109
111
```
110
112
113
+
=== "Java"
114
+
115
+
116
+
Create an `McpToolsExample.java` file. The `MCPToolset` is instantiated directly within the `tools` list of your `LlmAgent`.
117
+
118
+
***Important:** Replace `"/path/to/your/folder"` in the `args` list with the **absolute path** to an actual folder on your local system that the MCP server can access.
0 commit comments