Skip to main content
NotionResource exposes a Notion workspace as a filesystem. The Node SDK talks to the Notion REST API with an integration token; the Browser SDK talks to Notion’s MCP server with an OAuth client provider so secrets stay off the page.

Node

pnpm add @struktoai/mirage-node
import { MountMode, NotionResource, Workspace } from '@struktoai/mirage-node'

const notion = new NotionResource({ apiKey: process.env.NOTION_API_KEY! })

const ws = new Workspace({ '/notion': notion }, { mode: MountMode.READ })
await ws.execute('ls /notion/pages/')
FieldDefaultNotes
apiKeyrequiredNotion internal integration token. Redacted in snapshots.
baseUrlhttps://api.notion.com/v1Override for testing against a mock server.

Browser

pnpm add @struktoai/mirage-browser @modelcontextprotocol/sdk
import { MountMode, NotionResource, Workspace } from '@struktoai/mirage-browser'

const notion = new NotionResource({
  authProvider, // OAuthClientProvider from @modelcontextprotocol/sdk
})

const ws = new Workspace({ '/notion': notion }, { mode: MountMode.READ })
await ws.execute('ls /notion/')
FieldDefaultNotes
authProviderrequiredOAuthClientProvider from @modelcontextprotocol/sdk. Redacted in snapshots.
serverUrlNotion’s hosted MCP endpointOverride if you proxy MCP through your own URL.

Mount mode

read, write (page edits via the MCP server in the browser SDK).

Resource commands

notion-search works on read mounts; the rest require a write mount:
notion-search --query "Roadmap" [--limit 20]
notion-page-create --parent <parent-path> --title "title"
notion-block-append --params '{"block_id":"..."}' --json '{"children":[...]}'
notion-comment-add --json '{"parent":{"page_id":"..."},"rich_text":[{"text":{"content":"Comment"}}]}'
For the page/database layout and supported edits see the Python Notion docs.