# suekou/mcp-notion-server architecture

> Architecture diagram of the GitHub repository suekou/mcp-notion-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suekou/mcp-notion-server
- Repository: https://github.com/suekou/mcp-notion-server

## Overview

This is a Notion MCP server: an MCP host invokes discovery, page-reading, data-source, and editing tools, which validate or transform requests, call the Notion API, and return compact results. Optional prompts, resources, and interactive MCP Apps extend that workflow. The graph covers the documented raw block/API capabilities as well as the recommended high-level paths. Some unsampled tool implementations are represented at their exact directory paths; their internal call relationships are omitted where excerpts do not establish them.

Main entry points: [`src/mcp/server.ts`](https://github.com/suekou/mcp-notion-server/blob/main/src/mcp/server.ts) (MCP server), [`src/notion/client.ts`](https://github.com/suekou/mcp-notion-server/blob/main/src/notion/client.ts) (Notion API client), [`src/tools/data-sources/handlers.ts`](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/data-sources/handlers.ts) (Data source workflows), [`src/tools/discovery/handlers.ts`](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/discovery/handlers.ts) (Find and inspect)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["MCP runtime"]
  node_server["MCP server<br/>[server.ts]"]
  node_schemas["Tool schemas<br/>[schema.ts]"]
  node_optimizer["Response optimizer"]
  node_prompts["Workflow prompts<br/>[index.ts]"]
  node_resources["Notion resources<br/>[index.ts]"]
end

subgraph group_tools["Notion workflows"]
  node_discovery["Find and inspect<br/>[handlers.ts]"]
  node_discovery_summary["Discovery summaries<br/>[summary.ts]"]
  node_pages["Page reading<br/>[handlers.ts]"]
  node_page_reader["Page block reader<br/>[reader.ts]"]
  node_datasource["Data source workflows<br/>[handlers.ts]"]
  node_query["Schema-aware querying<br/>[query.ts]"]
  node_properties["Property conversion<br/>[properties.ts]"]
  node_content["Simple content edits<br/>[handlers.ts]"]
  node_simple_content["Content builder<br/>[simple-content.ts]"]
  node_blocks["Raw block operations<br/>[handlers.ts]"]
  node_raw_tools["Advanced API tools"]
end

subgraph group_integration["Notion integration"]
  node_client["Notion API client<br/>[client.ts]"]
  node_markdown["Markdown conversion<br/>[index.ts]"]
end

subgraph group_apps["Interactive apps"]
  node_explorer["Data Source Explorer<br/>[main.tsx]"]
  node_workbench["Page Workbench<br/>[main.tsx]"]
  node_app_resources["App resource registry<br/>[index.ts]"]
  node_app_bridge["MCP Apps bridge<br/>[bridge.ts]"]
  node_ui_shared["Shared app UI<br/>[ui.tsx]"]
end

node_agent(("AI agent / MCP host"))
node_notion(("Notion API"))

node_agent -->|"starts session"| node_server
node_server -->|"validates requests"| node_schemas
node_server -->|"dispatches tools"| node_discovery
node_server -->|"dispatches tools"| node_pages
node_server -->|"dispatches tools"| node_datasource
node_server -->|"dispatches tools"| node_content
node_server -->|"dispatches tools"| node_blocks
node_server -->|"dispatches tools"| node_raw_tools
node_server -->|"optimizes results"| node_optimizer
node_server -->|"resolves prompts"| node_prompts
node_server -->|"resolves resources"| node_resources
node_discovery -->|"calls API methods"| node_client
node_discovery -->|"summarizes results"| node_discovery_summary
node_pages -->|"reads page data"| node_client
node_pages -->|"builds page result"| node_page_reader
node_datasource -->|"calls API methods"| node_client
node_datasource -->|"converts query"| node_query
node_datasource -->|"uses property helpers"| node_properties
node_content -->|"updates blocks"| node_client
node_content -->|"builds edit blocks"| node_simple_content
node_blocks -->|"calls API methods"| node_client
node_client -->|"sends API requests"| node_notion
node_client -->|"converts responses"| node_markdown
node_explorer -->|"invokes MCP tools"| node_app_bridge
node_workbench -->|"invokes MCP tools"| node_app_bridge
node_explorer -->|"renders controls"| node_ui_shared
node_workbench -->|"renders controls"| node_ui_shared
node_server -->|"serves app resources"| node_app_resources

click node_server "https://github.com/suekou/mcp-notion-server/blob/main/src/mcp/server.ts"
click node_schemas "https://github.com/suekou/mcp-notion-server/blob/main/src/mcp/schema.ts"
click node_optimizer "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/response-optimizer.ts"
click node_prompts "https://github.com/suekou/mcp-notion-server/blob/main/src/prompts/index.ts"
click node_resources "https://github.com/suekou/mcp-notion-server/blob/main/src/resources/index.ts"
click node_discovery "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/discovery/handlers.ts"
click node_discovery_summary "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/discovery/summary.ts"
click node_pages "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/pages/handlers.ts"
click node_page_reader "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/pages/reader.ts"
click node_datasource "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/data-sources/handlers.ts"
click node_query "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/data-sources/query.ts"
click node_properties "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/data-sources/properties.ts"
click node_content "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/content/handlers.ts"
click node_simple_content "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/content/simple-content.ts"
click node_blocks "https://github.com/suekou/mcp-notion-server/blob/main/src/tools/blocks/handlers.ts"
click node_raw_tools "https://github.com/suekou/mcp-notion-server/tree/main/src/tools"
click node_client "https://github.com/suekou/mcp-notion-server/blob/main/src/notion/client.ts"
click node_markdown "https://github.com/suekou/mcp-notion-server/blob/main/src/markdown/index.ts"
click node_explorer "https://github.com/suekou/mcp-notion-server/blob/main/src/apps/ui/data-source-explorer/main.tsx"
click node_workbench "https://github.com/suekou/mcp-notion-server/blob/main/src/apps/ui/page-workbench/main.tsx"
click node_app_resources "https://github.com/suekou/mcp-notion-server/blob/main/src/apps/index.ts"
click node_app_bridge "https://github.com/suekou/mcp-notion-server/blob/main/src/apps/ui/shared/bridge.ts"
click node_ui_shared "https://github.com/suekou/mcp-notion-server/blob/main/src/apps/ui/shared/ui.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_schemas,node_optimizer,node_prompts,node_resources toneBlue
class node_discovery,node_discovery_summary,node_pages,node_page_reader,node_datasource,node_query,node_properties,node_content,node_simple_content,node_blocks,node_raw_tools toneAmber
class node_client,node_markdown,node_notion toneMint
class node_explorer,node_workbench,node_app_resources,node_app_bridge,node_ui_shared toneRose
class node_agent toneIndigo
```

## Components

### MCP runtime

- [MCP server](https://github.com/suekou/mcp-notion-server/blob/main/src/mcp/server.ts): `src/mcp/server.ts`
- [Tool schemas](https://github.com/suekou/mcp-notion-server/blob/main/src/mcp/schema.ts): `src/mcp/schema.ts`
- [Response optimizer](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/response-optimizer.ts): `src/tools/response-optimizer.ts`
- [Workflow prompts](https://github.com/suekou/mcp-notion-server/blob/main/src/prompts/index.ts): `src/prompts/index.ts`
- [Notion resources](https://github.com/suekou/mcp-notion-server/blob/main/src/resources/index.ts): `src/resources/index.ts`

### Notion workflows

- [Find and inspect](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/discovery/handlers.ts): `src/tools/discovery/handlers.ts`
- [Discovery summaries](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/discovery/summary.ts): `src/tools/discovery/summary.ts`
- [Page reading](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/pages/handlers.ts): `src/tools/pages/handlers.ts`
- [Page block reader](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/pages/reader.ts): `src/tools/pages/reader.ts`
- [Data source workflows](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/data-sources/handlers.ts): `src/tools/data-sources/handlers.ts`
- [Schema-aware querying](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/data-sources/query.ts): `src/tools/data-sources/query.ts`
- [Property conversion](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/data-sources/properties.ts): `src/tools/data-sources/properties.ts`
- [Simple content edits](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/content/handlers.ts): `src/tools/content/handlers.ts`
- [Content builder](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/content/simple-content.ts): `src/tools/content/simple-content.ts`
- [Raw block operations](https://github.com/suekou/mcp-notion-server/blob/main/src/tools/blocks/handlers.ts): `src/tools/blocks/handlers.ts`
- [Advanced API tools](https://github.com/suekou/mcp-notion-server/tree/main/src/tools): `src/tools`

### Notion integration

- [Notion API client](https://github.com/suekou/mcp-notion-server/blob/main/src/notion/client.ts): `src/notion/client.ts`
- [Markdown conversion](https://github.com/suekou/mcp-notion-server/blob/main/src/markdown/index.ts): `src/markdown/index.ts`

### Interactive apps

- [Data Source Explorer](https://github.com/suekou/mcp-notion-server/blob/main/src/apps/ui/data-source-explorer/main.tsx): `src/apps/ui/data-source-explorer/main.tsx`
- [Page Workbench](https://github.com/suekou/mcp-notion-server/blob/main/src/apps/ui/page-workbench/main.tsx): `src/apps/ui/page-workbench/main.tsx`
- [App resource registry](https://github.com/suekou/mcp-notion-server/blob/main/src/apps/index.ts): `src/apps/index.ts`
- [MCP Apps bridge](https://github.com/suekou/mcp-notion-server/blob/main/src/apps/ui/shared/bridge.ts): `src/apps/ui/shared/bridge.ts`
- [Shared app UI](https://github.com/suekou/mcp-notion-server/blob/main/src/apps/ui/shared/ui.tsx): `src/apps/ui/shared/ui.tsx`

### Other components

- **AI agent / MCP host**
- **Notion API**

## Connections

- AI agent / MCP host → MCP server: starts session (evidence: `README.md`)
- MCP server → Tool schemas: validates requests (evidence: `src/mcp/server.ts`)
- MCP server → Find and inspect: dispatches tools (evidence: `src/mcp/server.ts`)
- MCP server → Page reading: dispatches tools (evidence: `src/mcp/server.ts`)
- MCP server → Data source workflows: dispatches tools (evidence: `src/mcp/server.ts`)
- MCP server → Simple content edits: dispatches tools (evidence: `src/mcp/server.ts`)
- MCP server → Raw block operations: dispatches tools (evidence: `src/mcp/server.ts`)
- MCP server → Advanced API tools: dispatches tools (evidence: `src/mcp/server.ts`)
- MCP server → Response optimizer: optimizes results (evidence: `src/mcp/server.ts`)
- MCP server → Workflow prompts: resolves prompts (evidence: `src/mcp/server.ts`)
- MCP server → Notion resources: resolves resources (evidence: `src/mcp/server.ts`)
- Find and inspect → Notion API client: calls API methods (evidence: `src/tools/discovery/handlers.ts`)
- Find and inspect → Discovery summaries: summarizes results (evidence: `src/tools/discovery/handlers.ts`)
- Page reading → Notion API client: reads page data (evidence: `src/tools/pages/handlers.ts`)
- Page reading → Page block reader: builds page result (evidence: `src/tools/pages/handlers.ts`)
- Data source workflows → Notion API client: calls API methods (evidence: `src/tools/data-sources/handlers.ts`)
- Data source workflows → Schema-aware querying: converts query (evidence: `src/tools/data-sources/handlers.ts`)
- Data source workflows → Property conversion: uses property helpers (evidence: `src/tools/data-sources/handlers.ts`)
- Simple content edits → Notion API client: updates blocks (evidence: `src/tools/content/handlers.ts`)
- Simple content edits → Content builder: builds edit blocks (evidence: `src/tools/content/handlers.ts`)
- Raw block operations → Notion API client: calls API methods (evidence: `src/tools/blocks/handlers.ts`)
- Notion API client → Notion API: sends API requests (evidence: `src/notion/client.ts`)
- Notion API client → Markdown conversion: converts responses (evidence: `src/notion/client.ts`)
- Data Source Explorer → MCP Apps bridge: invokes MCP tools (evidence: `src/apps/ui/data-source-explorer/main.tsx`)
- Page Workbench → MCP Apps bridge: invokes MCP tools (evidence: `src/apps/ui/page-workbench/main.tsx`)
- Data Source Explorer → Shared app UI: renders controls (evidence: `src/apps/ui/data-source-explorer/main.tsx`)
- Page Workbench → Shared app UI: renders controls (evidence: `src/apps/ui/page-workbench/main.tsx`)
- MCP server → App resource registry: serves app resources (evidence: `src/mcp/server.ts`)
