【ClaudeCode】【Lab】MCP Server Integration: Notion + Claude Code
Overview #
In this lab, we are going to create a pipleline to publish a webpage by scanning Notion note and rendering it to a publishable format. This pipeline reads a Notion note via MCP, runs a web-search fact-check with a human review checkpoint, then writes a publishable Hugo .md directly into the repo.
Architecture #
Notion (study note)
│ ← Notion hosted MCP — read only
▼
Claude Code
├─ Stage 1: read note, echo for confirmation
├─ Stage 2: fact-check against primary sources → human checkpoint
└─ Stage 3: write Hugo-ready .md to content/
│ ← git commit + push
▼
ofurotime.ca
Part 1 — Connect Notion MCP #
Hosted endpoint (recommended):
| Transport | URL |
|---|---|
| Streamable HTTP (preferred) | https://mcp.notion.com/mcp |
| SSE fallback | https://mcp.notion.com/sse |
Do not use the open-source Notion MCP npm package — it is no longer actively maintained as of 2026. Use the hosted endpoint above.
# Notion + Claude Code: add MCP server
claude mcp add --transport http notion https://mcp.notion.com/mcp
Then in Claude Code, run /mcp and complete the OAuth flow in your browser.
Part 2 — Authentication Options (as of May 2026) #
| Method | Requires human? | Setup |
|---|---|---|
| User OAuth (default) | Yes — one-time browser flow per session | Run /mcp → browser |
| Personal Access Token (PAT) | No — fully headless | app.notion.com/developers → create PAT |
For an interactive study workflow, user OAuth is sufficient. For scheduled or CI automation, use a PAT:
# Notion + Claude Code: PAT-based (headless / automation)
claude mcp add --transport http notion https://mcp.notion.com/mcp \
--header "Authorization: Bearer <your-pat>"
Permission scoping (blast-radius control) #
As of May 2026, Notion’s default OAuth is workspace-scoped — there is no page-picker step. The connected agent can see your entire workspace.
To restrict access to a single section:
- Create an internal integration at
app.notion.com/developerswith read-only capability. - In Notion, share only the “Study Notes — Drafts” page with that integration.
- Use the integration secret as your PAT (see command above).
The agent can then only see pages explicitly shared with it.
Part 3 — The Staged Pipeline Prompt #
One staged agent beats three separate agents: simpler, cheaper, and Stage 3 can see Stage 2’s reasoning.
Add to CLAUDE.md or use as session instructions:
## Study-note → publishable .md pipeline
When I say "run the pipeline on '<page>'", execute these stages IN ORDER.
### Stage 1 — READ (Notion MCP, READ ONLY)
- Find and read the named page via Notion tools.
- NEVER call any create/update/append/delete Notion tool.
- Echo the raw note back so I can confirm it's the right page.
### Stage 2 — FACT-CHECK (web search)
- Extract every technical claim (services, defaults, quotas, CLI/IaC,
protocol behavior, cert objectives).
- Tag each with its provider (AWS/Azure/GCP/Notion/Anthropic).
- Verify against PRIMARY official sources only. Never blogs.
- Add "as of <today>" to time-sensitive facts.
- Output a table: | Claim | Provider | Status | Correction | Source | Date |
- STOP and show me the table. Wait for my go-ahead.
### Stage 3 — DESIGN + WRITE .md
- Apply only verified/corrected facts. Add nothing unverified.
- Produce Hugo-ready markdown: frontmatter, H1/H2/H3, fenced code blocks
labeled by provider+tool, comparison tables, [[diagram: ...]] placeholders,
Sources section, [[related: ...]] links.
- Write the file to content/knowledge-base/ai/<slug>.md.
Part 4 — Run It #
# 1. Write study note in Notion "Study Notes — Drafts"
# 2. In Claude Code:
# > run the pipeline on "My Page Title"
# 3. Review fact-check table → say "go"
# 4. Claude writes the .md — then commit:
git add content/knowledge-base/ai/<slug>.md
git commit -m "add: <page title> study note"
git push
Part 5 — Publish Options #
| Site type | Path |
|---|---|
| Hugo / Astro / Jekyll (Git repo) | Claude Code writes .md + commits — fully chained |
| WordPress / CMS | Download .md, import manually |
| Manual | Download .md, upload yourself |
For this site: Claude Code writes to content/knowledge-base/ai/ and commits directly.
Sources #
- Connecting to Notion MCP — Notion Docs
- Notion MCP — Notion Help Center
- Notion Developer Platform release notes 2026-05-13
- Authorization — Notion Docs
- Security best practices for Agent connections — Notion Help Center
- Hosting the open-source MCP server — Notion Docs
- Connect Claude Code to tools via MCP — Anthropic Docs
[[related: claudecode-101]]