Skip to content

Commit 30ff6e8

Browse files
kmoscoeclincoln8
andauthored
Add support for custom DC in Gemini CLI extension (#656)
* remove references to dataclass objects * Fix a copy-paste error. * remove extra file * Create placeholders for LLM pages * rename to MCP * complete rename * remove old file * Changes from Keyur * Add target tag * Rewording suggested by Keyur * Remove extraneous text * Fix a copy-paste error. * Migrate MCP docs to docsite * Restructuring * Remove unused file * Add TOCs etc. * Update var formatting * comments from Keyur * another change from Keyur * Update mcp/index.md Co-authored-by: Christie Ellks <[email protected]> * Changes from Christie * Apply suggestion from @clincoln8 Co-authored-by: Christie Ellks <[email protected]> * More changes from Christie * Changes from Dan * Link fixes * Remove MCP inspector info * Add more context to agent dev doc * fix formatting * Create placeholders for LLM pages * merge * Slight rewording based on comment from Christie * Lots of restructuring * More work on Gemini CLI extension * More changes * more changes * more changes * Update mcp/run_tools.md Co-authored-by: Christie Ellks <[email protected]> * implement suggestions from Christie * Add some bullets to comparison section * Fix update section * rename "prompt" to "context" * add mention of Gemini CLI extension for custom DC * Update custom DC vars procedure * Remove reference to .env file in extension run --------- Co-authored-by: Christie Ellks <[email protected]>
1 parent 6c36b99 commit 30ff6e8

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

mcp/run_tools.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This page shows you how to run a local agent and connect to a Data Commons MCP s
1313
* TOC
1414
{:toc}
1515

16-
We provide specific instructions for the following agents:
16+
We provide specific instructions for the following agents. All may be used to query datacommons.org or a Custom Data Commons instance.
1717

1818
- [Gemini CLI extension](https://geminicli.com/extensions/)
1919
- Best for querying datacommons.org
@@ -24,10 +24,7 @@ We provide specific instructions for the following agents:
2424

2525
See [Use the Gemini CLI extension](#use-the-gemini-cli-extension) for this option.
2626

27-
<!-- TODO: write this Tip: If you would like to use this option with a Custom Data Commons instance, we recommend that you develop your own extension. See xxx for details. -->
28-
2927
- [Gemini CLI](https://geminicli.com/)
30-
- Can be used for datacommons.org or a Custom Data Commons instance
3128
- No additional downloads
3229
- MCP server can be run locally or remotely
3330
- You can create your own context file
@@ -37,7 +34,6 @@ We provide specific instructions for the following agents:
3734

3835
- A sample basic agent based on the Google [Agent Development Kit](https://google.github.io/adk-docs/)
3936
- Best for interacting with a Web GUI
40-
- Can be used for datacommons.org or a Custom Data Commons instance
4137
- Can be customized to run other LLMs and prompts
4238
- Downloads agent code locally
4339
- Server may be run remotely
@@ -67,23 +63,30 @@ Other requirements for specific agents are given in their respective sections.
6763

6864
For basic usage against datacommons.org, set the required `DC_API_KEY` in your shell/startup script (e.g. `.bashrc`).
6965
<pre>
70-
export DC_API_KEY=<var>YOUR API KEY</var>
66+
export DC_API_KEY="<var>YOUR API KEY</var>"
7167
</pre>
7268

7369
### Custom Data Commons
7470

75-
If you're running a against a custom Data Commons instance, we recommend using a `.env` file, which the server locates automatically, to keep all the settings in one place. All supported options are documented in [packages/datacommons-mcp/.env.sample](https://github.com/datacommonsorg/agent-toolkit/blob/main/packages/datacommons-mcp/.env.sample).
71+
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).
72+
73+
The following variables are required:
74+
- <code>export DC_API_KEY="<var>YOUR API KEY</var>"</code>
75+
- `export DC_TYPE="custom"`
76+
- <code>export CUSTOM_DC_URL="<var>YOUR_INSTANCE_URL</var>"</code>
77+
78+
If you're using the Gemini CLI extension, just set these in your shell/startup script.
7679

77-
To set variables using a `.env` file:
80+
If you're not using the extension, you may wish to use a `.env` file, which the server locates automatically, to keep all the settings in one place. To set all variables using a `.env` file:
7881

79-
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. Or, if you plan to run the sample agent, clone the repo <https://github.com/datacommonsorg/agent-toolkit/>.
82+
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/>.
8083

8184
1. From the directory where you saved the sample file, copy it to a new file called `.env`. For example:
8285
```bash
8386
cd ~/agent-toolkit/packages/datacommons-mcp
8487
cp .env.sample .env
8588
```
86-
1. Set the following variables:
89+
1. Set the following variables, without quotes:
8790
- `DC_API_KEY`: Set to your Data Commons API key
8891
- `DC_TYPE`: Set to `custom`.
8992
- `CUSTOM_DC_URL`: Uncomment and set to the URL of your instance.
@@ -106,12 +109,14 @@ Open a new terminal and install the extension directly from GitHub:
106109
```sh
107110
gemini extensions install https://github.com/gemini-cli-extensions/datacommons [--auto-update]
108111
```
112+
The installation creates a local `.gemini/extensions/datacommons` directory with the required files.
113+
109114
> Note: If you have previously configured Gemini CLI to use the Data Commons MCP Server and want to use the extension instead, be sure to delete the `datacommons-mcp` section from the relevant `settings.json` file (e.g. `~/.gemini/settings.json`).
110115
111116
{:.no_toc}
112117
### Run
113118

114-
1. From any directory, run `gemini`.
119+
1. Run `gemini` from any directory.
115120
1. To verify that the Data commons tools are running, enter `/mcp list`. You should see `datacommons-mcp` listed as `Ready`. If you don't, see the [Troubleshoot](#troubleshoot) section.
116121
1. To verify that the extension is running, enter `/extensions list`. You should see `datacommons` listed as `active`.
117122
1. Start sending [natural-language queries](#sample-queries).

0 commit comments

Comments
 (0)