Skip to main content
The Notion provider fetches pages from your Notion workspace. It uses Notion’s hosted MCP server for authentication, handling OAuth automatically on first use.

Quick Start

The Notion provider works without configuration. OAuth is triggered automatically when you first access Notion:
{{ colin.notion.page("https://notion.so/My-Page-abc123").content }}
{{ colin.notion.page("abc123def456").content }}
Search your workspace for pages matching a query:
{% for page in colin.notion.search("onboarding") %}
## {{ page.title }}

{{ page.content }}
{% endfor %}

Configuration

The Notion provider requires no configuration. Add it to your project to enable Notion access:
colin.toml
[[providers.notion]]
# No configuration needed
# OAuth flow triggered automatically on first use
On first use, Colin opens a browser window for Notion OAuth authentication. After authorization, credentials are cached at ~/.colin/mcp-oauth/. If you encounter authentication errors, clear your OAuth tokens and re-authenticate:
colin mcp auth clear

Template Functions

FunctionPurpose
page()Fetch a single page by URL or ID
search()Search for pages matching a query

page()

Fetch a Notion page by its URL or page ID:
{# By URL #}
{{ colin.notion.page("https://notion.so/My-Page-abc123").content }}

{# By page ID #}
{{ colin.notion.page("abc123def456").content }}

{# Access metadata #}
{% set page = colin.notion.page("abc123") %}
Title: {{ page.title }}
Last edited: {{ page.last_edited_time }}
{{ page.content }}
Arguments:
ArgumentRequiredDefaultDescription
url_or_idYesNotion page URL or page ID
watchNoTrueTrack for staleness detection
Returns a NotionPageResource with page content and metadata. Search your Notion workspace for pages matching a query:
{% for page in colin.notion.search("product requirements") %}
## {{ page.title }}

{{ page.content }}

---
{% endfor %}
Arguments:
ArgumentRequiredDefaultDescription
queryYesSearch query string
limitNo20Maximum number of results to return
watchNoTrueTrack for staleness detection
Returns a NotionSearchResource containing matching pages (up to limit).

Objects

NotionPageResource

Returned by page() and included in search results:
PropertyTypeDescription
contentstrPage content as markdown
page_idstrNotion page ID
titlestrPage title
urlstrNotion page URL
last_edited_timedatetimeWhen the page was last modified
created_timedatetimeWhen the page was created
is_archivedboolWhether the page is archived

NotionSearchResource

Returned by search():
PropertyTypeDescription
contentstrNewline-separated page titles
querystrThe search query used
pageslist[NotionPageResource]Matching pages (with search highlights as content)
Supports iteration and length:
Found {{ colin.notion.search("docs") | length }} pages

{% for page in colin.notion.search("docs") %}
- {{ page.title }}
{% endfor %}
Note: Search results contain highlights, not full page content. Use page() to fetch full content:
{% for result in colin.notion.search("api docs") %}
## {{ result.title }}
{{ colin.notion.page(result.page_id).content }}
{% endfor %}

Dependency Tracking

Both page() and search() track dependencies by default. Documents recompile when tracked content changes:
{# Recompiles when the page is edited #}
{{ colin.notion.page("abc123").content }}

{# Recompiles when any search result changes #}
{% for page in colin.notion.search("api docs") %}
{{ page.content }}
{% endfor %}
Opt out of tracking with watch=False:
{{ colin.notion.page("abc123", watch=False).content }}
{{ colin.notion.search("docs", watch=False) }}

Staleness Detection

The Notion provider uses last_edited_time for staleness detection. When a tracked page is edited in Notion, the document is marked stale and recompiled on the next build.

Examples

Build Agent Skills from Notion Docs

Create agent skills from your team’s documentation:
models/onboarding-skill.md
---
name: Onboarding Skill
description: Company onboarding information
---

# Onboarding Guide

{% for page in colin.notion.search("onboarding") %}
## {{ page.title }}

{{ page.content }}

{% endfor %}

Include a Specific Page

Reference a single page of documentation:
models/api-reference.md
---
name: API Reference
---

{{ colin.notion.page("https://notion.so/API-Docs-abc123").content }}

Generate Index from Search Results

Create an index of all pages matching a topic:
models/product-index.md
---
name: Product Documentation Index
---

# Product Documentation

{% set results = colin.notion.search("product") %}

Found {{ results | length }} documents:

{% for page in results %}
- [{{ page.title }}]({{ page.url }}) — Last updated: {{ page.last_edited_time.strftime("%Y-%m-%d") }}
{% endfor %}

Conditional Content Based on Page Status

Filter out archived pages:
{% for page in colin.notion.search("specs") %}
{% if not page.is_archived %}
{{ page.content }}
{% endif %}
{% endfor %}