AFFiNE MCP Server
Read, write and organise AFFiNE workspaces, docs, databases and comments from an MCP client
MCP endpoint built into the SiYuan note app for searching, reading and editing a workspace's notes
Official · SiYuan Go Local · Streamable HTTP Knowledge and memoryProductivity
74 popularity score ★ 47k
Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
claude mcp add --transport http siyuan http://127.0.0.1:6806/mcp --header 'Authorization: Token <API_TOKEN>'{
"mcpServers": {
"siyuan": {
"url": "http://127.0.0.1:6806/mcp",
"headers": {
"Authorization": "Token <API_TOKEN>"
}
}
}
}{
"servers": {
"siyuan": {
"type": "http",
"url": "http://127.0.0.1:6806/mcp",
"headers": {
"Authorization": "Token <API_TOKEN>"
}
}
}
}[mcp_servers.siyuan]
url = "http://127.0.0.1:6806/mcp"
http_headers = { "Authorization" = "Token <API_TOKEN>" }gemini mcp add --scope user --transport http --header 'Authorization: Token <API_TOKEN>' siyuan http://127.0.0.1:6806/mcpSiYuan is a self-hosted, open-source notes and knowledge app, and its kernel ships an MCP server. Nothing to install. While SiYuan runs, an MCP client points at the /mcp path on the SiYuan address (normally http://127.0.0.1:6806/mcp on your own machine) over Streamable HTTP and sends the API token from SiYuan's settings.
Once connected, the client can search the workspace by full text, or semantically if embeddings are configured. It can also read and edit documents and single blocks, manage notebooks and daily notes, and work with attribute-view databases. Beyond notes, it gets read-only SQL, document history with rollback, data snapshots and sync. Plugins and themes from the marketplace can be installed too. Three tools go out to the web.
The source registers 30 tools for outside clients at the current release. A handful more (log, snippet, todo_write and a few others) are marked agent-only and stay inside SiYuan's own assistant. Which tools a client sees also depends on an exposure policy in SiYuan's AI settings. It allows every tool by default, and single tools can be switched off there (kernel/conf/ai.go). SQL results stop at 100 rows unless the query sets its own LIMIT.
For a public HTTPS deployment SiYuan can also act as an OAuth server, so clients such as ChatGPT can sign in without a pasted token. That is off by default and only works once a lock-screen password or OIDC login is configured.
| Runs on | macOS, Windows, Linux |
|---|---|
| Also |
|
Start SiYuan, copy the API token from its settings and add http://127.0.0.1:6806/mcp to the client with the header Authorization: Token <API_TOKEN> (the code also takes Bearer). For a server, the Docker example runs b3log/siyuan with the serve subcommand, mounts the workspace at /siyuan/workspace and now refuses to start unless an access auth code is set, read from the AuthCode variable. OAuth for remote clients is turned on in SiYuan's MCP settings and needs a public HTTPS address.
A fit for people who already keep their notes in SiYuan and want an assistant to search and edit them in place. It is maintained by the SiYuan team and comes with the app, so there is nothing to install or keep in step. Bear in mind that the token is a full admin key: a connected client can delete documents or purge snapshots. Turn off the tools you don't want in the exposure policy, or use read-only mode, which blocks tool calls altogether. If you want remote access from a hosted client, plan for HTTPS, a lock-screen password and OAuth.
8 only read, 10 change things, 12 can delete or overwrite.
searchdocument deletesblock deletesnotebook deletesdatabase changesdailynote changesoutlinerefattr changestag deletesbookmark deletestemplate deletesasset deletesimage changespdf changessqlhistory deletesrepo deletessync changesexport changesimport changesinbox deletesbazaar changesfile deletesweb_fetchweb_searchhttp_request changesskill deletessystemworkspace