Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
d6241c9
remove references to dataclass objects
kmoscoe Jun 12, 2025
101c5fd
Fix a copy-paste error.
kmoscoe Jun 12, 2025
504d852
remove extra file
kmoscoe Jun 12, 2025
1697b22
Merge branch 'datacommonsorg:master' into master
kmoscoe Jun 12, 2025
426a81c
Merge branch 'master' of https://github.com/datacommonsorg/docsite
kmoscoe Jun 24, 2025
a40c7c8
Merge branch 'master' of https://github.com/kmoscoe/docsite
kmoscoe Jun 24, 2025
4c69c15
Merge branch 'datacommonsorg:master' into master
kmoscoe Sep 17, 2025
156cff0
Create placeholders for LLM pages
kmoscoe Sep 23, 2025
a975d24
Merge branch 'master' of https://github.com/datacommonsorg/docsite in…
kmoscoe Sep 23, 2025
dd5b50f
Merge branch 'datacommonsorg:master' into master
kmoscoe Sep 23, 2025
e3883e3
Merge branch 'master' of https://github.com/datacommonsorg/docsite in…
kmoscoe Sep 23, 2025
a4e40a4
rename to MCP
kmoscoe Sep 23, 2025
1fbd187
complete rename
kmoscoe Sep 23, 2025
23cb4c4
Merge branch 'datacommonsorg:master' into master
kmoscoe Sep 23, 2025
82228b1
remove old file
kmoscoe Sep 23, 2025
e656552
Changes from Keyur
kmoscoe Sep 23, 2025
9101325
Add target tag
kmoscoe Sep 23, 2025
d003cc1
Rewording suggested by Keyur
kmoscoe Sep 23, 2025
6b94948
Remove extraneous text
kmoscoe Sep 23, 2025
1157311
Merge branch 'datacommonsorg:master' into master
kmoscoe Sep 24, 2025
23d3429
Merge branch 'datacommonsorg:master' into master
kmoscoe Sep 25, 2025
2a3409f
Merge branch 'datacommonsorg:master' into master
kmoscoe Sep 30, 2025
516ed75
Merge branch 'master' of https://github.com/datacommonsorg/docsite
kmoscoe Oct 7, 2025
564457c
Merge branch 'datacommonsorg:master' into master
kmoscoe Oct 7, 2025
7052453
Merge branch 'datacommonsorg:master' into master
kmoscoe Oct 7, 2025
5da50d1
Merge branch 'datacommonsorg:master' into master
kmoscoe Oct 8, 2025
a011388
Merge branch 'master' of https://github.com/kmoscoe/docsite
kmoscoe Oct 8, 2025
12b9749
Merge branch 'datacommonsorg:master' into master
kmoscoe Oct 14, 2025
f4861e4
Merge branch 'datacommonsorg:master' into master
kmoscoe Oct 15, 2025
2ecd2bf
Merge branch 'datacommonsorg:master' into mcp
kmoscoe Oct 15, 2025
4b26adc
Fix a copy-paste error.
kmoscoe Jun 12, 2025
7d15bbe
Migrate MCP docs to docsite
kmoscoe Oct 15, 2025
f481c40
Restructuring
kmoscoe Oct 15, 2025
5d70c4a
Remove unused file
kmoscoe Oct 15, 2025
b241392
Add TOCs etc.
kmoscoe Oct 15, 2025
f78ccd3
Update var formatting
kmoscoe Oct 15, 2025
923f7c5
comments from Keyur
kmoscoe Oct 16, 2025
7ec3018
another change from Keyur
kmoscoe Oct 16, 2025
3fe9f4f
Update mcp/index.md
kmoscoe Oct 16, 2025
93db32f
Changes from Christie
kmoscoe Oct 16, 2025
5cd3a31
Apply suggestion from @clincoln8
kmoscoe Oct 16, 2025
655aece
More changes from Christie
kmoscoe Oct 16, 2025
1944f14
Changes from Dan
kmoscoe Oct 20, 2025
21d43ee
Link fixes
kmoscoe Oct 20, 2025
33234d2
Fix a copy-paste error.
kmoscoe Jun 12, 2025
ab810ea
Remove MCP inspector info
kmoscoe Oct 21, 2025
7f8521f
Add more context to agent dev doc
kmoscoe Oct 21, 2025
4f880c1
fix formatting
kmoscoe Oct 21, 2025
169781f
Merge branch 'datacommonsorg:master' into master
kmoscoe Oct 24, 2025
cff1ac7
Merge branch 'datacommonsorg:master' into mcp
kmoscoe Oct 24, 2025
3bef318
Create placeholders for LLM pages
kmoscoe Sep 23, 2025
74a7ab2
merge
kmoscoe Oct 24, 2025
1b768e9
Slight rewording based on comment from Christie
kmoscoe Oct 24, 2025
f3a9005
Merge branch 'master' of https://github.com/datacommonsorg/docsite
kmoscoe Oct 27, 2025
4047f23
Merge branch 'master' of https://github.com/datacommonsorg/docsite in…
kmoscoe Oct 27, 2025
c22bdba
Lots of restructuring
kmoscoe Oct 29, 2025
5faf6ef
More work on Gemini CLI extension
kmoscoe Nov 3, 2025
432bbb9
More changes
kmoscoe Nov 3, 2025
1154f25
more changes
kmoscoe Nov 3, 2025
ece8882
more changes
kmoscoe Nov 3, 2025
205cb04
Merge branch 'datacommonsorg:master' into master
kmoscoe Nov 3, 2025
d695244
Merge branch 'datacommonsorg:master' into mcp
kmoscoe Nov 3, 2025
764ea9f
Merge branch 'mcp' of https://github.com/kmoscoe/docsite into mcp
kmoscoe Nov 3, 2025
f81946b
Update mcp/run_tools.md
kmoscoe Nov 3, 2025
1fb1640
implement suggestions from Christie
kmoscoe Nov 3, 2025
c5fd5fe
Merge branch 'mcp' of https://github.com/kmoscoe/docsite into mcp
kmoscoe Nov 3, 2025
90ddfc3
Add some bullets to comparison section
kmoscoe Nov 3, 2025
a9ad87f
Fix update section
kmoscoe Nov 3, 2025
4930a5b
rename "prompt" to "context"
kmoscoe Nov 4, 2025
3daf24f
Merge branch 'master' of https://github.com/datacommonsorg/docsite
kmoscoe Nov 5, 2025
7599eff
Merge branch 'datacommonsorg:master' into master
kmoscoe Nov 5, 2025
4dd0251
Merge branch 'master' of https://github.com/kmoscoe/docsite
kmoscoe Nov 5, 2025
54ca4cf
Remove unused file
kmoscoe Nov 5, 2025
5ab6c5c
Merge branch 'master' of https://github.com/datacommonsorg/docsite
kmoscoe Nov 11, 2025
bb278f8
Merge branch 'master' of https://github.com/datacommonsorg/docsite in…
kmoscoe Nov 11, 2025
9fa9f0f
add mention of Gemini CLI extension for custom DC
kmoscoe Nov 12, 2025
c3edbe0
Merge branch 'datacommonsorg:master' into mcp
kmoscoe Nov 12, 2025
977ea45
Merge branch 'mcp' of https://github.com/kmoscoe/docsite into mcp
kmoscoe Nov 12, 2025
6c2bd5c
Update custom DC vars procedure
kmoscoe Nov 17, 2025
4d67fc6
Remove reference to .env file in extension run
kmoscoe Nov 21, 2025
9a34f12
Merge branch 'master' into mcp
kmoscoe Nov 21, 2025
1c2a36c
Merge branch 'datacommonsorg:master' into master
kmoscoe Nov 24, 2025
2bb5ca3
slight fix
kmoscoe Nov 24, 2025
e3a7193
Add section on creating a custom extension
kmoscoe Nov 24, 2025
25cad3a
Some rewording
kmoscoe Nov 25, 2025
7c71b3a
Fix formatting
kmoscoe Nov 25, 2025
8dd7f75
More revisions and edits
kmoscoe Nov 25, 2025
9ea74cd
Merge branch 'datacommonsorg:master' into mcp
kmoscoe Nov 25, 2025
9f58ec3
Merge branch 'mcp' of https://github.com/kmoscoe/docsite into mcp
kmoscoe Nov 25, 2025
ab6fb59
Remove file from other branch
kmoscoe Nov 25, 2025
9bc3f7f
minor edits
kmoscoe Nov 25, 2025
2fac33b
Merge branch 'master' of https://github.com/datacommonsorg/docsite in…
kmoscoe Nov 25, 2025
5d2800b
Merge branch 'datacommonsorg:master' into master
kmoscoe Nov 25, 2025
ff33361
Merge branch 'master' into mcp
kmoscoe Dec 2, 2025
45e8a57
Merge branch 'master' of https://github.com/datacommonsorg/docsite in…
kmoscoe Dec 3, 2025
f99cd81
Add Windows command
kmoscoe Dec 3, 2025
b2cbfd4
Merge branch 'datacommonsorg:master' into master
kmoscoe Dec 3, 2025
482c650
Merge branch 'datacommonsorg:master' into mcp
kmoscoe Dec 3, 2025
fdeea2e
Merge branch 'mcp' of https://github.com/kmoscoe/docsite into mcp
kmoscoe Dec 3, 2025
5a6fb16
Merge branch 'master' of https://github.com/datacommonsorg/docsite in…
kmoscoe Dec 9, 2025
494375d
Merge branch 'datacommonsorg:master' into master
kmoscoe Dec 9, 2025
0323953
Add warning about nvm
kmoscoe Dec 9, 2025
5f9dcca
Remove warning
kmoscoe Dec 9, 2025
b5ddb9c
Remove reference to node.js
kmoscoe Dec 9, 2025
c09b44c
Update mcp/run_tools.md
kmoscoe Dec 9, 2025
f4da5c3
Merge branch 'datacommonsorg:master' into master
kmoscoe Dec 9, 2025
73c0d41
Merge branch 'datacommonsorg:master' into master
kmoscoe Dec 9, 2025
735db87
Merge branch 'datacommonsorg:master' into master
kmoscoe Dec 16, 2025
9f9a9bd
Merge branch 'datacommonsorg:master' into mcp
kmoscoe Dec 16, 2025
6bb745c
Add required header to connect to a remote server
kmoscoe Dec 17, 2025
7ededf3
Add additional accept type
kmoscoe Dec 17, 2025
1550ed8
Add code for sample agent headers
kmoscoe Dec 17, 2025
75f5150
Apply suggestion from @gemini-code-assist[bot]
kmoscoe Dec 17, 2025
6395a67
Remove headers from basic agent
kmoscoe Dec 17, 2025
d165d9e
Merge branch 'datacommonsorg:master' into master
kmoscoe Dec 17, 2025
fe34778
Merge branch 'datacommonsorg:master' into mcp
kmoscoe Dec 17, 2025
0ca77f9
Merge branch 'mcp' of https://github.com/kmoscoe/docsite into mcp
kmoscoe Dec 17, 2025
4559295
Merge branch 'master' of https://github.com/datacommonsorg/docsite
kmoscoe Dec 17, 2025
85d15a4
Merge branch 'master' of https://github.com/kmoscoe/docsite
kmoscoe Dec 17, 2025
1c114f1
Revert last change
kmoscoe Dec 17, 2025
4db9a2c
Start of deploying MCP server to GCP
kmoscoe Dec 30, 2025
98b3265
Complete rewrite of hosting MCP server content
kmoscoe Jan 7, 2026
2073fdb
more changes
kmoscoe Jan 8, 2026
c5f95b0
More changes
kmoscoe Jan 12, 2026
32bacd9
formatting fixes
kmoscoe Jan 12, 2026
44395c9
add reference to custom DC doc
kmoscoe Jan 12, 2026
c131f42
HTML fix
kmoscoe Jan 12, 2026
5640448
Update custom_dc/mcp_server_cloud.md
kmoscoe Jan 12, 2026
cfd71ad
Update custom_dc/mcp_server_cloud.md
kmoscoe Jan 12, 2026
6eabd20
Remove a redundant step
kmoscoe Jan 12, 2026
5a8511e
Merge branch 'mcp' of https://github.com/kmoscoe/docsite into mcp
kmoscoe Jan 12, 2026
97a8139
Merge changes from Code Assist
kmoscoe Jan 12, 2026
1f3d4c3
Remove specifics of scaling etc. and refer to Cloud Run docs instead
kmoscoe Jan 12, 2026
0d8a04b
rename file
kmoscoe Jan 13, 2026
887f81e
Fix broken link
kmoscoe Jan 13, 2026
b185be5
Merge branch 'master' of https://github.com/datacommonsorg/docsite in…
kmoscoe Jan 13, 2026
fd1356b
First round of changes for hosted MCP server
kmoscoe Jan 13, 2026
d80ed79
Merge branch 'master' of https://github.com/datacommonsorg/docsite
kmoscoe Jan 13, 2026
4593a3f
more changes
kmoscoe Jan 13, 2026
63fc208
First set of changes to run_tools file
kmoscoe Jan 13, 2026
b982f47
start of changes to custom DC docs
kmoscoe Jan 13, 2026
9fc7d41
More restructuring and file name change
kmoscoe Jan 14, 2026
59b01f4
More restructuring and expansion of custom DC doc
kmoscoe Jan 14, 2026
ca48c96
Restructure: move sample agent to separat page, and move local proced…
kmoscoe Jan 14, 2026
6184f92
Merge branch 'master' of https://github.com/datacommonsorg/docsite
kmoscoe Jan 14, 2026
73f2d57
Merge branch 'master' of https://github.com/datacommonsorg/docsite in…
kmoscoe Jan 14, 2026
dc6e212
Remove develop agent page and consolidate all self-hosted instruction…
kmoscoe Jan 14, 2026
f4988b2
More changes for hosted MCP
kmoscoe Jan 14, 2026
2c8351d
complete first draft of hosted MCP changes
kmoscoe Jan 20, 2026
1f02ad7
Update mcp/run_tools.md
kmoscoe Jan 20, 2026
3c634d8
Update mcp/run_tools.md
kmoscoe Jan 20, 2026
db863a1
Update mcp/run_tools.md
kmoscoe Jan 20, 2026
17f8a86
Update custom_dc/run_mcp_tools.md
kmoscoe Jan 20, 2026
0108a4b
fix grammatical errors
kmoscoe Jan 20, 2026
71496d4
minor changes
kmoscoe Jan 20, 2026
4d47452
minor changes
kmoscoe Jan 20, 2026
a91fbd9
minor fix
kmoscoe Jan 20, 2026
07e0282
Add way of setting the API key literally in settings.json
kmoscoe Jan 20, 2026
d1ead01
added tip about Gemini CLI env var
kmoscoe Jan 20, 2026
3b43807
Add another way of using the key in standalone mode
kmoscoe Jan 20, 2026
ba7f0b9
Rename custom DC file
kmoscoe Jan 27, 2026
bf1871d
Merge branch 'master' of https://github.com/datacommonsorg/docsite
kmoscoe Jan 28, 2026
2030013
Add MCP to API key reqs
kmoscoe Jan 28, 2026
40c0a9c
Merge branch 'master' into mcp
kmoscoe Feb 2, 2026
ae9df7e
Fix broken link
kmoscoe Feb 2, 2026
bef4af1
update stable release date
kmoscoe Feb 2, 2026
582a430
Merge branch 'mcp' of https://github.com/kmoscoe/docsite into mcp
kmoscoe Feb 2, 2026
5ec052e
markdown fix
kmoscoe Feb 3, 2026
c4bd5b9
Incorporate feedback from Carolyn
kmoscoe Feb 3, 2026
bc31b9c
Update graphic
kmoscoe Feb 3, 2026
750711a
Fix broken link
kmoscoe Feb 3, 2026
63d12c7
Removed references to custom DC
kmoscoe Feb 3, 2026
d9cab13
Update custom_dc/run_mcp_tools.md
kmoscoe Feb 4, 2026
15bd390
Update custom_dc/run_mcp_tools.md
kmoscoe Feb 4, 2026
8df11f4
Incorporate suggestions from Christie
kmoscoe Feb 4, 2026
afdac7a
Split self-hosted procedures into a separate page
kmoscoe Feb 4, 2026
a6b0791
various fixes
kmoscoe Feb 4, 2026
329fe2c
Merge branch 'datacommonsorg:master' into master
kmoscoe Feb 4, 2026
b791de1
Merge branch 'master' of https://github.com/kmoscoe/docsite into split
kmoscoe Feb 4, 2026
ddeac40
minor fixes
kmoscoe Feb 4, 2026
ed95a15
minor fix
kmoscoe Feb 4, 2026
9c14a10
Update mcp/host_server.md
kmoscoe Feb 4, 2026
c707dcb
Update mcp/host_server.md
kmoscoe Feb 4, 2026
2332ab4
tiny fix
kmoscoe Feb 4, 2026
fafafe2
Merge branch 'split' of https://github.com/kmoscoe/docsite into split
kmoscoe Feb 4, 2026
7a64e9e
Merge branch 'datacommonsorg:master' into split
kmoscoe Feb 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions custom_dc/run_mcp_tools.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
layout: default
title: Run an MCP server
title: Run MCP tools
nav_order: 9
parent: Build your own Data Commons
---

