Affine

v2.0.0Knowledge & Memorystable

Model Context Protocol server for AFFiNE. Connect AI assistants to AFFiNE workspaces, documents, databases, and collaboration APIs over stdio or HTTP.

affineai-assistantsclaudecodexcursor
Share:
169
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 model context protocol server for affine. connect ai assistants to affine workspaces, documents, databases, and collaboration apis over stdio or http.

Model Context Protocol server for AFFiNE. Connect AI assistants to AFFiNE workspaces, documents, databases, and collaboration APIs over stdio or HTTP.

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

Features

  • Model Context Protocol server for AFFiNE. Connect AI assista

Use Cases

Connect AI to AFFiNE workspaces and documents.
Access databases and collaboration APIs via MCP.
DAWNCR0W

Maintainer

LicenseMIT
Languagetypescript
Versionv2.0.0
UpdatedMay 20, 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 exposes 85 canonical tools that connect AI assistants to AFFiNE workspaces — an open-source, privacy-first alternative to Notion — over stdio or HTTP transport. Through this server, agents can create, read, search, update, and publish documents; manage databases, rows, and columns; handle workspace organisation, comments, and blob storage; and compose pages semantically from templates. It works with AFFiNE Cloud or a self-hosted AFFiNE instance, and integrates with Claude Code, Claude Desktop, Codex CLI, and Cursor.

Prerequisites

  • An AFFiNE Cloud account (affine.pro) or a self-hosted AFFiNE instance (server-backed workspaces only — browser-local workspaces are not supported)
  • An AFFiNE API token (generate from your AFFiNE account settings)
  • Node.js and npm installed (for CLI installation)
  • An MCP-compatible AI client: Claude Code, Claude Desktop, Codex CLI, or Cursor
1

Install the AFFiNE MCP server

Install the package globally via npm so the affine-mcp command is available system-wide.

npm i -g affine-mcp-server
2

Authenticate with your AFFiNE instance

Run the interactive login command to set your AFFiNE base URL and API token. Credentials are stored securely in ~/.config/affine-mcp/config (mode 600).

affine-mcp login
3

Verify the connection

Check that the server can reach your AFFiNE instance and that credentials are valid.

affine-mcp status
affine-mcp doctor
4

Add to your MCP client configuration

Add the AFFiNE MCP server to your Claude Desktop or Claude Code configuration file. The AFFINE_BASE_URL and AFFINE_API_TOKEN must match your instance.

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

(Optional) Restrict the tool surface

Control which of the 85 tools are exposed by setting AFFINE_TOOL_PROFILE to read_only, core, authoring, or full. You can also disable specific tool groups.

# In your MCP env config:
# "AFFINE_TOOL_PROFILE": "core"
# "AFFINE_DISABLED_GROUPS": "blob,notifications"
6

(Optional) Deploy with HTTP transport for remote access

Run the server as an HTTP endpoint for multi-user or remote Claude.ai integration.

docker run -d -p 3000:3000 \
  -e MCP_TRANSPORT=http \
  -e AFFINE_BASE_URL=https://app.affine.pro \
  -e AFFINE_API_TOKEN=ut_your_token_here \
  -e AFFINE_MCP_AUTH_MODE=bearer \
  -e AFFINE_MCP_HTTP_TOKEN=your-strong-secret \
  ghcr.io/dawncr0w/affine-mcp-server:latest

Affine Examples

Client configuration (Claude Desktop, stdio)

Standard stdio configuration for local use with Claude Desktop or Claude Code.

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

Prompts to try

Example prompts that use the AFFiNE MCP tools to manage documents, databases, and workspaces.

- "Search my AFFiNE workspace for all documents about the Q3 roadmap."
- "Create a new document called 'Sprint Planning' in the Engineering workspace."
- "Add a row to the Project Tracker database with the name 'API v2' and status 'In Progress'."
- "Publish the 'Release Notes v2.0' page and give me the public link."
- "List all comments on the 'Architecture Decision Record' document."

Troubleshooting Affine

Authentication fails with 'invalid token' or 401 error

Regenerate your API token in AFFiNE account settings. Tokens starting with 'ut_' are user tokens; ensure you are using a token for the correct account and instance URL.

Tools work on AFFiNE Cloud but not on a self-hosted instance

Verify AFFINE_BASE_URL points to your self-hosted instance URL (not app.affine.pro) and that the instance is accessible from the machine running the MCP server. Run 'affine-mcp doctor' to diagnose connectivity.

Browser-local AFFiNE workspace not visible

The MCP server only works with server-backed workspaces. Local-only AFFiNE workspaces stored in the browser cannot be accessed via API. Sync your workspace to AFFiNE Cloud or a self-hosted server first.

Frequently Asked Questions about Affine

What is Affine?

Affine is a Model Context Protocol (MCP) server that model context protocol server for affine. connect ai assistants to affine workspaces, documents, databases, and collaboration apis over stdio or http. 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. 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": { "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