SiYuan Note MCP Server
The SiYuan Note MCP Server lets AI assistants directly control SiYuan Note via 50+ tools across 12 categories:
📓 Notebook management – Create, delete, rename, and configure notebooks
📄 Document operations – Create, delete, move, and rename documents (with hpath auto-resolution)
🧱 Block editing – Insert, update, delete, move, collapse, and expand content blocks
🔍 Search & Query – Full-text search, SQL queries, and transaction refresh
📎 Attributes – Get and set block attributes
📁 File system – Read, write, delete, rename files, and list directories
📋 Templates – Render templates with Sprig support
📤 Export – Export documents as Markdown or resource packages
🔄 Conversion – Pandoc format conversion
🔔 Notifications – Push messages/notifications
🌐 Network – Forward proxy requests
⚙️ System – Query version, startup progress, and current time
Key meta-tools include executeCommand (run any SiYuan command), queryCommands (discover available commands), and help (get detailed command documentation).
Provides a comprehensive set of tools for interacting with SiYuan Note, enabling management of notebooks, documents, and content blocks, as well as full-text search, SQL querying, and template rendering.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SiYuan Note MCP Server search my notes for 'machine learning' and summarize the key points"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🧠 思源笔记 MCP 服务器
让 AI 助手直接操作思源笔记的 Model Context Protocol 服务器
适配版本
项目 | 版本 |
思源笔记 | >= 3.0.0(已验证 3.7.1) |
SiYuan API | docs/API.md(50 个非 Database 端点) |
Node.js | >= 18.0.0 |
MCP SDK | @modelcontextprotocol/sdk ^1.8.0 |
Related MCP server: SiYuan MCP Server
快速开始
# 直接运行
SIYUAN_TOKEN=your-api-token npx @fromsko/siyuan-mcp-server
# 全局安装
npm install -g @fromsko/siyuan-mcp-server
SIYUAN_TOKEN=your-api-token siyuan-mcp-server环境变量 | 必需 | 说明 | 默认值 |
| ✅ | 思源笔记 API Token(设置 → 关于) | — |
| ❌ | 思源 API 地址 |
|
给 LLM 的配置说明
如果你是 AI 助手,请将以下配置添加到你的 MCP 客户端配置中:
{
"mcpServers": {
"siyuan": {
"command": "npx",
"args": ["-y", "@fromsko/siyuan-mcp-server"],
"env": {
"SIYUAN_TOKEN": "<用户提供的 API Token>",
"SIYUAN_API_URL": "http://localhost:6806"
}
}
}
}配置文件位置:
Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json(macOS)或%APPDATA%\Claude\claude_desktop_config.json(Windows)Cursor:
.cursor/mcp.json
配置完成后重启客户端,即可使用 50 个思源笔记操作工具(笔记本管理、文档操作、块级编辑、全文搜索、SQL 查询等)。
功能概览
类别 | 命令空间 | 端点数 | 能力 |
📓 笔记本 |
| 8 | 创建/删除/重命名/配置 |
📄 文档 |
| 11 | 创建/删除/移动/重命名(支持 hpath 自动解析) |
🧱 块操作 |
| 11 | 插入/更新/删除/移动/折叠/展开 |
🔍 搜索 |
| 3 | 全文搜索/SQL 查询/事务刷新 |
📎 属性 |
| 2 | 设置/获取块属性 |
📁 文件 |
| 5 | 读写/删除/重命名/列目录 |
📋 模板 |
| 2 | 渲染模板/Sprig |
📤 导出 |
| 2 | 导出 Markdown/导出资源包 |
🔄 转换 |
| 1 | Pandoc 格式转换 |
🔔 通知 |
| 2 | 推送消息 |
🌐 网络 |
| 1 | 正向代理 |
⚙️ 系统 |
| 3 | 版本/启动进度/当前时间 |
开发
git clone https://github.com/Fromsko/siyuan-mcp-server.git
cd siyuan-mcp-server
npm install && npm run build && npm test详细开发文档:
文档 | 说明 |
开发指南、项目结构、添加端点流程 | |
MCP 使用指南 | |
官方 SiYuan API 文档 | |
LLM 导向的项目简介 | |
提交规范和开发约束 |
问题排查
无法连接思源笔记 → 检查:思源是否运行、Token 是否正确、端口是否正确(默认 6806)
命令执行失败 → 确认笔记本/文档存在、Token 权限足够
连接远程思源 → 设置 SIYUAN_API_URL=http://your-server:6806
开源协议
ISC — 详见 LICENSE
致谢
Available Tools
3 toolsexecuteCommandD
执行指定的命令
Inputs: type (required), params.
helpB
获取命令的帮助信息
Inputs: type (required).
queryCommandsA
查询可用的命令列表
Inputs: type, namespace.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: executeCommand runs a command, help retrieves help information, and queryCommands lists available commands. There is no overlap in functionality.
Tools use camelCase naming, but 'help' is a single word while others follow a verb_noun pattern. This minor inconsistency is acceptable but not perfectly uniform.
With only 3 tools, the server seems underdeveloped for a note-taking application. The tools are limited to command execution and help, lacking any note-specific operations.
The tool set is incomplete for a note server; there are no tools for creating, reading, updating, or deleting notes. The server focuses on generic command execution rather than note management.
Maintenance
Related MCP Connectors
AI access to your aNotepad online notes: read, search, write, and organize via 22 tools.
Create, search, and update notes in an xNotepad AI notebook, with semantic search and AI Q&A.
Connect AI to your flomo notes. Search, create, edit notes and manage tags via MCP.
Read, search and edit your Sidenote notepads, whiteboards and images with your sync key.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables interaction with SiYuan Note through its API for comprehensive note management. Supports searching, creating, editing documents, managing notebooks, and daily notes operations through natural language commands.15Apache 2.0
- AlicenseBqualityDmaintenanceEnables AI assistants to create, read, update, and manage SiYuan notes, supporting notebook management, document operations, block editing, database attribute views, search, file operations, and export.111MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to interact with SiYuan Note through its API, supporting notebook and document management, block operations, search, file operations, and more.69137 npm75MIT
- AlicenseBqualityDmaintenanceEnables AI models to interact with SiYuan Note systems, allowing management of notebooks, documents, blocks, files, and more through natural language.3ISC