Skip to content

Commit 2c088ac

Browse files
Jacksunweicopybara-github
authored andcommitted
docs: Fixes root_agent.yaml in tool_mcp_stdio_notion_config for Agent Config sample and add README.md
PiperOrigin-RevId: 798241478
1 parent 7fe6064 commit 2c088ac

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Config-based Agent Sample - MCP Toolset with Notion MCP Server
2+
3+
This sample demonstrates how to configure an ADK agent to use the Notion MCP server for interacting with Notion pages and databases.
4+
5+
## Setup Instructions
6+
7+
### 1. Create a Notion Integration
8+
9+
1. Go to [Notion Integrations](https://www.notion.so/my-integrations)
10+
2. Click "New integration"
11+
3. Give it a name and select your workspace
12+
4. Copy the "Internal Integration Secret" (starts with `ntn_`)
13+
14+
For detailed setup instructions, see the [Notion MCP Server documentation](https://www.npmjs.com/package/@notionhq/notion-mcp-server).
15+
16+
### 2. Configure the Agent
17+
18+
Replace `<your_notion_token>` in `root_agent.yaml` with your actual Notion integration token:
19+
20+
```yaml
21+
env:
22+
OPENAPI_MCP_HEADERS: '{"Authorization": "Bearer secret_your_actual_token_here", "Notion-Version": "2022-06-28"}'
23+
```
24+
25+
### 3. Grant Integration Access
26+
27+
**Important**: After creating the integration, you must grant it access to specific pages and databases:
28+
29+
1. Go to `Access` tab in [Notion Integrations](https://www.notion.so/my-integrations) page
30+
2. Click "Edit access"
31+
3. Add pages or databases as needed
32+
33+
### 4. Run the Agent
34+
35+
Use the `adk web` to run the agent and interact with your Notion workspace.
36+
37+
## Example Queries
38+
39+
- "What can you do for me?"
40+
- "Search for 'project' in my pages"
41+
- "Create a new page called 'Meeting Notes'"
42+
- "List all my databases"
43+
44+
## Troubleshooting
45+
46+
- If you get "Unauthorized" errors, check that your token is correct
47+
- If you get "Object not found" errors, ensure you've granted the integration access to the specific pages/databases
48+
- Make sure the Notion API version in the headers matches what the MCP server expects

contributing/samples/tool_mcp_stdio_notion_config/root_agent.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ tools:
1313
- "-y"
1414
- "@notionhq/notion-mcp-server"
1515
env:
16-
OPENAPI_MCP_HEADERS: "{'Authorization': 'Bearer fake_notion_api_key', 'Notion-Version': '2022-06-28'}"
16+
OPENAPI_MCP_HEADERS: '{"Authorization": "Bearer <your_notion_token>", "Notion-Version": "2022-06-28"}'

0 commit comments

Comments
 (0)