[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73660":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},73660,"notion-mcp-server","makenotion\u002Fnotion-mcp-server","makenotion","Official Notion MCP Server","",null,"TypeScript",4408,576,24,151,0,12,32,88,36,105.08,"MIT License",false,"main",true,[],"2026-06-12 04:01:10","# Notion MCP Server\n\n> [!NOTE]\n>\n> We’ve introduced **Notion MCP**, a remote MCP server with the following improvements:\n>\n> - Easy installation via standard OAuth. No need to fiddle with JSON or API tokens anymore.\n> - Powerful tools tailored to AI agents, including editing pages in Markdown. These tools are designed with optimized token consumption in mind.\n>\n> Learn more and get started at [Notion MCP documentation](https:\u002F\u002Fdevelopers.notion.com\u002Fdocs\u002Fmcp).\n>\n> We are prioritizing, and only providing active support for, **Notion MCP** (remote). As a result:\n>\n> - We may sunset this local MCP server repository in the future.\n> - Issues and pull requests here are not actively monitored.\n> - Please do not file issues relating to the remote MCP here; instead, contact Notion support.\n\n![notion-mcp-sm](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F6c07003c-8455-4636-b298-d60ffdf46cd8)\n\nThis project implements an [MCP server](https:\u002F\u002Fspec.modelcontextprotocol.io\u002F) for the [Notion API](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fintro).\n\n![mcp-demo](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fe3ff90a7-7801-48a9-b807-f7dd47f0d3d6)\n\n---\n\n## ⚠️ Version 2.0.0 breaking changes\n\n**Version 2.0.0 migrates to the Notion API 2025-09-03** which introduces data sources as the primary abstraction for databases.\n\n### What changed\n\n**Removed tools (3):**\n\n- `post-database-query` - replaced by `query-data-source`\n- `update-a-database` - replaced by `update-a-data-source`\n- `create-a-database` - replaced by `create-a-data-source`\n\n**New tools (7):**\n\n- `query-data-source` - Query a data source (database) with filters and sorts\n- `retrieve-a-data-source` - Get metadata and schema for a data source\n- `update-a-data-source` - Update data source properties\n- `create-a-data-source` - Create a new data source\n- `list-data-source-templates` - List available templates in a data source\n- `move-page` - Move a page to a different parent location\n- `retrieve-a-database` - Get database metadata including its data source IDs\n\n**Parameter changes:**\n\n- All database operations now use `data_source_id` instead of `database_id`\n- Search filter values changed from `[\"page\", \"database\"]` to `[\"page\", \"data_source\"]`\n- Page creation now supports both `page_id` and `database_id` parents (for data sources)\n\n### Do I need to migrate?\n\n**No code changes required.** MCP tools are discovered automatically when the server starts. When you upgrade to v2.0.0, AI clients will automatically see the new tool names and parameters. The old database tools are no longer available.\n\nIf you have hardcoded tool names or prompts that reference the old database tools, update them to use the new data source tools:\n\n| Old Tool (v1.x) | New Tool (v2.0) | Parameter Change |\n| -------------- | --------------- | ---------------- |\n| `post-database-query` | `query-data-source` | `database_id` → `data_source_id` |\n| `update-a-database` | `update-a-data-source` | `database_id` → `data_source_id` |\n| `create-a-database` | `create-a-data-source` | No change (uses `parent.page_id`) |\n\n> **Note:** `retrieve-a-database` is still available and returns database metadata including the list of data source IDs. Use `retrieve-a-data-source` to get the schema and properties of a specific data source.\n\n**Total tools now: 22** (was 19 in v1.x)\n\n---\n\n### Installation\n\n#### 1. Setting up integration in Notion\n\nGo to [https:\u002F\u002Fwww.notion.so\u002Fprofile\u002Fintegrations](https:\u002F\u002Fwww.notion.so\u002Fprofile\u002Fintegrations) and create a new **internal** integration or select an existing one.\n\n![Creating a Notion Integration token](docs\u002Fimages\u002Fintegrations-creation.png)\n\nWhile we limit the scope of Notion API's exposed (for example, you will not be able to delete databases via MCP), there is a non-zero risk to workspace data by exposing it to LLMs. Security-conscious users may want to further configure the Integration's _Capabilities_.\n\nFor example, you can create a read-only integration token by giving only \"Read content\" access from the \"Configuration\" tab:\n\n![Notion Integration Token Capabilities showing Read content checked](docs\u002Fimages\u002Fintegrations-capabilities.png)\n\n#### 2. Connecting content to integration\n\nEnsure relevant pages and databases are connected to your integration.\n\nTo do this, visit the **Access** tab in your internal integration settings. Edit access and select the pages you'd like to use.\n\n![Integration Access tab](docs\u002Fimages\u002Fintegration-access.png)\n\n![Edit integration access](docs\u002Fimages\u002Fpage-access-edit.png)\n\nAlternatively, you can grant page access individually. You'll need to visit the target page, and click on the 3 dots, and select \"Connect to integration\".\n\n![Adding Integration Token to Notion Connections](docs\u002Fimages\u002Fconnections.png)\n\n#### 3. Adding MCP config to your client\n\n##### Using npm\n\n###### Cursor & Claude\n\nAdd the following to your `.cursor\u002Fmcp.json` or `claude_desktop_config.json` (MacOS: `~\u002FLibrary\u002FApplication\\ Support\u002FClaude\u002Fclaude_desktop_config.json`)\n\n###### Option 1: Using NOTION_TOKEN (recommended)\n\n```json\n{\n  \"mcpServers\": {\n    \"notionApi\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@notionhq\u002Fnotion-mcp-server\"],\n      \"env\": {\n        \"NOTION_TOKEN\": \"ntn_****\"\n      }\n    }\n  }\n}\n```\n\n###### Option 2: Using OPENAPI_MCP_HEADERS (for advanced use cases)\n\n```json\n{\n  \"mcpServers\": {\n    \"notionApi\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@notionhq\u002Fnotion-mcp-server\"],\n      \"env\": {\n        \"OPENAPI_MCP_HEADERS\": \"{\\\"Authorization\\\": \\\"Bearer ntn_****\\\", \\\"Notion-Version\\\": \\\"2025-09-03\\\" }\"\n      }\n    }\n  }\n}\n```\n\n###### Zed\n\nAdd the following to your `settings.json`\n\n```json\n{\n  \"context_servers\": {\n    \"some-context-server\": {\n      \"command\": {\n        \"path\": \"npx\",\n        \"args\": [\"-y\", \"@notionhq\u002Fnotion-mcp-server\"],\n        \"env\": {\n          \"OPENAPI_MCP_HEADERS\": \"{\\\"Authorization\\\": \\\"Bearer ntn_****\\\", \\\"Notion-Version\\\": \\\"2025-09-03\\\" }\"\n        }\n      },\n      \"settings\": {}\n    }\n  }\n}\n```\n\n###### GitHub Copilot CLI\n\nUse the Copilot CLI to interactively add the MCP server:\n\n```bash\n\u002Fmcp add\n```\n\nAlternatively, create or edit the configuration file `~\u002F.copilot\u002Fmcp-config.json` and add:\n\n```json\n{\n  \"mcpServers\": {\n    \"notionApi\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@notionhq\u002Fnotion-mcp-server\"],\n      \"env\": {\n        \"NOTION_TOKEN\": \"ntn_****\"\n      }\n    }\n  }\n}\n```\n\nFor more information, see the [Copilot CLI documentation](https:\u002F\u002Fdocs.github.com\u002Fen\u002Fcopilot\u002Fconcepts\u002Fagents\u002Fabout-copilot-cli).\n\n##### Using Docker\n\nThere are two options for running the MCP server with Docker:\n\n###### Option 1: Using the official Docker Hub image\n\nAdd the following to your `.cursor\u002Fmcp.json` or `claude_desktop_config.json`\n\nUsing NOTION_TOKEN (recommended):\n\n```json\n{\n  \"mcpServers\": {\n    \"notionApi\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"--rm\",\n        \"-i\",\n        \"-e\", \"NOTION_TOKEN\",\n        \"mcp\u002Fnotion\"\n      ],\n      \"env\": {\n        \"NOTION_TOKEN\": \"ntn_****\"\n      }\n    }\n  }\n}\n```\n\nUsing OPENAPI_MCP_HEADERS (for advanced use cases):\n\n```json\n{\n  \"mcpServers\": {\n    \"notionApi\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"--rm\",\n        \"-i\",\n        \"-e\", \"OPENAPI_MCP_HEADERS\",\n        \"mcp\u002Fnotion\"\n      ],\n      \"env\": {\n        \"OPENAPI_MCP_HEADERS\": \"{\\\"Authorization\\\":\\\"Bearer ntn_****\\\",\\\"Notion-Version\\\":\\\"2025-09-03\\\"}\"\n      }\n    }\n  }\n}\n```\n\nThis approach:\n\n- Uses the official Docker Hub image\n- Properly handles JSON escaping via environment variables\n- Provides a more reliable configuration method\n\n###### Option 2: Building the Docker image locally\n\nYou can also build and run the Docker image locally. First, build the Docker image:\n\n```bash\ndocker compose build\n```\n\nThen, add the following to your `.cursor\u002Fmcp.json` or `claude_desktop_config.json`\n\nUsing NOTION_TOKEN (recommended):\n\n```json\n{\n  \"mcpServers\": {\n    \"notionApi\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"--rm\",\n        \"-i\",\n        \"-e\",\n        \"NOTION_TOKEN=ntn_****\",\n        \"notion-mcp-server\"\n      ]\n    }\n  }\n}\n```\n\nUsing OPENAPI_MCP_HEADERS (for advanced use cases):\n\n```json\n{\n  \"mcpServers\": {\n    \"notionApi\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"--rm\",\n        \"-i\",\n        \"-e\",\n        \"OPENAPI_MCP_HEADERS={\\\"Authorization\\\": \\\"Bearer ntn_****\\\", \\\"Notion-Version\\\": \\\"2025-09-03\\\"}\",\n        \"notion-mcp-server\"\n      ]\n    }\n  }\n}\n```\n\nDon't forget to replace `ntn_****` with your integration secret. Find it from your integration configuration tab:\n\n![Copying your Integration token from the Configuration tab in the developer portal](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F67b44536-5333-49fa-809c-59581bf5370a)\n\n### Transport options\n\nThe Notion MCP Server supports two transport modes:\n\n#### STDIO transport (default)\n\nThe default transport mode uses standard input\u002Foutput for communication. This is the standard MCP transport used by most clients like Claude Desktop.\n\n```bash\n# Run with default stdio transport\nnpx @notionhq\u002Fnotion-mcp-server\n\n# Or explicitly specify stdio\nnpx @notionhq\u002Fnotion-mcp-server --transport stdio\n```\n\n#### Streamable HTTP transport\n\nFor web-based applications or clients that prefer HTTP communication, you can use the Streamable HTTP transport:\n\n```bash\n# Run with Streamable HTTP transport on port 3000 (default)\nnpx @notionhq\u002Fnotion-mcp-server --transport http\n\n# Run on a custom port\nnpx @notionhq\u002Fnotion-mcp-server --transport http --port 8080\n\n# Run with a custom authentication token\nnpx @notionhq\u002Fnotion-mcp-server --transport http --auth-token \"your-secret-token\"\n```\n\nWhen using Streamable HTTP transport, the server will be available at `http:\u002F\u002F0.0.0.0:\u003Cport>\u002Fmcp`.\n\n##### Authentication\n\nThe Streamable HTTP transport requires bearer token authentication for security. You have three options:\n\n###### Option 1: Auto-generated token (only for development)\n\n```bash\nnpx @notionhq\u002Fnotion-mcp-server --transport http\n```\n\nThe server will generate a secure random token and display it in the console:\n\n```text\nGenerated auth token: a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789ab\nUse this token in the Authorization header: Bearer a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789ab\n```\n\n###### Option 2: Custom token via command line (recommended for production)\n\n```bash\nnpx @notionhq\u002Fnotion-mcp-server --transport http --auth-token \"your-secret-token\"\n```\n\n###### Option 3: Custom token via environment variable (recommended for production)\n\n```bash\nAUTH_TOKEN=\"your-secret-token\" npx @notionhq\u002Fnotion-mcp-server --transport http\n```\n\nThe command line argument `--auth-token` takes precedence over the `AUTH_TOKEN` environment variable if both are provided.\n\n##### Making HTTP requests\n\nAll requests to the Streamable HTTP transport must include the bearer token in the Authorization header:\n\n```bash\n# Example request\ncurl -H \"Authorization: Bearer your-token-here\" \\\n     -H \"Content-Type: application\u002Fjson\" \\\n     -H \"mcp-session-id: your-session-id\" \\\n     -d '{\"jsonrpc\": \"2.0\", \"method\": \"initialize\", \"params\": {}, \"id\": 1}' \\\n     http:\u002F\u002Flocalhost:3000\u002Fmcp\n```\n\n**Note:** Make sure to set either the `NOTION_TOKEN` environment variable (recommended) or the `OPENAPI_MCP_HEADERS` environment variable with your Notion integration token when using either transport mode.\n\n### Examples\n\n1. Using the following instruction\n\n```text\nComment \"Hello MCP\" on page \"Getting started\"\n```\n\n   AI will correctly plan two API calls, `v1\u002Fsearch` and `v1\u002Fcomments`, to achieve the task\n\n1. Similarly, the following instruction will result in a new page named \"Notion MCP\" added to parent page \"Development\"\n\n```text\nAdd a page titled \"Notion MCP\" to page \"Development\"\n```\n\n1. You may also reference content ID directly\n\n```text\nGet the content of page 1a6b35e6e67f802fa7e1d27686f017f2\n```\n\n### Development\n\n#### Build & test\n\n```bash\nnpm run build\nnpm test\n```\n\n#### Execute\n\n```bash\nnpx -y --prefix \u002Fpath\u002Fto\u002Flocal\u002Fnotion-mcp-server @notionhq\u002Fnotion-mcp-server\n```\n\nTesting changes locally in Cursor:\n\n1. Run `npm link` command from repository root to create a machine-global symlink to the `notion-mcp-server` package.\n2. Merge the configuration snippet below into Cursor's `mcp.json` (or other MCP client you want to test with).\n3. (Cleanup) run `npm unlink` from repository root.\n\n```json\n{\n  \"mcpServers\": {\n    \"notion-local-package\": {\n      \"command\": \"notion-mcp-server\",\n      \"env\": {\n        \"NOTION_TOKEN\": \"ntn_...\"\n      }\n    }\n  }\n}\n```\n\n#### Publish\n\n```bash\nnpm login\nnpm publish --access public\n```\n","Notion MCP Server 是一个官方的远程MCP服务器，旨在简化与Notion API的交互。它通过标准OAuth进行安装，无需处理JSON或API令牌，并提供了专为AI代理设计的强大工具，如以Markdown格式编辑页面，这些工具在设计时考虑到了优化令牌消耗。适用于需要高效集成Notion服务到其应用中的开发者，特别是在构建涉及文档自动化处理、数据管理等场景下的AI解决方案时。项目采用TypeScript编写，遵循MIT许可证开放源代码。",2,"2026-06-11 03:46:34","high_star"]