mcpField
N
notion-export-mcp-server

notion-export-mcp-server

Local
npmjs.comMemory & Knowledge1Updated 81w ago

About notion-export-mcp-server

notion-export-mcp-server exposes Notion's unofficial export API through an MCP server, allowing AI clients to retrieve exported page content as Markdown. It is intended for users who need to access Notion page exports from MCP-compatible tools; its operation depends on an internal Notion API that may change.

Key features

  1. 01Fetch export results as Markdown
  2. 02Access Notion's unofficial API
  3. 03Authenticate with Notion tokens

Use cases

  1. 01Retrieving exported Notion pages in an AI client
  2. 02Getting page export results as Markdown
  3. 03Connecting an MCP client to Notion export data

MCP support

The server provides the `notion_export_get_result` tool to retrieve Notion export results as Markdown text. MCP clients can connect to it using their server configuration.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"notion-export": {
"command": "npx",
"args": [
"-y",
"notion-export-mcp-server"
]
}
}
}
Run commandnpx -y notion-export-mcp-server

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmnotion-export-mcp-server

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

notion-export-mcp-server

npm version

A MCP(Model Context Protocol) server that accesses to Notion unofficial API to export pages.

This server provides MCP-compatible access to Notion's unofficial API, allowing AI assistants to interact with your Notion exported page data through a standardized interface.

Features

Available tools:

  • notion_export_get_result - Get notion export result markdown text

Quick Start

Installation
Manual Installation
npm install notion-export-mcp-server
Configuration
  • NOTION_TOKEN_V2: Your Notion token
  • NOTION_FILE_TOKEN: Your Notion file token
Usage
Start the MCP server

Directly:

npx notion-export-mcp-server

Or, run the installed module with node.

Edit MCP configuration json for your client:
...
    "notion-export": {
      "command": "npx",
      "args": [
        "-y",
        "notion-export-mcp-server"
      ],
      "env": {
        "NOTION_TOKEN_V2": "<your token>",
        "NOTION_FILE_TOKEN": "<your token>"
      }
    },
...

Secrets?

How to get

To export anything from Notion, one needs to authenticate oneself with some Cookies (like a browser would). These cookies are called token_v2 and file_token. They are set on all requests of a logged in user when using the Notion web-app.

  1. Go to notion.so.
  2. Log in with your account.
  3. Open the developer tools of your browser, open Application > Storage > Cookies (Chrome); Storage tab (Firefox).
  4. Copy the value of the Cookies called token_v2 and file_token and paste them somewhere safe.
    • ⚠️ If you don't find file_token, you need to have at least had exported a file manually once.
  5. Those cookies have a 1 year validity, so you don't need to do this often.
Note on Stability

This tool completely relies on the export/download feature of the official but internal Notion.so API. The advantage is, that we do not generate any markup ourselves, just download and extract some ZIPs. While the download feature seems to be pretty stable, keep in mind that it still is an internal API, so it may break anytime.

Development

Available Scripts
  • npm run dev - Start the server in development mode with hot reloading
  • npm run build - Build the project for production
  • npm run start - Start the production server
  • npm run lint - Run linting checks (ESLint and Prettier)
  • npm run fix - Automatically fix linting issues
  • npm run examples - Run the example scripts
Contributing
  1. Fork the repository
  2. Create your feature branch
  3. Run tests and linting: npm run lint
  4. Commit your changes
  5. Push to the branch
  6. Create a Pull Request

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.