AFFiNE
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
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
Maintainer
Works with
Installation
NPM
npx -y affine-mcp-serverManual Installation
npx -y affine-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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-serverLog 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 loginSet 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=coreVerify the configuration
Run the status and doctor commands to confirm the server can reach your AFFiNE instance.
affine-mcp status
affine-mcp doctorAdd 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.
AFFiNE Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to AFFiNE? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
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.
Set Up AFFiNE in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.