notion-mcp-server

Official Notion MCP Server

GitHub Stars

3,142

User Rating

Not Rated

Favorites

0

Views

7

Forks

289

Issues

49

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Node.js: 18.0.0以上
npm: 8.0.0以上
+1 more

Installation

Installation

Prerequisites

Please specify required software and versions:
Node.js: 18.0.0 or higher
npm: 8.0.0 or higher
Claude Desktop: Latest version

Installation Steps

1. Clone Repository

bash
git clone https://github.com/makenotion/notion-mcp-server.git
cd notion-mcp-server

2. Install Dependencies

bash
npm install

3. Configure Claude Desktop

Edit claude_desktop_config.json to add the MCP server:
json
{
  "mcpServers": {
    "notionApi": {
      "command": "npx",
      "args": ["-y", "@notionhq/notion-mcp-server"],
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_\", \"Notion-Version\": \"2022-06-28\" }"
      }
    }
  }
}

4. Start Server

bash
npm start

Troubleshooting

Common Issues

Issue: Server won't start Solution: Check Node.js version and reinstall dependencies. Issue: Not recognized by Claude Desktop Solution: Verify configuration file path and syntax.

Configuration

Configuration

Basic Configuration

Claude Desktop Setup

Edit ~/.config/claude-desktop/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
json
{
  "mcpServers": {
    "notionApi": {
      "command": "npx",
      "args": ["-y", "@notionhq/notion-mcp-server"],
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_\", \"Notion-Version\": \"2022-06-28\" }"
      }
    }
  }
}

Environment Variables

Set the following environment variables as needed:
bash
export OPENAPI_MCP_HEADERS="{\"Authorization\": \"Bearer ntn_\", \"Notion-Version\": \"2022-06-28\" }"

Advanced Configuration

Security Settings

Store API keys in environment variables or secure configuration files
Set appropriate file access permissions
Adjust logging levels

Performance Tuning

Configure timeout values
Limit concurrent executions
Set up caching

Configuration Examples

Basic Configuration

json
{
  "mcpServers": {
    "notionApi": {
      "command": "npx",
      "args": ["-y", "@notionhq/notion-mcp-server"],
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_\", \"Notion-Version\": \"2022-06-28\" }"
      }
    }
  }
}

Examples

Examples

Basic Usage

Here are basic usage examples for the MCP server:

Using with Claude Desktop

1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands

   Available tools from this MCP server:
   - tool1: Description of tool1
   - tool2: Description of tool2
   

Programmatic Usage

javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');

const client = new MCPClient();
await client.connect();

// Execute tool
const result = await client.callTool('toolName', {
  parameter1: 'value1',
  parameter2: 'value2'
});

console.log(result);

Advanced Examples

Automation Script

bash
#!/bin/bash

Batch processing example

for file in *.txt; do mcp-tool process "$file" done

API Integration

python

Python example

import requests import json def call_mcp_tool(tool_name, params): response = requests.post( 'http://localhost:3000/mcp/call', json={ 'tool': tool_name, 'parameters': params } ) return response.json()

Usage example

result = call_mcp_tool('analyze', { 'input': 'sample data', 'options': {'format': 'json'} })

Use Cases

Retrieve information from Notion databases to feed into AI models.
Automatically update Notion pages with AI agents.
Integrate data analysis tools with Notion for real-time data visualization.
Use Notion as a project management tool and prioritize tasks using AI.

Additional Resources

Author Information
Notion

"We shape our tools, thereafter our tools shape us"

United States of America

2,096

Followers

38

Repositories

0

Gists

0

Total Contributions

Related MCPs
n8n-mcp-server logo

MCP server that provides tools and resources for interacting with n8n API

TypeScript
n8n-mcp-server logo

MCP server implementation for n8n workflow automation

TypeScript
make-mcp-server logo

Make MCP Server

TypeScript