Affine
Model Context Protocol server for AFFiNE. Connect AI assistants to AFFiNE workspaces, documents, databases, and collaboration APIs over stdio or HTTP.
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
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 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
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-serverAuthenticate 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 loginVerify the connection
Check that the server can reach your AFFiNE instance and that credentials are valid.
affine-mcp status
affine-mcp doctorAdd 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"
}
}
}
}(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"(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:latestAffine 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.
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.