Catalog PyPI
PACKAGE EXPLORERView in registry

agent-labbook

PyPI

Notion Internal Integration binding for Codex, Claude Code, and other MCP clients.

claude-codecodexinternal-integrationmcpnotion
Versions collected1
Direct dependencies3From release 0.19.13
Last observed20 Oct, 22:32 UTC

README

Version 0.19.13 documentation

Notion Agent Labbook

CI PyPI Python License: MIT

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 local system keychain
  • 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:

After creating it:

  1. Copy the Internal Integration Secret from the Configuration tab.
  2. 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

CI or temporary override:

export NOTION_AGENT_LABBOOK_TOKEN=secret_xxx

Default policy:

  • keychain is the default local backend
  • NOTION_AGENT_LABBOOK_TOKEN is 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:

  1. Call notion_status to check the current project state.
  2. Bind resources with notion_bind_resource_urls for exact links, notion_start_binding_server to hand the user a chooser URL, or notion_search_resources plus notion_discover_children in headless environments.
  3. Call notion_get_api_context only when you are ready to use the official Notion API.

MCP Surface Reference

Tools (12)

ToolDescriptionRead-onlyDestructive
notion_statusRead the current Internal Integration auth, storage backend, and bindings status for this project.YesNo
notion_setup_guideReturn the setup guide for the Internal Integration workflow.YesNo
notion_prepare_internal_integrationOpen the Notion integrations dashboard and detect available local storage backends before collecting the Internal Integration Secret.NoNo
notion_configure_internal_integrationValidate and store a Notion Internal Integration secret for this project.NoNo
notion_search_resourcesSearch the pages and data sources that the Internal Integration bot can access.YesNo
notion_discover_childrenInspect the immediate child pages or entries beneath a specific page or data source.YesNo
notion_bind_resource_urlsBind one or more Notion page or data source URLs directly.NoNo
notion_bind_resourcesBind one or more Notion pages or data sources by reference.NoNo
notion_start_binding_serverStart a local binding chooser HTTP server (agent shares the URL; never launches a browser).NoNo
notion_list_bindingsList the Notion resources currently bound to this project.YesNo
notion_get_api_contextReturn the Internal Integration secret, official Notion API headers, and bound resource IDs for direct API calls.YesNo
notion_clear_project_authRemove the saved project-local session and delete the stored keychain secret.NoYes

Resources (3)

ResourceURIMIME TypeDescription
Notion Setup Guidelabbook://setup-guidetext/markdownStatic setup guidance for using a Notion Internal Integration secret.
Notion Project Statuslabbook://project/statusapplication/jsonRead-only JSON snapshot of the current project's auth, storage backend, and bindings state.
Notion Project Bindingslabbook://project/bindingsapplication/jsonRead-only JSON snapshot of the current project's bound Notion resources.

Resource Templates (2)

TemplateURI PatternMIME TypeDescription
Project Status By Rootlabbook://project/status?project_root={project_root}application/jsonRead-only JSON project status for an explicit project root.
Project Bindings By Rootlabbook://project/bindings?project_root={project_root}application/jsonRead-only JSON bindings for an explicit project root.

Prompts (2)

PromptDescription
notion_connect_projectRecommended workflow for connecting the current project to Notion with an Internal Integration secret.
notion_use_bound_resourcesRecommended workflow for checking bindings and calling the official Notion API with the project's configured secret.

CLI Commands

CommandDescription
agent-labbook mcpRun the MCP stdio server.
agent-labbook configure-secretPrompt for the Notion Internal Integration secret and store it locally. Supports --storage.
agent-labbook doctorInspect local Notion Agent Labbook state and print diagnostics as JSON.
agent-labbook print-mcp-configPrint a reusable uvx-based MCP server config snippet.

Notes

  • .labbook/ stores project-local metadata and bindings, not the secret itself.
  • notion_get_api_context returns the secret. Use it only for real API calls.
  • NOTION_AGENT_LABBOOK_TOKEN overrides stored local credentials for the current process.
  • The MCP server runs over stdio transport only. No HTTP/SSE transport is exposed.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.19.1316 Apr 20263

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
binbinsh/agent-labbook

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:32 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:1cc34a2252a9b9fa9ab9387f388bdf34072f8d987f27c10fa91c890629b0629f