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
@@ -28,23 +28,23 @@ We provide specific instructions for the following agents. All may be used to qu
28
28
- You can create your own LLM context file
29
29
- Minimal setup
30
30
31
-
- A [sample basic agent](#use-the-sample-agent) based on the Google [Agent Development Kit](https://google.github.io/adk-docs/)
31
+
- A [sample basic agent](#use-the-sample-agent) based on the Google [Agent Development Kit](https://google.github.io/adk-docs/){: target="_blank"}
32
32
- Best for interacting with a Web GUI
33
33
- Can be used to run other LLMs and prompts
34
34
- Downloads agent code locally
35
35
- Server may be run remotely
36
36
- Some additional setup
37
37
38
-
For an end-to-end tutorial using a server and agent over HTTP, see the sample Data Commons Colab notebook, [Try Data Commons MCP Tools with a Custom Agent](https://github.com/datacommonsorg/agent-toolkit/blob/main/notebooks/datacommons_mcp_tools_with_custom_agent.ipynb).
38
+
For an end-to-end tutorial using a server and agent over HTTP, see the sample Data Commons Colab notebook, [Try Data Commons MCP Tools with a Custom Agent](https://github.com/datacommonsorg/agent-toolkit/blob/main/notebooks/datacommons_mcp_tools_with_custom_agent.ipynb){: target="_blank"}.
39
39
40
40
For other clients/agents, see the relevant documentation; you should be able to reuse the commands and arguments detailed below.
41
41
42
42
## Prerequisites
43
43
44
44
These are required for all agents:
45
45
46
-
- A (free) Data Commons API key. To obtain an API key, go to <https://apikeys.datacommons.org> and request a key for the `api.datacommons.org` domain.
47
-
- Install `uv` for managing and installing Python packages; see the instructions at <https://docs.astral.sh/uv/getting-started/installation/>.
46
+
- A (free) Data Commons API key. To obtain an API key, go to <https://apikeys.datacommons.org>{: target="_blank"} and request a key for the `api.datacommons.org` domain.
47
+
- Install `uv` for managing and installing Python packages; see the instructions at <https://docs.astral.sh/uv/getting-started/installation/>{: target="_blank"}.
48
48
49
49
Other requirements for specific agents are given in their respective sections.
50
50
@@ -61,31 +61,47 @@ You can set these in the following ways:
61
61
### Base Data Commons (datacommons.org)
62
62
63
63
For basic usage against datacommons.org, set the required `DC_API_KEY` in your shell/startup script (e.g. `.bashrc`).
64
-
<pre>
65
-
export DC_API_KEY="<var>YOUR API KEY</var>"
66
-
</pre>
64
+
65
+
<divclass="gcp-tab-group">
66
+
<ulclass="gcp-tab-headers">
67
+
<li class="active">Linux or Mac shell</li>
68
+
<li>Windows Powershell</li>
69
+
</ul>
70
+
<divclass="gcp-tab-content">
71
+
<div class="active">
72
+
<pre>
73
+
export DC_API_KEY="<var>YOUR API KEY</var>"</pre>
74
+
</div>
75
+
<div>
76
+
<pre>
77
+
$env:DC_API_KEY="<var>YOUR API KEY</var>"</pre>
78
+
</div>
79
+
</div>
80
+
</div>
67
81
68
82
### Custom Data Commons
69
83
70
-
To run against a Custom Data Commons instance, you must set additional variables. All supported options are documented in [packages/datacommons-mcp/.env.sample](https://github.com/datacommonsorg/agent-toolkit/blob/main/packages/datacommons-mcp/.env.sample).
84
+
To run against a Custom Data Commons instance, you must set additional variables. All supported options are documented in [packages/datacommons-mcp/.env.sample](https://github.com/datacommonsorg/agent-toolkit/blob/main/packages/datacommons-mcp/.env.sample){: target="_blank"}.
71
85
72
86
The following variables are required:
73
-
- <code>export DC_API_KEY="<var>YOUR API KEY</var>"</code>
You can also set additional variables as described in the `.env.sample` file.
76
92
77
93
{: #env}
78
94
{: .no_toc}
79
95
#### Set variables with an `.env` file:
80
96
81
-
1. From Github, download the file [`.env.sample`](https://github.com/datacommonsorg/agent-toolkit/blob/main/packages/datacommons-mcp/.env.sample)to the desired directory. Alternatively, if you plan to run the sample agent, clone the repo <https://github.com/datacommonsorg/agent-toolkit/>.
97
+
1. From Github, download the file [`.env.sample`](https://github.com/datacommonsorg/agent-toolkit/blob/main/packages/datacommons-mcp/.env.sample){: target="_blank"} to the desired directory. Alternatively, if you plan to run the sample agent, clone the repo <https://github.com/datacommonsorg/agent-toolkit/>{: target="_blank"}.
82
98
83
99
1. From the directory where you saved the sample file, copy it to a new file called `.env`. For example:
84
100
```bash
85
101
cd~/agent-toolkit/packages/datacommons-mcp
86
102
cp .env.sample .env
87
103
```
88
-
1. Set the following variables, without quotes:
104
+
1. Set the following required variables, without quotes:
89
105
-`DC_API_KEY`: Set to your Data Commons API key
90
106
-`DC_TYPE`: Set to `custom`.
91
107
-`CUSTOM_DC_URL`: Uncomment and set to the URL of your instance.
@@ -98,10 +114,10 @@ The following variables are required:
98
114
**Additional prerequisites**
99
115
100
116
In addition to the [standard prerequisites](#prerequisites), you must have the following installed:
When you install the extension, it clones the [Data Commons extension Github repo](https://github.com/gemini-cli-extensions/datacommons) to your local system.
120
+
When you install the extension, it clones the [Data Commons extension Github repo](https://github.com/gemini-cli-extensions/datacommons){: target="_blank"} to your local system.
105
121
106
122
{:.no_toc}
107
123
### Install
@@ -157,7 +173,7 @@ This is usually due to a missing [Data Commons API key](#prerequisites). Be sure
157
173
{:.no_toc}
158
174
#### Failed to clone Git repository
159
175
160
-
Make sure you have installed [Git](https://git-scm.com/) on your system.
176
+
Make sure you have installed [Git](https://git-scm.com/){: target="_blank"} on your system.
> **Tip**: To ensure that Gemini CLI uses the Data Commons MCP tools, and not its own `GoogleSearch` tool, include a prompt to use Data Commons in your query. For example, use a query like "Use Data Commons tools to answer the following: ..." You can also add such a prompt to a [`GEMINI.md` file](https://codelabs.developers.google.com/gemini-cli-hands-on#9) so that it's persisted across sessions.
247
+
> **Tip**: To ensure that Gemini CLI uses the Data Commons MCP tools, and not its own `GoogleSearch` tool, include a prompt to use Data Commons in your query. For example, use a query like "Use Data Commons tools to answer the following: ..." You can also add such a prompt to a [`GEMINI.md` file](https://codelabs.developers.google.com/gemini-cli-hands-on#9){: target="_blank"} so that it's persisted across sessions.
236
248
237
249
## Use the sample agent
238
250
239
-
We provide a basic agent for interacting with the MCP Server in [packages/datacommons-mcp/examples/sample_agents/basic_agent](https://github.com/datacommonsorg/agent-toolkit/tree/main/packages/datacommons-mcp/examples/sample_agents/basic_agent).
251
+
We provide a basic agent for interacting with the MCP Server in [packages/datacommons-mcp/examples/sample_agents/basic_agent](https://github.com/datacommonsorg/agent-toolkit/tree/main/packages/datacommons-mcp/examples/sample_agents/basic_agent){: target="_blank"}.
240
252
241
253
**Additional prerequisites**
242
254
243
255
In addition to the [standard prerequisites](#prerequisites), you will need:
244
-
- A GCP project and a Google AI API key. For details on supported keys, see <https://google.github.io/adk-docs/get-started/quickstart/#set-up-the-model>.
245
-
-[Git](https://git-scm.com/) installed.
256
+
- A GCP project and a Google AI API key. For details on supported keys, see <https://google.github.io/adk-docs/get-started/quickstart/#set-up-the-model>{: target="_blank"}.
@@ -291,7 +301,7 @@ By default, the agent will spawn a local server and connect to it over Stdio. If
291
301
If you want to connect to a remote MCP server, follow this procedure before starting the agent:
292
302
293
303
1. Start up the MCP server in standalone mode, as described in [Run a standalone server](#run-a-standalone-server).
294
-
1. Modify the code in [`basic_agent/agent.py`](https://github.com/datacommonsorg/agent-toolkit/blob/main/packages/datacommons-mcp/examples/sample_agents/basic_agent/agent.py) to set import modules and agent initialization parameters as follows:
304
+
1. Modify the code in [`basic_agent/agent.py`](https://github.com/datacommonsorg/agent-toolkit/blob/main/packages/datacommons-mcp/examples/sample_agents/basic_agent/agent.py){: target="_blank"} to set import modules and agent initialization parameters as follows:
295
305
296
306
```python
297
307
from google.adk.tools.mcp_tool.mcp_toolset import (
@@ -334,3 +344,5 @@ By default, the host is `localhost` and the port is `8080` if you don't set thes
334
344
The server is addressable with the endpoint `mcp`. For example, `http://my-mcp-server:8080/mcp`.
335
345
336
346
You can connect to the server using [Gemini CLI](#use-gemini-cli) or the [sample ADK agent](#use-the-sample-agent). If you're using a different client from the ones documented on this page, consult its documentation to determine how to specify an HTTP URL.
0 commit comments