Logo de Notion MCP

Notion MCP

Comunidade
FR0ZON3

Notion mcp to connect AI agents to notion through markdown | Read and write notion markdown

Publicado porFR0ZON3
Repositórionotion-mcp
IdiomaTypeScript
Forks
3
Estrelas
119
Ferramentas disponíveis
0
Tipo de transportestdio
LicençaMIT
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    Notion MCP disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • Ferramentas disponíveis: 0

    Confira abaixo as ações que o cliente MCP pode executar, com nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    Estrelas: 119 e forks: 3 no repositório vinculado.

easy-notion-mcp

Production-oriented MCP server that connects AI agents to Notion through standard markdown instead of raw API JSON.

Agents read and write GFM markdown. The server handles block conversion, database schema mapping, OAuth, and optional Redis-backed persistence for multi-instance deployments.


Feature highlights

CapabilityDetails
Markdown-first I/O42 MCP tools; agents never construct Notion block JSON
Round-trip fidelity24 block types including toggles, columns, callouts, tables, uploads
Database ergonomicsWrite { "Status": "Done" } — schema conversion is automatic
Dual transportStdio (API token) and HTTP (OAuth or bearer-protected static token)
Security defaultsContent-notice prefix, URL sanitization, workspace-root file containment
Optional RedisShared schema cache and OAuth token persistence with graceful fallback
CLI profilesLow-context Notion access via easy-notion with readonly/readwrite modes

Architecture

Request workflow (tool call)


Project structure

easy-notion-mcp/
├── src/
│   ├── index.ts              # Stdio entry point
│   ├── http.ts               # HTTP/OAuth entry point
│   ├── cli.ts                # Profile-based CLI
│   ├── server.ts             # MCP tool & resource handlers
│   ├── notion-client.ts      # Notion SDK integration
│   ├── config/env.ts         # Typed environment parsing
│   ├── logging/logger.ts     # Structured logging
│   ├── persistence/          # Cache + Redis integration
│   │   ├── cache-store.ts
│   │   ├── init.ts
│   │   └── redis/
│   └── auth/                   # OAuth token storage
├── tests/                    # Vitest unit & integration tests
├── docs/AUDIT.md             # Engineering audit notes
├── skills/                   # Agent skill definitions
└── dist/                     # Compiled output (generated)

Design decisions

  • Single server module — tool handlers remain in server.ts to preserve the stable public MCP contract; supporting modules handle cross-cutting concerns.
  • Pluggable cache — CacheStore abstraction allows in-memory (default) or Redis backends without changing Notion client logic.
  • Fail-open Redis — if Redis is configured but unreachable, the server logs a warning and continues with in-memory/file persistence.

Installation

Prerequisites

From source

bash
git clone https://github.com/Grey-Iris/easy-notion-mcp.git
cd easy-notion-mcp
npm install
npm run build

Via npx (published package)

bash
npx -y easy-notion-mcp

MCP client configuration (stdio)

json
{
  "mcpServers": {
    "notion": {
      "command": "npx",
      "args": ["-y", "easy-notion-mcp"],
      "env": {
        "NOTION_TOKEN": "ntn_your_integration_token"
      }
    }
  }
}

Configuration

Copy .env.example to .env when running from a cloned checkout:

bash
cp .env.example .env

Core variables

VariableRequiredDefaultDescription
NOTION_TOKENYes (stdio)—Notion integration token
NOTION_ROOT_PAGE_IDNo—Default parent for create_page
NOTION_TRUST_CONTENTNofalseDisable content-notice prefix on reads
NOTION_MCP_WORKSPACE_ROOTNocwdRoot for local file:// uploads
LOG_LEVELNoinfoLogging verbosity

Redis persistence (optional)

VariableDefaultDescription
REDIS_ENABLEDfalseEnable Redis when true or when REDIS_URL is set
REDIS_URL—Full connection URL
REDIS_HOST127.0.0.1Host (when URL not set)
REDIS_PORT6379Port
REDIS_PASSWORD—Auth password
REDIS_DB0Database index
REDIS_KEY_PREFIXeasy-notion:Key namespace prefix
REDIS_CONNECT_TIMEOUT_MS10000Connection timeout
REDIS_MAX_RETRIES3Retry attempts before fallback

Example with local Redis:

bash
REDIS_ENABLED=true REDIS_URL=redis://127.0.0.1:6379/0 npm start

HTTP transport

VariableRequiredDefaultDescription
NOTION_MCP_BEARERYes (static HTTP)—Shared secret for /mcp requests
NOTION_OAUTH_CLIENT_IDOAuth mode—Public integration client ID
NOTION_OAUTH_CLIENT_SECRETOAuth mode—OAuth client secret
PORTNo3333Listen port
NOTION_MCP_BIND_HOSTNo127.0.0.1Bind address

Development

bash
# Install dependencies
npm install

# Watch mode
npm run dev

# Run stdio server locally
NOTION_TOKEN=ntn_... npm start

# Run HTTP server
NOTION_TOKEN=ntn_... NOTION_MCP_BEARER=$(openssl rand -hex 32) npm run start:http

Quality gates

bash
npm run build      # Compile TypeScript
npm run typecheck  # Type check without emit
npm run lint       # ESLint
npm test           # Vitest unit tests

Testing

bash
# Full unit suite (~850 tests)
npm test

# Watch mode
npm run test:watch

# Live Notion E2E (requires dedicated test workspace)
cp .env.example .env   # set E2E_ROOT_PAGE_ID
npm run test:e2e

Symlink-dependent security tests are automatically skipped on platforms where symlink creation is unavailable (common on Windows without Developer Mode).


Troubleshooting

SymptomLikely causeFix
NOTION_TOKEN is requiredMissing env varSet token in MCP config env block or .env
401 invalid_token (HTTP)Missing/wrong bearerSet NOTION_MCP_BEARER on server; send Authorization: Bearer …
outside the allowed workspace rootFile path escapes rootSet NOTION_MCP_WORKSPACE_ROOT or use absolute paths inside it
Redis warning on startupRedis unreachableStart Redis or set REDIS_ENABLED=false
Unknown property nameStale/wrong schemaCall get_database first; check case sensitivity
Symlink tests skippedOS restrictionEnable Windows Developer Mode or run on Linux/macOS

Enable debug logging:

bash
LOG_LEVEL=debug npm start

Contributing

  1. Fork the repository and create a feature branch from main
  2. Make focused changes with tests where behavior changes
  3. Run npm run build && npm run lint && npm test
  4. Open a pull request with a clear description and test plan

See docs/AUDIT.md for architecture context and known improvement areas.


FAQ

How is this different from the official Notion MCP server?
The official server returns raw Notion JSON (~6–7× more tokens per page read). This server converts to markdown agents already understand, with round-trip fidelity for 24 block types.

Do I need Redis?
No. Redis is optional and improves horizontal scaling (shared schema cache, OAuth tokens across HTTP instances). Single-process stdio deployments work fine without it.

Is markdown round-trip lossless?
For supported block types, yes. Unsupported native blocks (e.g. synced_block, embedded databases) emit warnings so agents avoid destructive rewrites.

Does file upload work over HTTP?
No. file:// uploads are stdio-only for security. Use HTTPS URLs or stdio transport for local files.

What Node version is required?
Node.js 20 or later.


License

MIT — see LICENSE.

Use o MCP de Notion MCP com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar Notion MCP, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, acesse Configurações > Configurações avançadas > Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Configurações.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione Notion MCP como servidor

Quando o status do conector for Pronto, clique em Editar servidores e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar servidores.
  3. Cole a configuração do servidor MCP de Notion MCP.
  4. Salve a lista de servidores.
  5. Se quiser confirmar que o conector ainda está pronto para uso, atualize a página.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar servidores
{
  "mcpServers": {
    "fr0zon3-notion-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de Notion MCP, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de Notion MCP.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar Notion MCP para me ajudar nesta tarefa?
Notion MCP
Claro. Já li.
Veja o que encontrei usando Notion MCP.

Perguntas frequentes

Para que serve o servidor MCP Notion MCP?

Notion MCP é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP Notion MCP com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar Notion MCP com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP Notion MCP com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com Notion MCP conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP Notion MCP ao TypingMind?

Notion MCP funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP Notion MCP oferece no TypingMind?

Notion MCP disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP Notion MCP?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se Notion MCP exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