Model Context Protocol server for AFFiNE. Connect AI assistants to AFFiNE workspaces, documents, databases, and collaboration APIs over stdio or HTTP.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
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>"
}
}
}
}需要的环境变量
AFFINE_BASE_URLAFFINE_COOKIEMCP_TRANSPORT
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。