chore: import upstream snapshot with attribution
Continuous Integration / Pre-commit Linter (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.10) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.11) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.12) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.13) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.10) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.11) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.12) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.13) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.14) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.10) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.11) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.12) (push) Has been cancelled
Copybara PR Handler / close-imported-pr (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.13) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.14) (push) Has been cancelled
Continuous Integration / Pre-commit Linter (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.10) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.11) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.12) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.13) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.10) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.11) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.12) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.13) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.14) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.10) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.11) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.12) (push) Has been cancelled
Copybara PR Handler / close-imported-pr (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.13) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.14) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
# Config-based Agent Sample - MCP Toolset with Notion MCP Server
|
||||
|
||||
This sample demonstrates how to configure an ADK agent to use the Notion MCP server for interacting with Notion pages and databases.
|
||||
|
||||
## Setup Instructions
|
||||
|
||||
### 1. Create a Notion Integration
|
||||
|
||||
1. Go to [Notion Integrations](https://www.notion.so/my-integrations)
|
||||
1. Click "New integration"
|
||||
1. Give it a name and select your workspace
|
||||
1. Copy the "Internal Integration Secret" (starts with `ntn_`)
|
||||
|
||||
For detailed setup instructions, see the [Notion MCP Server documentation](https://www.npmjs.com/package/@notionhq/notion-mcp-server).
|
||||
|
||||
### 2. Configure the Agent
|
||||
|
||||
Replace `<your_notion_token>` in `root_agent.yaml` with your actual Notion integration token:
|
||||
|
||||
```yaml
|
||||
env:
|
||||
OPENAPI_MCP_HEADERS: '{"Authorization": "Bearer secret_your_actual_token_here", "Notion-Version": "2022-06-28"}'
|
||||
```
|
||||
|
||||
### 3. Grant Integration Access
|
||||
|
||||
**Important**: After creating the integration, you must grant it access to specific pages and databases:
|
||||
|
||||
1. Go to `Access` tab in [Notion Integrations](https://www.notion.so/my-integrations) page
|
||||
1. Click "Edit access"
|
||||
1. Add pages or databases as needed
|
||||
|
||||
### 4. Run the Agent
|
||||
|
||||
Use the `adk web` to run the agent and interact with your Notion workspace.
|
||||
|
||||
## Example Queries
|
||||
|
||||
- "What can you do for me?"
|
||||
- "Search for 'project' in my pages"
|
||||
- "Create a new page called 'Meeting Notes'"
|
||||
- "List all my databases"
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If you get "Unauthorized" errors, check that your token is correct
|
||||
- If you get "Object not found" errors, ensure you've granted the integration access to the specific pages/databases
|
||||
- Make sure the Notion API version in the headers matches what the MCP server expects
|
||||
@@ -0,0 +1,30 @@
|
||||
# Copyright 2026 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/google/adk-python/refs/heads/main/src/google/adk/agents/config_schemas/AgentConfig.json
|
||||
name: notion_agent
|
||||
model: gemini-2.5-flash
|
||||
instruction: |
|
||||
You are my workspace assistant. Use the provided tools to read, search, comment on, or create
|
||||
Notion pages. Ask clarifying questions when unsure.
|
||||
tools:
|
||||
- name: MCPToolset
|
||||
args:
|
||||
stdio_server_params:
|
||||
command: "npx"
|
||||
args:
|
||||
- "-y"
|
||||
- "@notionhq/notion-mcp-server"
|
||||
env:
|
||||
OPENAPI_MCP_HEADERS: '{"Authorization": "Bearer <your_notion_token>", "Notion-Version": "2022-06-28"}'
|
||||
Reference in New Issue
Block a user