-
Notifications
You must be signed in to change notification settings - Fork 279
Open
Description
Summary
Add environment variables to enable/disable specific Notion MCP tools at runtime for better security, performance, and reduced context size.
Motivation
Currently all tools load by default. Teams often need only a subset - e.g., read-only agents only need search
and fetch
. Selective loading reduces token usage, improves security via least-privilege, and simplifies debugging.
Implementation
Environment Variables:
# Allow-list (only these tools load)
ENABLED_TOOLS=search,fetch,create-pages
# or
# Deny-list (everything except these)
DISABLED_TOOLS=move-pages,duplicate-page,create-comment
Example Usage
Claude Desktop:
{
"mcpServers": {
"notion": {
"command": "npx",
"args": ["-y", "@notionhq/notion-mcp-server"],
"env": {
"NOTION_TOKEN": "ntn_****",
"ENABLED_TOOLS": "search,fetch,create-pages"
}
}
}
}
Docker:
docker run -e NOTION_TOKEN=ntn_**** \
-e DISABLED_TOOLS=move-pages,duplicate-page \
mcp/notion
Benefits
- Smaller schemas = faster discovery + lower token costs
- Least-privilege security for specific workflows
- Easier debugging with minimal tool surface
AndreyBoardPro
Metadata
Metadata
Assignees
Labels
No labels