Safe, structured Model Context Protocol server for SiYuan Note
Siyuan MCP server exists for a simple reason — assistants are far more useful when they can act on Siyuan directly instead of describing what you should do. Safe, structured Model Context Protocol server for SiYuan Note.
siyuan-mcp 是一个基于 Model Context Protocol 的思源笔记 MCP 服务器。它通过思源 Kernel API 提供笔记本、文档、内容块、全文搜索、原生数据库、资源文件和导出等能力,并针对 AI 自动化场景增加了结构化返回、安全注解与默认防护。
The server ships on npm as siyuan-mcp, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.
Once Siyuan is connected, these are the calls the assistant has available:
command — npxargs — ["-y", "siyuan-mcp@latest"]env — - SIYUAN_HOSTSIYUAN_PORT — SIYUAN_TOKENcheck_siyuan_status — list_notebooksget_version — --nextID — previousIDlist_notebooks — 列出所有笔记本及打开状态create_notebook — 创建笔记本rename_notebook — 重命名笔记本remove_notebook — 删除笔记本,属于危险操作create_doc — 使用 Markdown 创建文档You will need 4 environment variables: SIYUAN_HOST, SIYUAN_PORT, SIYUAN_TOKEN, SIYUAN_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
This sits in the planning and project tracking group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Siyuan's toolset — command, args, env and 11 more — is a fair guide to whether it matches your workflow. It is maintained by xuguiqi; worth a glance at recent repository activity before you build anything load-bearing on it.
This entry was verified against Siyuan's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| command | npx |
| args | ["-y", "siyuan-mcp@latest"] |
| env | - SIYUAN_HOST |
| SIYUAN_PORT | SIYUAN_TOKEN |
| check_siyuan_status | list_notebooks |
| get_version | -- |
| nextID | previousID |
| list_notebooks | 列出所有笔记本及打开状态 |
| create_notebook | 创建笔记本 |
| rename_notebook | 重命名笔记本 |
| remove_notebook | 删除笔记本,属于危险操作 |
| create_doc | 使用 Markdown 创建文档 |
| search_docs | 按标题搜索文档 |
| list_docs | 浏览指定路径下的文档 |
### MCP 客户端配置
下面的配置用于连接运行在宿主机上的思源:
```json
{
"mcpServers": {
"siyuan_note": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--add-host",
"host.docker.internal:host-gateway",
"-e",
"SIYUAN_HOST=host.docker.internal",
"-e",
"SIYUAN_PORT=6806",
"-e",
"SIYUAN_TOKEN",
"zhizhiqq/siyuan-mcp:latest"
],
"env": {
"SIYUAN_TOKEN": "your-api-token-here"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| SIYUAN_HOST | Endpoint or connection string the server talks to. | Optional |
| SIYUAN_PORT | Configuration value read at startup. | Optional |
| SIYUAN_TOKEN | Credential the server authenticates with. | Yes |
| SIYUAN_URL | Endpoint or connection string the server talks to. | Yes |
Your workspace, on speaking terms with AI — search, read and write Notion pages and databases.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Search and read your Drive — Docs, Sheets and files become context your assistant can actually use.
Your assistant inside the workspace — read channels, search history, post messages and tame the noise.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Stop letting your assistant hallucinate n8n node parameters — this server hands it the real schemas, templates and validation.