{:.no_toc}
# Run an MCP server
# Run MCP tools

To use Data Commons MCP tools with a Custom Data Commons, you must run your own instance of the Data Commons MCP server. This page describes how to run a server locally and in Google Cloud.
To use Data Commons MCP tools with a Custom Data Commons, you must run your own instance of the [Data Commons MCP server](https://pypi.org/project/datacommons-mcp/). This page describes how to run a server locally and in Google Cloud.

> **Important**:
> If you have not rebuilt your Data Commons image since the stable release of 2026-01-29, you must [sync to the latest stable release](/custom_dc/build_image.html#sync-code-to-the-stable-branch), [rebuild your image](/custom_dc/build_image.html#build-package) and [redeploy](/custom_dc/deploy_cloud.html#manage-your-service).
Expand All @@ -18,7 +18,7 @@ To use Data Commons MCP tools with a Custom Data Commons, you must run your own

## Run a local MCP server

You can use any AI agent to spawn a local MCP server as a subprocess, or start a standalone server and connect to it from any client. For the most part, the procedures to do so are the same as those provided in [Run your own MCP server](/mcp/run_tools.html#self-hosted). The main difference is that you must set additional environment variables, as described below.
You can use any AI agent to spawn a local MCP server as a subprocess, or start a standalone server and connect to it from any client. For the most part, the procedures to do so are the same as those provided in [Run your own MCP server](/mcp/host_server.html). The main difference is that you must set additional environment variables, as described below.

### Prerequisites

Expand All @@ -42,7 +42,7 @@ You can set variables in the following ways:

## Run the MCP Server in Google Cloud Platform

If you have built a custom agent or Gemini CLI extension which you want to make publicly available, this page describes how to run the [Data Commons MCP server](https://pypi.org/project/datacommons-mcp/) in the cloud, using Google Cloud Run.
If you have built a custom agent or Gemini CLI extension which you want to make publicly available, the following sections describe how to run the MCP server in the cloud, using Google Cloud Run.

Since setting up an MCP server is a simple, one-time setup, there's no need to use Terraform to manage it. Data Commons provides a prebuilt Docker image in the Artifact Registry, so you only need to set up a new Cloud Run service to point to it.

Expand Down Expand Up @@ -125,7 +125,7 @@ The following procedure sets up a bare-bones container service. To set additiona

### Connect to the server from a remote client

For details, see [Configure an agent to connect to the running server](/mcp/run_tools.html#standalone-client).
For details, see [Configure an agent to connect to the running server](/mcp/host_server.html#standalone-client).

The HTTP URL parameter is the Cloud Run App URL, if you are exposing the service directly, or a custom domain URL if you are using a load balancer and domain mapping.

Expand All @@ -143,6 +143,3 @@ This is a generic message that could indicate a number of configuration problems
- Be sure you have specified the `DC_API_KEY` environment variable.
- Be sure you have specified the correct service account.
- Try increasing the health check timeout.



159 changes: 159 additions & 0 deletions mcp/host_server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
---
layout: default
title: Run an MCP Server
nav_order: 3
parent: MCP - Query data interactively with an AI agent
---

{:.no_toc}
# Run a self-hosted MCP server

This page describes how to run your own local Data Commons MCP server and connect to it from an agent. This is useful for advanced use cases, such as developing your own custom AI agent/client to use with Data Commons.

For procedures for Custom Data Commons instances, please see instead [Run MCP tools](/custom_dc/run_mcp_tools.html).

* TOC
{:toc}

We provide procedures for the following scenarios:
- Local server and local agent: The agent spawns the server in a subprocess using Stdio as the transport protocol.
- Remote server and local agent: You start up the server as a standalone process and then connect the agent to it using streaming HTTP as the protocol.

For both scenarios, we use Gemini CLI and the sample agent as examples. You should be able to adapt the configurations to other MCP-compliant agents/clients.

> **Tip:** For an end-to-end tutorial using a locally running 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"}.

## Prerequisites

In addition to a [Data Commons API key](run_tools.md#prerequisites), you will need the following:

- Install `uv` for managing and installing Python packages; see the instructions at <https://docs.astral.sh/uv/getting-started/installation/>{: target="_blank"}.

## Run a local server and agent

### Gemini CLI

To instruct Gemini CLI to start up a local server using Stdio, replace the `datacommons-mcp` section in your `settings.json` file as follows:

<pre>
{
// ...
"mcpServers": {
"datacommons-mcp": {
"command": "uvx",
"args": [
"datacommons-mcp@latest",
"serve",
"stdio"
],
// Only needed if you have not set the key in your environment
"env": "<var>YOUR DC API KEY</var>"
}
}
// ...
}
</pre>

[Run Gemini CLI](run_tools.md#run-gemini) as usual.

### Sample agent

To instruct the sample agent to spawn a local server that uses the Stdio protocol, modify [`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:

```python
from google.adk.tools.mcp_tool.mcp_toolset import (
McpToolset,
StdioConnectionParams,
StdioServerParameters,
)

#...

root_agent = LlmAgent(
model=AGENT_MODEL,
name="basic_agent",
instruction=AGENT_INSTRUCTIONS,
tools=[
McpToolset(
connection_params=StdioConnectionParams(
timeout=10,
server_params=StdioServerParameters(
command="uvx",
args=["datacommons-mcp", "serve", "stdio"],
env={"DC_API_KEY": DC_API_KEY}
)
)
)
],
)
```
[Run the startup commands](run_tools.md#run-sample) as usual.

## Run a remote server and a local agent

{: #standalone}
### Step 1: Start the server as a standalone process

1. Be sure to set the API key as an [environment variable](run_tools.md#prerequisites).
2. Run:
<pre>
uvx datacommons-mcp serve http [--host <var>HOSTNAME</var>] [--port <var>PORT</var>]
</pre>
By default, the host is `localhost` and the port is `8080` if you don't set these flags explicitly.

The server is addressable with the endpoint `mcp`. For example, `http://my-mcp-server:8080/mcp`.

{: #standalone-client}
### Step 2: Configure an agent to connect to the running server

#### Gemini CLI

Replace the `datacommons-mcp` section in your `settings.json` file as follows:
<pre>
{
"mcpServers": {
"datacommons-mcp": {
"httpUrl": "http://<var>HOST</var>:<var>PORT</var>/mcp",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json, text/event-stream"
// If you have set the key in your environment
, "X-API-Key": "$DC_API_KEY"
// If you have not set the key in your environment
, "X-API-Key": "<var>YOUR DC API KEY</var>"
}
Comment thread
kmoscoe marked this conversation as resolved.
}
}
}
</pre>

[Run Gemini CLI](run_tools.md#run-gemini) as usual.

#### Sample agent

Modify [`basic_agent/agent.py`](https://github.com/datacommonsorg/agent-toolkit/blob/main/packages/datacommons-mcp/examples/sample_agents/basic_agent/agent.py){: target="_blank"} as follows:

<pre>
from google.adk.tools.mcp_tool.mcp_toolset import (
MCPToolset,
StreamableHTTPConnectionParams
)

root_agent = LlmAgent(
# ...
tools=[McpToolset(
connection_params=StreamableHTTPConnectionParams(
url="http://<var>HOST</var>:<var>PORT</var>/mcp",
headers={
"Content-Type": "application/json",
"Accept": "application/json, text/event-stream"
}
)
)
],
)
</pre>

[Run the startup commands](run_tools.md#run-sample) as usual.

<script src="/assets/js/customdc-doc-tabs.js"></script>
4 changes: 2 additions & 2 deletions mcp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ The server currently supports the following tools:

## Clients

To connect to the Data Commons MCP Server, you can use any available AI application that supports MCP, or your own custom agent.
To connect to the Data Commons MCP Server, you can use any available AI application that supports MCP, or your own custom agent. See [Use MCP tools](run_tools.md) for procedures for using [Gemini CLI](https://github.com/google-gemini/gemini-cli) and the [Gemini CLI Data Commons extension](https://geminicli.com/extensions/) with the hosted server.

For self-hosted deployments, the server supports both standard MCP [transport protocols](https://modelcontextprotocol.io/docs/learn/architecture#transport-layer):
- Streamable HTTP: For clients that connect remotely or otherwise require HTTP (e.g. Typescript)
- Stdio: For clients that connect directly using local processes

See [Run MCP tools](run_tools.md) for procedures for using [Gemini CLI](https://github.com/google-gemini/gemini-cli) and the [Gemini CLI Data Commons extension](https://geminicli.com/extensions/).
If you're interested in this option, see [Run a self-hosted MCP server](host_server.md) for procedures.

## Unsupported features

Expand Down
Loading
Loading