notion-skills-mcp
# notion-skills-mcp
An MCP server that turns a Notion database of your Claude Code skills into a fast, low-token skill picker and project planner for Claude Code.
You keep your skills in Notion: name, purpose, when to use, command. Claude Code finds the right ones for each task and plans your project around them. It reads a local cache, so your Notion database isn't sent to the model.
```
Notion database ──(fetched once, cached locally)──► notion-skills-mcp ──► Claude Code
match / plan / route
```
## Why
- **You have dozens or hundreds of skills and slash commands.** You can't remember them all, and pasting the list into every session wastes tokens.
- **Matching runs locally.** It ranks skills with BM25 and returns only the top few, as one line each.
- **Plan once, then work from files.** `start_project` writes a detailed `PLAN.md` that names the skill and model for each phase. Later sessions read that file instead of a long chat history.
## Features
- **Read-once cache.** Notion is fetched on first use and then once a week by default. Starting a session with a warm cache makes no network calls.
- **Compact output.** One line per skill: `name | when to use | command`. A full category list is about 120 tokens.
- **Local matching.** BM25 ranking with phrase synonyms, a boost for skills in the task's stage, and a penalty for frameworks outside your stack.
- **Model routing.** `route_task` suggests `opus`, `sonnet` or `haiku` for a task. You switch with `/model`.
- **Handoff.** `write_handoff` saves your progress to `HANDOFF.md`, so a fresh session continues where you left off.
- **Read-only.** It never writes to Notion.
## Requirements
- Node.js 22+
- Claude Code
- A Notion account
## Setup
### 1. Create the skills database
Duplicate the template: **[Skill Playbook template](<TEMPLATE_LINK>)**
Or use your own database. It needs at least these four columns (names are configurable):
| Column | Type | Example |
|---------------|--------|------------------------------------------|
| `Name` | Title | `blueprint` |
| `Purpose` | Text | Turns one objective into a build plan. |
| `When to Use` | Text | The work spans many PRs or sessions. |
| `Command` | Text | `/blueprint` |
Optional columns improve matching:
| Column | Type | Used for |
|--------------------|--------------|----------|
| `Category` | Select | Filtering (`Frontend`, `Testing & QA`, …) |
| `Stage` | Multi-select | `Plan`, `Design`, `Build`, `Test`, `Review`, `Ship`, `Operate`, `Any` |
| `Also In` | Multi-select | Extra categories for matching |
| `Related Skills` | Text | Shown by `get_skill` |
| `Expected Output` | Text | Shown by `get_skill` |
| `Needs Inspection` | Checkbox | Checked rows are skipped |
### 2. Get a Notion token
Use either kind of token:
- **Internal integration (recommended):** go to [notion.so/profile/integrations](https://www.notion.so/profile/integrations) → **New integration** → Internal. Give it **Read content** only. Then open the integration's **Access** tab and add your skills page.
- **Personal access token:** go to Notion **Settings → Developer → New token**. It can read everything you can see, so keep it private.
### 3. Run setup
```bash
npx -y notion-skills-mcp init
```
The setup asks for your token and your database URL. It detects the columns, writes `~/.skills-mcp/config.json`, fetches the skills once, and prints the exact command to register the server.
### 4. Register with Claude Code
macOS / Linux:
```bash
claude mcp add skills --scope user -e NOTION_TOKEN=<your-token> -- npx -y notion-skills-mcp
```
Windows:
```bash
claude mcp add skills --scope user -e NOTION_TOKEN=<your-token> -- cmd /c npx -y notion-skills-mcp
```
Check it: run `claude`, then `/mcp`. `skills` should show as connected.
## Usage
### Start a project
```
/mcp__skills__start_project
```
Give it a goal, e.g. *"Expense tracker, React Native + Supabase"*. Claude will:
1. Find the best skills for each stage (Plan, Design, Build, Test, Ship).
2. Write `PLAN.md`: architecture, file tree, phases, and the skill command and model for each phase.
3. Write `AGENTS.md`: conventions and a pointer to `PLAN.md`.
4. Stop and wait for your approval.
### Work phase by phase
```
/model sonnet
Do phase 2 of PLAN.md
/clear
```
Run `/clear` between phases. Each phase starts fresh from `PLAN.md`, which saves more tokens than anything else.
### Ask for a skill anytime
```
match_skills: add push notifications
```
### Pause and resume
```
write_handoff for this project
```
Later, in a new session: *"Read AGENTS.md, PLAN.md and HANDOFF.md, then continue."*
## Tools
| Tool | Input | Returns |
|------------------|----------------------------------------|---------|
| `match_skills` | `task`, `category?`, `stage?`, `stack?`, `limit?` | Top skills, one line each |
| `list_skills` | `category?`, `stage?` | With no filter: categories with counts. With a filter: skills (max 60 lines) |
| `get_skill` | `name` | Full details for one skill |
| `route_task` | `task`, `kind?` | `opus` / `sonnet` / `haiku` with a reason |
| `write_handoff` | `projectDir`, `done`, `next`, `decisions`, `openQuestions` | Writes `HANDOFF.md` |
| `refresh_skills` | none | Re-fetches from Notion now |
Prompt: `start_project`. Resource: `skills://index` (category summary).
## Configuration
`~/.skills-mcp/config.json`:
```json
{
"databaseUrl": "https://www.notion.so/...",
"properties": {
"name": "Name",
"purpose": "Purpose",
"whenToUse": "When to Use",
"command": "Command",
"category": "Category",
"stages": "Stage",
"alsoIn": "Also In",
"related": "Related Skills",
"expectedOutput": "Expected Output",
"skip": "Needs Inspection"
},
"cacheTtlHours": 168,
"stack": ["typescript", "react"],
"synonyms": {
"tests first|test-first|test-driven": "tdd",
"bug|broken|crash": "debug",
"deploy|release": "ship"
},
"models": {
"opus": ["architecture", "planning", "difficult bugs", "large refactors", "code review"],
"sonnet": ["daily coding", "features", "debugging", "multi-file changes", "tests"],
"haiku": ["quick fixes", "boilerplate", "docs", "file searches", "summaries", "repetitive edits"]
}
}
```
| Key | Meaning |
|----------------|---------|
| `databaseUrl` | Your Notion database link. `dataSourceId` also works. |
| `properties` | Your column names. Only `name`, `purpose`, `whenToUse` and `command` are required. |
| `cacheTtlHours`| How often to re-fetch. Default 168 (one week). |
| `stack` | Your technologies. Skills for other frameworks rank lower. |
| `synonyms` | Phrase → term rules added to the built-in ones. |
| `models` | Keywords that send a task to each model in `route_task`. |
`NOTION_TOKEN` comes from the environment. Set it with `-e` in `claude mcp add`; it is never stored in the config file.
## Token cost
These are estimates.
| Action | Tokens |
|---|---|
| Notion fetch | 0. The server reads its local cache, so this never reaches the model. |
| `match_skills` (5 results) | ~150 |
| `start_project` skill lookups | ~1k |
| `list_skills` with no filter | ~120 |
| Tool definitions, per session | check with `/context` |
## Troubleshooting
| Problem | Fix |
|---|---|
| `object_not_found` | The token can't see the database. Add the page in the integration's **Access** tab. |
| `/mcp` shows failed | Run `npx -y notion-skills-mcp doctor`. |
| Skills are out of date | Ask Claude to run `refresh_skills`, or lower `cacheTtlHours`. |
| Wrong skills ranked first | Add a `synonyms` rule or set your `stack`. |
## Development
```bash
git clone https://github.com/ozanggnr/notion-skills-mcp
cd notion-skills-mcp
npm install
npm test
npm run build
npx @modelcontextprotocol/inspector node dist/index.js
```
To run your local build in Claude Code:
```bash
claude mcp add skills-dev -e NOTION_TOKEN=<your-token> -- node /abs/path/dist/index.js
```
## License
MIT
TDQS
Scored across 6 tools
The main overlap is between list_skills and match_skills, but descriptions explicitly signal the distinction (browse by category vs. BM25 task matching, with 'Prefer match_skills' guidance). get_skill is clearly the detail fetch, and route_task/write_handoff are obviously unrelated operations.
All six tools follow a strict verb_noun snake_case pattern: list_skills, get_skill, match_skills, refresh_skills, route_task, write_handoff. No mixed conventions or vague standalone verbs.
Six tools is well-scoped for skill discovery plus cache refresh. route_task and write_handoff are somewhat tangential to the 'notion-skills' domain, but they are single-purpose and don't bloat the surface.
The read lifecycle is covered: browse (list), detail (get), task-match (match), and cache refresh. There is no ability to create/update skills from the client, but the server appears intentionally read-only against Notion, so the gap is minor.