> ## Documentation Index
> Fetch the complete documentation index at: https://struktoai-fix-databricks-volume-token-provider.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Notion

> Mount Notion pages and databases as a Mirage filesystem.

`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

```bash theme={null}
pnpm add @struktoai/mirage-node
```

```ts theme={null}
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/')
```

| Field     | Default                     | Notes                                                     |
| --------- | --------------------------- | --------------------------------------------------------- |
| `apiKey`  | required                    | Notion internal integration token. Redacted in snapshots. |
| `baseUrl` | `https://api.notion.com/v1` | Override for testing against a mock server.               |

## Browser

```bash theme={null}
pnpm add @struktoai/mirage-browser @modelcontextprotocol/sdk
```

```ts theme={null}
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/')
```

| Field          | Default                      | Notes                                                                          |
| -------------- | ---------------------------- | ------------------------------------------------------------------------------ |
| `authProvider` | required                     | `OAuthClientProvider` from `@modelcontextprotocol/sdk`. Redacted in snapshots. |
| `serverUrl`    | Notion's hosted MCP endpoint | Override 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:

```text theme={null}
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](/python/resource/notion).
