SiYuan MCP Server

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

Connect your client

Local (once it is running)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

Claude CodeTerminal
claude mcp add --transport http siyuan http://127.0.0.1:6806/mcp --header 'Authorization: Token <API_TOKEN>'
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "siyuan": {
      "url": "http://127.0.0.1:6806/mcp",
      "headers": {
        "Authorization": "Token <API_TOKEN>"
      }
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "siyuan": {
      "type": "http",
      "url": "http://127.0.0.1:6806/mcp",
      "headers": {
        "Authorization": "Token <API_TOKEN>"
      }
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.siyuan]
url = "http://127.0.0.1:6806/mcp"
http_headers = { "Authorization" = "Token <API_TOKEN>" }
Gemini CLITerminal
gemini mcp add --scope user --transport http --header 'Authorization: Token <API_TOKEN>' siyuan http://127.0.0.1:6806/mcp

What it does

SiYuan 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.

What it needs

Runs onmacOS, Windows, Linux
Also
  • SiYuan running (desktop app or the b3log/siyuan Docker image) and reachable from the client
  • API token from SiYuan's settings

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.

Limits

  • Limit Read-only mode rejects MCP POST and DELETE requests, so tools cannot be called while it is on.
  • Not covered OAuth sign-in leaves encrypted notebooks locked. Opening them still happens in the app.
  • Size cap sql returns at most 100 rows by default. Use LIMIT and OFFSET for more.
  • Limit The tool set can change with SiYuan version and settings. A per-tool exposure policy in the AI settings can hide tools.
  • Cost The inbox tool needs a SiYuan subscription. web_search through DeepSeek is charged per request.
  • Limit OAuth is off by default and needs a lock-screen password or OIDC login plus a public HTTPS address.
  • Not covered The Docker build does not support PDF, HTML or Word export, or importing Markdown files.

Who it suits

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.

Tools 30

8 only read, 10 change things, 12 can delete or overwrite.

search
Full-text, semantic and asset-content search across the workspace.
document deletes
Get, create, list, rename, move, duplicate, delete and look up documents.
block deletes
Read blocks and their children, and insert, update, move or delete content blocks.
notebook deletes
List, open, close, create, rename and remove notebooks, and set their icons.
database changes
Create, search, render and edit attribute views (databases) and their columns.
dailynote changes
Create today's daily note or add blocks to it.
outline
Return a document's heading tree.
ref
Show backlinks and mentions of a block.
attr changes
Read and set block attributes.
tag deletes
List, rename and remove tags.
bookmark deletes
List, rename and remove bookmarks.
template deletes
Search, render, save, create and remove templates.
asset deletes
Upload assets, make HTML assets, find unused ones and clean them up.
image changes
List and analyze images a document references, or generate a new image asset.
pdf changes
List, preview and extract embedded images from a PDF in the workspace.
sql
Run SELECT queries on SiYuan's database or show its schema.
history deletes
List, search and read document history, roll back or clear it.
repo deletes
Data snapshots: list, create, tag, check out, diff, purge and restore files.
sync changes
Run a full sync, upload or download, and read sync status.
export changes
Export a document as Markdown, HTML, Word or .sy.zip, or the whole workspace as a backup.
import changes
Import Markdown, .sy.zip or a full backup from local paths.
inbox deletes
List cloud inbox items and turn them into documents, deleting the cloud copies by default.
bazaar changes
Browse, install, update, enable and remove marketplace plugins, themes and other packages.
file deletes
List, read, grep, write, edit, rename and delete files inside the workspace folder.
web_fetch
Fetch a public page as Markdown or text, directly or through DeepSeek.
web_search
Search the web through the configured provider, Exa or DeepSeek.
http_request changes
Send a GET, POST, PUT, PATCH or DELETE request and return the raw response.
skill deletes
Load, save, install, rename and remove skills.
system
Report the version, current time and workspace path.
workspace
List workspaces and show workspace info.

Similar servers