Search, read, query, and safely write Notion pages and databases through the saved notion OAuth integration.
- notion
- oauth
- workspace
- pages
- databases
- search
- License
- MIT
- Published
- July 21, 2026
- Pinned commit
2f9fddc- Rating
- No ratings yet
- Forks
- 3
- Stars
- 0
- Adaptation effort
- —
One-click install
Install forks this package into your account and publishes it right away when it passes the standard package checks. An admin reviewed and trusted this exact version.
Log in to install this package.
Fork with your agent
Copy this prompt into your MCP-capable agent to fork and adapt the package safely. Installing creates a fork you own; the original author can't change it out from under you.
Use Kody to fork the community package "@kody/notion" (listing id: 601490f4-98dd-417c-9300-75ce489f8a6d). Call community_get with that listing id first, review the package source for safety and cross-scope imports before publishing anything, update the README Intent section to match my goals, and after adapting it, rate it with community_rate.
README
@kody/notion
Notion logo
Intent
Provide reusable, account-agnostic Notion helpers that let Kody search, read, and query the pages and databases shared with the connected Notion integration, and make explicitly confirmed writes, with a generic escape hatch for the rest of the Notion API.
Required setup
Create a Notion public integration and save a Kody OAuth integration named notion.
- Create an integration at
https://www.notion.so/profile/integrationsand set its type to Public. - Set the redirect URI to
https://heykody.dev/connect/oauth. - Save the integration in Kody with:
- Authorize URL:
https://api.notion.com/v1/oauth/authorize - Token URL:
https://api.notion.com/v1/oauth/token - API base:
https://api.notion.com/v1 - API host:
api.notion.com - Flow: confidential (token exchange uses Basic auth with a JSON body)
- Extra authorize params:
owner=user,response_type=code - Scopes: none (access is granted per page during the OAuth consent screen)
- Authorize URL:
- Connect or reconnect at
https://heykody.dev/connect/oauth?provider=notion.
During the OAuth flow, Notion asks which pages to share with the integration. Helpers can only see pages and databases the authorizing user shared.
Exports
kody:@kody/notion— package overview and safety metadatakody:@kody/notion/smoke-test— verify OAuth access without returning workspace or user PIIkody:@kody/notion/request— generic authenticated Notion API request; mutating calls requireconfirm: truekody:@kody/notion/search— search shared pages and data sources (objectType: 'page' | 'data_source')kody:@kody/notion/get-page— read a page's metadata and propertieskody:@kody/notion/get-block-children— read a page or block's content blockskody:@kody/notion/get-database— read a database container: title and its data sourceskody:@kody/notion/get-data-source— read a data source's schema/properties by data source idkody:@kody/notion/query-database— query rows; acceptsdataSourceIdordatabaseId(auto-resolves the single data source)kody:@kody/notion/create-page— preview or create a page; creating requiresconfirm: true;parent.database_idauto-resolves to the data sourcekody:@kody/notion/append-block-children— preview or append blocks; appending requiresconfirm: true; position viaposition: { type: 'after_block' | 'start' | 'end' }
Examples
import search from 'kody:@kody/notion/search'
export default async function main() {
return search({ query: 'meeting notes', objectType: 'page' })
}import createPage from 'kody:@kody/notion/create-page'
export default async function main() {
return createPage({
// database_id auto-resolves to the database's single data source
parent: { database_id: '00000000-0000-0000-0000-000000000000' },
properties: {
Name: { title: [{ text: { content: 'New page' } }] },
},
dryRun: true,
})
}Set confirm: true only after the user has explicitly approved the exact destination and content. A dry run never calls Notion.
API model (Notion-Version 2026-03-11)
All helpers pin Notion-Version 2026-03-11 (request accepts a notionVersion param to override for one-off calls). The modern model:
- Databases are containers; data sources hold the schema and rows.
get-databasereturns the container'sdata_sourceslist;get-data-sourcereturnsproperties; rows are queried viaPOST /data_sources/{id}/query. Helpers that takedatabaseIdauto-resolve the database's single data source and error if there are several. - Database-row pages need a data source parent (
parent: { data_source_id }).create-pageauto-convertsparent.database_idfor you. - Search returns
data_sourceobjects where databases used to appear; filter withobjectType: 'page' | 'data_source'. - Block positioning uses
position: { type: 'after_block', after_block: { id } }(orstart/end) — the flatafterparameter is gone. - Trash is
in_trash— thearchivedfield no longer exists in requests or responses. - To create an inline child database on a page (e.g. a per-page gallery), use
requestwithPOST /databases,parent: { type: 'page_id', page_id },is_inline: true, and the schema underinitial_data_source: { properties }. There is no way to create achild_databaseblock through append-block-children. - Notion rewrites
prop("Name")formula expressions into internal block-property references on save; don't round-trip a saved formulaexpressionback into a create/update payload — keep the human-readable form in your source of truth.
Pagination
List-style helpers accept pageSize (1–100) and startCursor, and return hasMore plus nextCursor for fetching the next page.
Stars
0 stars
Log in to star this package.
Report this listing
Log in to report this listing.