Model Context Protocol server for AFFiNE. Connect AI assistants to AFFiNE workspaces, documents, databases, and collaboration APIs over stdio or HTTP.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add affine --env AFFINE_BASE_URL='<AFFINE_BASE_URL>' --env AFFINE_COOKIE='<AFFINE_COOKIE>' --env MCP_TRANSPORT='<MCP_TRANSPORT>' -- node dist/index.js~/.codex/config.toml
[mcp_servers.affine]
command = "node"
args = ["dist/index.js"]
env = { AFFINE_BASE_URL = "<AFFINE_BASE_URL>", AFFINE_COOKIE = "<AFFINE_COOKIE>", MCP_TRANSPORT = "<MCP_TRANSPORT>" }
# codex mcp add affine --env AFFINE_BASE_URL='<AFFINE_BASE_URL>' --env AFFINE_COOKIE='<AFFINE_COOKIE>' --env MCP_TRANSPORT='<MCP_TRANSPORT>' -- node dist/index.js~/.cursor/mcp.json
{
"mcpServers": {
"affine": {
"command": "node",
"args": [
"dist/index.js"
],
"env": {
"AFFINE_BASE_URL": "<AFFINE_BASE_URL>",
"AFFINE_COOKIE": "<AFFINE_COOKIE>",
"MCP_TRANSPORT": "<MCP_TRANSPORT>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"affine": {
"type": "stdio",
"command": "node",
"args": [
"dist/index.js"
],
"env": {
"AFFINE_BASE_URL": "<AFFINE_BASE_URL>",
"AFFINE_COOKIE": "<AFFINE_COOKIE>",
"MCP_TRANSPORT": "<MCP_TRANSPORT>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"affine": {
"command": "node",
"args": [
"dist/index.js"
],
"env": {
"AFFINE_BASE_URL": "<AFFINE_BASE_URL>",
"AFFINE_COOKIE": "<AFFINE_COOKIE>",
"MCP_TRANSPORT": "<MCP_TRANSPORT>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"affine": {
"command": "node",
"args": [
"dist/index.js"
],
"env": {
"AFFINE_BASE_URL": "<AFFINE_BASE_URL>",
"AFFINE_COOKIE": "<AFFINE_COOKIE>",
"MCP_TRANSPORT": "<MCP_TRANSPORT>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"affine": {
"command": "node",
"args": [
"dist/index.js"
],
"env": {
"AFFINE_BASE_URL": "<AFFINE_BASE_URL>",
"AFFINE_COOKIE": "<AFFINE_COOKIE>",
"MCP_TRANSPORT": "<MCP_TRANSPORT>"
}
}
}
}Environment variables
AFFINE_BASE_URLAFFINE_COOKIEMCP_TRANSPORT
Replace the placeholders with your own credentials and keep them out of version control.