AFFiNE

v2.1.0Knowledge & Memorystable

Enables interaction with AFFiNE workspaces through GraphQL API to manage documents, search content, handle comments, and access version history. Supports comprehensive workspace operations including document publishing, comment management, and user a

affineai-assistantsclaudecodexcursor
Share:
171
Stars
0
Downloads
0
Weekly
0/5

What is AFFiNE?

AFFiNE is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables interaction with affine workspaces through graphql api to manage documents, search content, handle comments, and access version history. supports comprehensive workspace operations including d...

Enables interaction with AFFiNE workspaces through GraphQL API to manage documents, search content, handle comments, and access version history. Supports comprehensive workspace operations including document publishing, comment management, and user a

This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables interaction with AFFiNE workspaces through GraphQL A

Use Cases

Access and manage documents in AFFiNE workspaces.
Search workspace content and handle collaborative comments.
Publish documents and manage version history.
DAWNCR0W

Maintainer

LicenseMIT License
Languagetypescript
Versionv2.1.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y affine-mcp-server

Manual Installation

npx -y affine-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use AFFiNE

The AFFiNE MCP Server connects AI assistants to AFFiNE workspaces — the open-source, local-first collaborative knowledge base — through AFFiNE's GraphQL API, exposing 85 tools for creating, searching, reading, publishing, and managing documents, databases, comments, version history, and workspace administration. It supports both AFFiNE Cloud and self-hosted deployments and offers four tool profile levels (read-only, core, authoring, full) so teams can control exactly what operations the AI can perform. Developers and knowledge workers can use it to automate document workflows, query workspace content, and manage collaborative notes directly from Claude or other MCP-compatible clients.

Prerequisites

  • Node.js 18+ installed (required for npx or global npm install)
  • An AFFiNE account on AFFiNE Cloud (https://app.affine.pro) or a self-hosted AFFiNE instance
  • An AFFiNE personal access token (generated in AFFiNE account settings)
  • The base URL of your AFFiNE instance (e.g. https://app.affine.pro for cloud)
  • An MCP-compatible client such as Claude Desktop, Claude Code, Cursor, or Codex
1

Install the AFFiNE MCP server

Install the package globally via npm so the `affine-mcp` binary is available on your PATH.

npm i -g affine-mcp-server
2

Log in to AFFiNE from the CLI

Run the login command to authenticate. This saves your credentials to `~/.config/affine-mcp/config` with restricted permissions. You can also set environment variables instead if you prefer.

affine-mcp login
3

Set environment variables for automated or Docker deployments

For scripted setups or Docker, configure the server via environment variables instead of interactive login.

export AFFINE_BASE_URL=https://app.affine.pro
export AFFINE_API_TOKEN=ut_your_personal_access_token
export MCP_TRANSPORT=stdio
export AFFINE_TOOL_PROFILE=core
4

Verify the configuration

Run the status and doctor commands to confirm the server can reach your AFFiNE instance.

affine-mcp status
affine-mcp doctor
5

Add the server to your MCP client configuration

Register the server in your client's config file. For Claude Code, the simplest form uses the binary directly.

AFFiNE Examples

Client configuration

Claude Desktop config block that launches the AFFiNE MCP server using the globally installed binary.

{
  "mcpServers": {
    "affine": {
      "command": "npx",
      "args": ["-y", "affine-mcp-server"],
      "env": {
        "AFFINE_BASE_URL": "https://app.affine.pro",
        "AFFINE_API_TOKEN": "ut_your_personal_access_token",
        "AFFINE_TOOL_PROFILE": "core"
      }
    }
  }
}

Prompts to try

Example AFFiNE workspace operations you can ask once the server is connected.

- "List all workspaces I have access to in AFFiNE"
- "Search for documents about Q3 planning in my workspace"
- "Create a new document titled 'Meeting Notes — June 2026' in the Engineering workspace"
- "Show me the version history for the Architecture Overview document"
- "Add a comment to the API Design document saying the authentication section needs review"

Troubleshooting AFFiNE

Login fails or credentials are rejected

Generate a fresh personal access token in AFFiNE account settings under Tokens and set it as `AFFINE_API_TOKEN`. Run `affine-mcp show-config` (secrets are redacted) to verify the base URL and token are loaded correctly, and `affine-mcp doctor` to test connectivity.

Only some tools are available — expected 85 but see fewer

The active tool profile controls which tools are exposed. Set `AFFINE_TOOL_PROFILE=full` to enable all 85 tools, or review which groups are disabled via `AFFINE_DISABLED_GROUPS`. The default `core` profile intentionally excludes destructive and admin tool groups.

Tools fail with GraphQL errors on a self-hosted AFFiNE instance

Confirm `AFFINE_BASE_URL` points to the root of your self-hosted instance (no trailing slash, no path suffix). Run `affine-mcp doctor` to diagnose API reachability. Ensure your AFFiNE instance version is compatible with the server's GraphQL schema.

Frequently Asked Questions about AFFiNE

What is AFFiNE?

AFFiNE is a Model Context Protocol (MCP) server that enables interaction with affine workspaces through graphql api to manage documents, search content, handle comments, and access version history. supports comprehensive workspace operations including document publishing, comment management, and user a It connects AI assistants to external tools and data sources through a standardized interface.

How do I install AFFiNE?

Install via npm with the command: npx -y affine-mcp-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with AFFiNE?

AFFiNE works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is AFFiNE free to use?

Yes, AFFiNE is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Knowledge & Memory MCP Servers

Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "affine-mcp-server": { "command": "npx", "args": ["-y", "affine-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use AFFiNE?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides