camoneart/markdown-to-notion
If you are the rightful owner of markdown-to-notion and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
An MCP server that converts Markdown file content to Notion page format and outputs it to Notion.
Markdown to Notion MCP Server
English |
An MCP server that converts .md
file content and outputs it to Notion.
Features
- Convert Markdown file content to Notion page format and output
- Verify Notion API connection
- Display current server configuration
Installation
# Clone the repository
git clone https://github.com/camoneart/markdown-to-notion
cd markdown-to-notion
# Install dependencies
pnpm install
# Build TypeScript
pnpm run build
# Register as global command
pnpm link --global
Configuration
- Copy
.env.example
to create.env
file - Configure Notion API token
cp .env.example .env
Edit the .env
file:
NOTION_API_TOKEN=your_notion_api_token_here
# Optional: Default Notion page ID (enables page ID omission when set)
DEFAULT_NOTION_PAGE_ID=your_default_page_id_here
How to get Notion API Token
- Go to Notion Developers
- Click "New integration"
- Enter integration name (e.g., "Markdown MCP Server")
- Select workspace
- Click "Submit"
- Copy the displayed token
Usage
1. Run as MCP Server
# Development mode
pnpm run dev
# Production mode (after build)
pnpm start
2. Use from MCP clients like Claude Code
Add the following to your MCP client configuration file (.mcp.json
):
{
"mcpServers": {
"markdown-to-notion": {
"type": "stdio",
"command": "md-to-notion",
"args": [],
"env": {
"NOTION_API_TOKEN": "your_notion_api_token_here",
"DEFAULT_NOTION_PAGE_ID": "your_default_page_id_here"
}
}
}
}
Note: To use the above configuration, you need to register it as a global command with pnpm link --global
beforehand.
Available Tools
md-to-notion
Add Markdown file content to Notion page
Parameters:
markdownFilePath
: Path to the markdown filenotionPageId
: Notion page ID to append content to (optional)
Usage Examples:
# With page ID specified
markdownFilePath: ./example.md
notionPageId: 1234567890abcdef1234567890abcdef
# Using default page ID (simple!)
markdownFilePath: ./example.md
※ DEFAULT_NOTION_PAGE_ID is used when notionPageId is omitted
verify-notion-connection
Verify Notion API connection
Parameters: None
Available Resources
config-info
Display current server configuration
URI: config://current
Development
# Run tests
pnpm test
# Run linter
pnpm run lint
# Type check
pnpm run typecheck
Troubleshooting
Common Errors
-
"NOTION_API_TOKEN environment variable is required"
- Notion API token is not set in
.env
file
- Notion API token is not set in
-
"Markdown file not found"
- The specified Markdown file path is incorrect
-
"Failed to retrieve Notion page"
- Notion page ID is incorrect or integration doesn't have access permission to the page
Permission Setup
To add content to a Notion page, you need to connect the created integration to the page:
- Open the target Notion page
- Click the "⋯" (three dots menu) in the top right
- Select "Connections" from the menu
- Enter the integration name in the search box
- Select the displayed integration
- Click "Confirm" on the permission confirmation screen
License
Licensed under the .