Skip to main content

Notion auth and project binding for Codex, Claude Code, and other MCP clients.

Project description

Agent Labbook

Agent Labbook is the Notion connection layer for Codex, Claude Code, and other MCP clients. It handles Notion auth for a project, lets you choose which pages or data sources belong to that project, stores bindings in .labbook/, keeps long-lived tokens in a shared credential provider, and returns the API context your agent needs to call Notion directly.

It is not a full Notion SDK. After setup, your agent should use the official Notion API directly.

Main Features

  • Connect a repo to specific Notion pages or data sources for an agent.
  • Reuse saved Notion credentials across projects.
  • Bind only the pages or data sources a project should use.
  • Return access tokens, headers, and bound resource IDs for the official Notion API.
  • Work with Codex, Claude Code, and other MCP-capable clients.

Install

Requirements:

  • Python 3.10 or newer
  • uv
  • a Codex, Claude Code, or another MCP-capable client

Recommended:

codex mcp add labbook -- uvx agent-labbook mcp
claude mcp add --scope project labbook -- uvx agent-labbook mcp

Or use the checked-in .mcp.json when this repo is the MCP source.

Use

  1. Read labbook://agent-labbook/project/status or run notion_status.
  2. Reuse a saved credential when available, or start auth with notion_auth_browser or notion_start_headless_auth.
  3. Choose the pages or data sources that belong to the project, then finish the handoff with notion_status and notion_finalize_pending_auth when needed.
  4. Read labbook://agent-labbook/project/bindings or run notion_list_bindings to inspect the bound roots.
  5. Run notion_get_api_context and use the returned token, headers, and resource IDs with the official Notion API.

If your content already exists as markdown, prefer Notion's markdown content APIs:

  • POST /v1/pages with markdown
  • GET /v1/pages/{page_id}/markdown
  • PATCH /v1/pages/{page_id}/markdown

Reference: https://developers.notion.com/guides/data-apis/working-with-markdown-content

Notes

  • .labbook/ should never be committed.
  • This repo handles auth and project binding, not general Notion API wrapping.
  • For self-hosting, see docs/self-host.md.
  • For versioning details, see docs/versioning.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_labbook-0.14.7.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_labbook-0.14.7-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file agent_labbook-0.14.7.tar.gz.

File metadata

  • Download URL: agent_labbook-0.14.7.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agent_labbook-0.14.7.tar.gz
Algorithm Hash digest
SHA256 e48e8bf84a5af0f43361e564d8aa328546574d22998066fc12897bc1b6596633
MD5 36ace4424befe5ec50e3fc9153729583
BLAKE2b-256 59f10556da2652b8a076f262dcdca3076c27604c07ea059af100458498fb8dcc

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_labbook-0.14.7.tar.gz:

Publisher: publish-pypi.yml on binbinsh/agent-labbook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_labbook-0.14.7-py3-none-any.whl.

File metadata

  • Download URL: agent_labbook-0.14.7-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agent_labbook-0.14.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7d9234caa57241f78c1ebb35f8fe6b45dc99e77ca4bcdd44d347530011a56452
MD5 aef37e593370a503cc3c4735958cb1df
BLAKE2b-256 558fdda7e576c1213386b158a833feb6615cf7ba8632000b77e7b4120c5c68ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_labbook-0.14.7-py3-none-any.whl:

Publisher: publish-pypi.yml on binbinsh/agent-labbook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page