/ Directory / Playground / affine-mcp-server
● Community DAWNCR0W ⚡ Instant

affine-mcp-server

by 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).

Why use it

Key features

Live Demo

What it looks like in practice

affine.replay ▶ ready
0/0

Install

Pick your client

~/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
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

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

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

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

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

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

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

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

Continue uses an array of server objects rather than a map.

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

Add to context_servers. Zed hot-reloads on save.

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

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use affine-mcp-server

Capture quick notes into AFFiNE from Claude

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

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

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

Outcome: Notes in AFFiNE without leaving chat.

Pitfalls
  • 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

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

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

Outcome: AFFiNE as a lightweight CRM driven by LLM.

Pitfalls
  • 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

When to use: You remember writing about X somewhere but can't remember where.

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

Outcome: Institutional knowledge surfaced from your own notes.

Combinations

Pair with other MCPs for X10 leverage

Capture content into AFFiNE

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

Tools

What this MCP exposes

ToolInputsWhen to callCost
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

Cost & Limits

What this costs to run

API quota
AFFiNE plan limits
Tokens per call
Doc contents vary widely — trim by section where possible
Monetary
Free on AFFiNE self-hosted; Cloud has paid tiers
Tip
Prefer search_documents over listing + filtering in code.

Security

Permissions, secrets, blast radius

Minimum scopes: Workspace-scoped API token where possible
Credential storage: AFFINE_API_TOKEN env var; never commit
Data egress: Your AFFiNE data to LLM provider
Never grant: Cookie auth on a shared machine — cookies are user-session-equivalent

Troubleshooting

Common errors and fixes

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.

Verify: 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.

Alternatives

affine-mcp-server vs others

AlternativeWhen to use it insteadTradeoff
Notion MCPYou use Notion instead of AFFiNEDifferent product; more mature ecosystem
Obsidian MCPYou're all-in on Obsidian markdown filesLocal-first; different philosophy

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills