Notion Internal Integration binding for Codex, Claude Code, and other MCP clients.
Project description
Notion Agent Labbook
agent-labbook is a local MCP server that lets Codex, Claude Code, OpenCode, and other MCP clients use a Notion Internal Integration directly.
No OAuth, no hosted broker, no cloud worker. You connect Notion once, store the Internal Integration secret locally, bind the pages or data sources you want, and then call the official Notion API.
What It Does
- Stores your Notion Internal Integration secret in the system keychain or 1Password
- Lets an MCP client search, discover, and bind specific Notion pages or data sources
- Returns API headers and bound resource IDs for direct Notion API calls
- Provides a browser-based resource chooser for desktop environments
1. Create A Notion Internal Integration
Create a Notion Internal Integration here:
- Notion integrations dashboard: notion.so/my-integrations
- Notion guide: Create a Notion integration
After creating it:
- Copy the
Internal Integration Secretfrom theConfigurationtab. - Share the target Notion pages or data sources with the integration.
2. Set The Token
Recommended on a workstation:
uvx agent-labbook configure-secret --storage keychain
Optional 1Password flow:
uvx agent-labbook configure-secret --storage 1password --op-vault Private
CI or temporary override:
export NOTION_AGENT_LABBOOK_TOKEN=secret_xxx
Default policy:
keychainis the default local backend1passwordis opt-inNOTION_AGENT_LABBOOK_TOKENis for CI or temporary overrides
3. Install The MCP Server
Codex:
codex mcp add labbook -- uvx agent-labbook mcp
Or add it directly to your ~/.codex/config.toml:
[mcp_servers.labbook]
command = "uvx"
args = ["agent-labbook", "mcp"]
Claude Code (project scope, writes to .mcp.json):
claude mcp add --scope local labbook -- uvx agent-labbook mcp
Claude Code (user scope, writes to ~/.claude.json):
claude mcp add --scope user labbook -- uvx agent-labbook mcp
OpenCode or other MCP clients:
{
"mcpServers": {
"labbook": {
"command": "uvx",
"args": ["agent-labbook", "mcp"]
}
}
}
You can also generate the config with:
uvx agent-labbook print-mcp-config
4. Use It
Typical flow:
- Call
notion_statusto check the current project state. - Bind resources with
notion_bind_resource_urlsfor exact links,notion_open_binding_browseron desktop, ornotion_search_resourcesplusnotion_discover_childrenin headless environments. - Call
notion_get_api_contextonly when you are ready to use the official Notion API.
MCP Surface Reference
Tools (12)
| Tool | Description | Read-only | Destructive |
|---|---|---|---|
notion_status |
Read the current Internal Integration auth, storage backend, and bindings status for this project. | Yes | No |
notion_setup_guide |
Return the setup guide for the Internal Integration workflow. | Yes | No |
notion_prepare_internal_integration |
Open the Notion integrations dashboard and detect available local storage backends before collecting the Internal Integration Secret. | No | No |
notion_configure_internal_integration |
Validate and store a Notion Internal Integration secret for this project. | No | No |
notion_search_resources |
Search the pages and data sources that the Internal Integration bot can access. | Yes | No |
notion_discover_children |
Inspect the immediate child pages or entries beneath a specific page or data source. | Yes | No |
notion_bind_resource_urls |
Bind one or more Notion page or data source URLs directly. | No | No |
notion_bind_resources |
Bind one or more Notion pages or data sources by reference. | No | No |
notion_open_binding_browser |
Start a local browser-based chooser for selecting Notion roots. | No | No |
notion_list_bindings |
List the Notion resources currently bound to this project. | Yes | No |
notion_get_api_context |
Return the Internal Integration secret, official Notion API headers, and bound resource IDs for direct API calls. | Yes | No |
notion_clear_project_auth |
Remove the saved project-local session and delete the stored keychain or 1Password secret. | No | Yes |
Resources (3)
| Resource | URI | MIME Type | Description |
|---|---|---|---|
| Notion Setup Guide | labbook://setup-guide |
text/markdown |
Static setup guidance for using a Notion Internal Integration secret. |
| Notion Project Status | labbook://project/status |
application/json |
Read-only JSON snapshot of the current project's auth, storage backend, and bindings state. |
| Notion Project Bindings | labbook://project/bindings |
application/json |
Read-only JSON snapshot of the current project's bound Notion resources. |
Resource Templates (2)
| Template | URI Pattern | MIME Type | Description |
|---|---|---|---|
| Project Status By Root | labbook://project/status?project_root={project_root} |
application/json |
Read-only JSON project status for an explicit project root. |
| Project Bindings By Root | labbook://project/bindings?project_root={project_root} |
application/json |
Read-only JSON bindings for an explicit project root. |
Prompts (2)
| Prompt | Description |
|---|---|
notion_connect_project |
Recommended workflow for connecting the current project to Notion with an Internal Integration secret. |
notion_use_bound_resources |
Recommended workflow for checking bindings and calling the official Notion API with the project's configured secret. |
CLI Commands
| Command | Description |
|---|---|
agent-labbook mcp |
Run the MCP stdio server. |
agent-labbook configure-secret |
Prompt for the Notion Internal Integration secret and store it locally. Supports --storage, --op-vault, --op-item-title. |
agent-labbook doctor |
Inspect local Notion Agent Labbook state and print diagnostics as JSON. |
agent-labbook print-mcp-config |
Print a reusable uvx-based MCP server config snippet. |
Notes
.labbook/stores project-local metadata and bindings, not the secret itself.notion_get_api_contextreturns the secret. Use it only for real API calls.NOTION_AGENT_LABBOOK_TOKENoverrides stored local credentials for the current process.- The MCP server runs over stdio transport only. No HTTP/SSE transport is exposed.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_labbook-0.19.1.tar.gz.
File metadata
- Download URL: agent_labbook-0.19.1.tar.gz
- Upload date:
- Size: 63.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe25770dd567160626ebf008b7d42c08e313760449afca1eb6751c00790136c5
|
|
| MD5 |
5a8ba6377c36c39e67973e07bf82acfe
|
|
| BLAKE2b-256 |
087c879de7d2040bee1f0a4e3b38adc797d2675b72f013fa5ae64a0e443ae6d8
|
Provenance
The following attestation bundles were made for agent_labbook-0.19.1.tar.gz:
Publisher:
publish-pypi.yml on binbinsh/agent-labbook
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_labbook-0.19.1.tar.gz -
Subject digest:
fe25770dd567160626ebf008b7d42c08e313760449afca1eb6751c00790136c5 - Sigstore transparency entry: 1309617506
- Sigstore integration time:
-
Permalink:
binbinsh/agent-labbook@301f6bd71b5a17ea969862f00a7f1fc29ad1d114 -
Branch / Tag:
refs/tags/v0.19.1 - Owner: https://github.com/binbinsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@301f6bd71b5a17ea969862f00a7f1fc29ad1d114 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_labbook-0.19.1-py3-none-any.whl.
File metadata
- Download URL: agent_labbook-0.19.1-py3-none-any.whl
- Upload date:
- Size: 56.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
696f1c72b036479a8b569b49854a389e4bef8e4e02a75f6d211bd807eea03e29
|
|
| MD5 |
72a9edbc26d37a2bf90287994fa1e47a
|
|
| BLAKE2b-256 |
2f8030877a51dee97b09ce24611e600d60da97609d1ed1d3dddb2ced607c5692
|
Provenance
The following attestation bundles were made for agent_labbook-0.19.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on binbinsh/agent-labbook
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_labbook-0.19.1-py3-none-any.whl -
Subject digest:
696f1c72b036479a8b569b49854a389e4bef8e4e02a75f6d211bd807eea03e29 - Sigstore transparency entry: 1309617607
- Sigstore integration time:
-
Permalink:
binbinsh/agent-labbook@301f6bd71b5a17ea969862f00a7f1fc29ad1d114 -
Branch / Tag:
refs/tags/v0.19.1 - Owner: https://github.com/binbinsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@301f6bd71b5a17ea969862f00a7f1fc29ad1d114 -
Trigger Event:
push
-
Statement type: