/ Diretório / Playground / affine-mcp-server
● Comunidade DAWNCR0W ⚡ Instantâneo

affine-mcp-server

por DAWNCR0W · DAWNCR0W/affine-mcp-server

Connect Claude to your AFFiNE workspaces — 87 tools across docs, databases, comments, blobs, users — with API token, cookie, or email/password auth.

affine-mcp-server exposes 87 tools covering the AFFiNE graph: workspaces, organizations, documents, databases, comments, history, users/tokens, and blob storage. Works against AFFiNE Cloud (with API token) or self-hosted (also supports email/password).

Por que usar

Principais recursos

Demo ao vivo

Como fica na prática

affine.replay ▶ pronto
0/0

Instalar

Escolha seu cliente

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "affine": {
      "command": "npx",
      "args": [
        "-y",
        "affine-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Abra Claude Desktop → Settings → Developer → Edit Config. Reinicie após salvar.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "affine": {
      "command": "npx",
      "args": [
        "-y",
        "affine-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Cursor usa o mesmo esquema mcpServers que o Claude Desktop. Config de projeto vence a global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "affine": {
      "command": "npx",
      "args": [
        "-y",
        "affine-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Clique no ícone MCP Servers na barra lateral do Cline, depois "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "affine": {
      "command": "npx",
      "args": [
        "-y",
        "affine-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Mesmo formato do Claude Desktop. Reinicie o Windsurf para aplicar.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "affine",
      "command": "npx",
      "args": [
        "-y",
        "affine-mcp-server"
      ]
    }
  ]
}

O Continue usa um array de objetos de servidor em vez de um map.

~/.config/zed/settings.json
{
  "context_servers": {
    "affine": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "affine-mcp-server"
        ]
      }
    }
  }
}

Adicione em context_servers. Zed recarrega automaticamente ao salvar.

claude mcp add affine -- npx -y affine-mcp-server

Uma linha só. Verifique com claude mcp list. Remova com claude mcp remove.

Casos de uso

Usos do mundo real: affine-mcp-server

Capture quick notes into AFFiNE from Claude

👤 AFFiNE users using it as their main notes tool ⏱ ~5 min beginner

Quando usar: You're in a conversation and want to capture the takeaway into AFFiNE without context-switching.

Pré-requisitos
  • AFFiNE API token — AFFiNE Cloud: Settings > Integrations > MCP Server
Fluxo
  1. Find the workspace
    List my AFFiNE workspaces. I want to write into 'Personal'.✓ Copiado
    → Workspace list
  2. Create a doc
    Create a new doc titled '2026-04-14 meeting notes' with content [paste]. Put it under /Meetings.✓ Copiado
    → Doc created + URL

Resultado: Notes in AFFiNE without leaving chat.

Armadilhas
  • Email/password auth blocked on Cloud by Cloudflare — Use API token on Cloud; email/password only on self-hosted

Add a row to an AFFiNE database from external signal

👤 Knowledge workers using AFFiNE databases as lightweight CRM / tracker ⏱ ~10 min intermediate

Quando usar: You want each newsletter subscriber from an email to land in your 'Contacts' AFFiNE DB.

Fluxo
  1. List DBs
    Show me databases in my 'Work' workspace.✓ Copiado
    → DB list
  2. Add row
    To database 'Contacts', add a row: name='Jane Doe', email='[email protected]', source='Newsletter', date=today.✓ Copiado
    → Row added with UUID

Resultado: AFFiNE as a lightweight CRM driven by LLM.

Armadilhas
  • Field types must match the DB schema — Get schema first via describe-database-like tool

Search across AFFiNE workspaces and summarize findings

👤 AFFiNE power users with many docs ⏱ ~10 min beginner

Quando usar: You remember writing about X somewhere but can't remember where.

Fluxo
  1. Search
    Search across my workspaces for 'series A process'. List top 10 docs with snippet.✓ Copiado
    → Doc hits with highlights
  2. Summarize
    Load the top 3 docs and summarize the key points + any contradictions.✓ Copiado
    → Cross-doc summary

Resultado: Institutional knowledge surfaced from your own notes.

Combinações

Combine com outros MCPs para 10× de alavancagem

Capture content into AFFiNE

Summarize this video and save to my 'Talks Notes' DB in AFFiNE.✓ Copiado

Ferramentas

O que este MCP expõe

FerramentaEntradasQuando chamarCusto
list_workspaces Navigate your AFFiNE graph 1 API call
search_documents workspace_id, query, limit? Find docs by text 1 API call
create_document workspace_id, title, content, parent_id? Add a new doc 1 API call
update_document doc_id, content | title Edit existing docs 1 API call
add_database_row database_id, fields: obj Structured data entry 1 API call

Custo e limites

O que custa rodar

Cota de API
AFFiNE plan limits
Tokens por chamada
Doc contents vary widely — trim by section where possible
Monetário
Free on AFFiNE self-hosted; Cloud has paid tiers
Dica
Prefer search_documents over listing + filtering in code.

Segurança

Permissões, segredos, alcance

Escopos mínimos: Workspace-scoped API token where possible
Armazenamento de credenciais: AFFINE_API_TOKEN env var; never commit
Saída de dados: Your AFFiNE data to LLM provider
Nunca conceda: Cookie auth on a shared machine — cookies are user-session-equivalent

Solução de problemas

Erros comuns e correções

401 / token invalid

Regenerate at Settings > Integrations > MCP Server. Paste fresh token into env.

Cannot find workspace

Server-backed vs local-only confusion. Only server-backed workspaces are accessible.

Verificar: Open AFFiNE UI; is the workspace cloud-synced?
DB row rejected — field type mismatch

Get schema first, match types. Dates often need ISO-8601 strings.

Alternativas

affine-mcp-server vs. outros

AlternativaQuando usarTroca
Notion MCPYou use Notion instead of AFFiNEDifferent product; more mature ecosystem
Obsidian MCPYou're all-in on Obsidian markdown filesLocal-first; different philosophy

Mais

Recursos

📖 Leia o README oficial no GitHub

🐙 Ver issues abertas

🔍 Ver todos os 400+ servidores MCP e Skills