A lightweight Model Context Protocol (MCP) server that lets Gemini CLI (and other MCP clients) search, read, and write Notion content.
- Gemini CLI installed and working
- Node.js 20+ and npm
- A Notion Internal Integration (API key)
- Install from GitHub:
gemini extensions install https://github.com/gitremko/Gemini_cli_notion_extention
- Create a Notion Internal Integration and grant access (see below)
- Set your API key (see "Set API Key")
- Restart Gemini CLI, then run:
gemini extensions list(should shownotion)
- Open https://www.notion.so/profile/integrations
- Click "New integration"
- Workspace: choose the workspace you will use
- Type: Internal
- Capabilities: enable at minimum "Read content". To write, also enable "Insert content" and "Update content".
- Save
- Grant access to pages/databases
- In the integration page, open the "Access" tab and add the pages/databases you want to use
- Or share specific Notion pages/databases with your integration from Notion
- Copy the "Internal Integration Secret" — this is your API key
- Windows (User-scoped, required on Windows)
- PowerShell:
[Environment]::SetEnvironmentVariable('NOTION_API_KEY','secret_...','User') - Open a new terminal after setting it
- PowerShell:
- macOS/Linux
- Current shell:
export NOTION_API_KEY=secret_... - Persist: add the export line to
~/.zshrcor~/.bashrc
- Current shell:
Notes
- Windows: this server reads the token only from the User-scoped environment (registry
HKCU\Environment). - Non-Windows: the token is read from the process environment.
- Supported names (first match wins):
NOTION_API_KEY,GEMINI_NOTION_API_KEY,NOTION_TOKEN,NOTION_SECRET.
- Bundled server (no node_modules required):
- Windows:
node "%USERPROFILE%\.gemini\extensions\notion\dist\extension.cjs" - macOS/Linux:
node "$HOME/.gemini/extensions/notion/dist/extension.cjs"
- Windows:
- Expected log:
Using Notion API key from: ...and the process waits for a client connection
- After install, Gemini CLI discovers the MCP server
notionautomatically. - Try a simple tool call (search):
- Ask: "search Notion for 'your term'" — the tool used is
notion_search.
- Ask: "search Notion for 'your term'" — the tool used is
git clone https://github.com/gitremko/Gemini_cli_notion_extention && cd Gemini_cli_notion_extentionnpm install && npm run buildgemini extensions link .- Edit code, then
npm run buildand restart Gemini CLI - Unlink later:
gemini extensions unlink notion
notion_search— search pages/databases (query, optional filter, page_size)notion_get_page— fetch a page object by idnotion_list_blocks— list child blocks for a page/blocknotion_append_paragraph— append paragraph textnotion_create_page— create a page in a database (with title property)notion_create_subpage— create a subpage under a pagenotion_query_database— query a database (filter, sorts, cursor, page_size)notion_update_page— update properties of a pagenotion_get_block— fetch a single block by idnotion_append_blocks— append one or more blocks under a parentnotion_archive_page— archive a pagenotion_unarchive_page— restore an archived pagenotion_delete_block— delete (archive) a blocknotion_update_block_text— update rich_text of paragraph/headingnotion_append_heading— append a heading (1/2/3)notion_append_todo— append a to_do (checkbox)notion_list_databases— list databases in the workspacenotion_list_pages_in_database— list pages in a databasenotion_append_image_url— append an image block from an external URL
Prompts
notion_build_filter— build a database filter skeletonnotion_blocks_snippet— generate blocks JSON for appendnotion_create_page_snippet— generate properties JSON for page creation
- Connection closed (-32000): ensure Node is available on PATH and reinstall the extension.
- API token is invalid: verify your key and that the integration has access to the pages/databases.
- Verify the bundled entry runs:
- Windows:
node "%USERPROFILE%\.gemini\extensions\notion\dist\extension.cjs" - macOS/Linux:
node "$HOME/.gemini/extensions/notion/dist/extension.cjs"
- Windows:
- Uninstall a GitHub-installed extension:
gemini extensions uninstall notion - Update: uninstall, then install again from the GitHub URL
- Remove a local link:
gemini extensions unlink notion
MIT