siyuan-mcp-server
Provides integration with the SiYuan Note system, enabling AI models to access and manipulate note data including notebooks, documents, blocks, files, and assets.
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-mcp-serverlist all my notebooks"
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.
SiYuan Note MCP Server
一个 MCP 服务器实现,提供与思源笔记系统的集成,使 AI 模型能够访问和操作笔记数据。
An MCP server implementation that provides integration with the SiYuan Note system, enabling AI models to access and manipulate note data.
功能特性 | Features
笔记本管理 | Notebook Management
文档操作 | Document Operations
内容块控制 | Block Control
文件和资源管理 | File and Asset Management
SQL 查询支持 | SQL Query Support
属性管理 | Attribute Management
导出和转换 | Export and Conversion
系统功能 | System Functions
Related MCP server: SiYuan Note MCP Server
命令列表 | Command List
所有命令都支持使用 help 查询获取详细说明。例如:
All commands support detailed documentation via the help command. For example:
{
"type": "help",
"params": {
"type": "block.insertBlock"
}
}资源管理 | Asset Management
assets.uploadAssets- 上传资源文件 | Upload assets
属性管理 | Attribute Management
attr.setBlockAttrs- 设置块属性 | Set block attributesattr.getBlockAttrs- 获取块属性 | Get block attributes
内容块操作 | Block Operations
block.insertBlock- 插入内容块 | Insert a blockblock.updateBlock- 更新内容块 | Update block contentblock.deleteBlock- 删除内容块 | Delete a blockblock.moveBlock- 移动内容块 | Move a blockblock.getBlockKramdown- 获取块的 Markdown 内容 | Get block Kramdown content
格式转换 | Format Conversion
convert.pandoc- 使用 Pandoc 转换内容 | Convert content using Pandoc
导出功能 | Export Functions
export.exportNotebook- 导出笔记本 | Export notebookexport.exportDoc- 导出文档 | Export document
文件操作 | File Operations
file.getFile- 获取文件内容 | Get file contentfile.putFile- 写入文件内容 | Put file contentfile.removeFile- 删除文件 | Remove filefile.readDir- 读取目录内容 | List files in directory
文档树操作 | File Tree Operations
filetree.createDocWithMd- 使用 Markdown 创建文档 | Create document with Markdownfiletree.renameDoc- 重命名文档 | Rename documentfiletree.removeDoc- 删除文档 | Remove documentfiletree.moveDocs- 移动文档 | Move documentsfiletree.getHPathByPath- 获取文档可读路径 | Get document HPath by pathfiletree.getHPathByID- 通过 ID 获取文档可读路径 | Get document HPath by ID
网络代理 | Network Proxy
network.forwardProxy- 网络请求代理 | Forward proxy request
笔记本管理 | Notebook Management
notebook.lsNotebooks- 列出所有笔记本 | List all notebooksnotebook.openNotebook- 打开笔记本 | Open notebooknotebook.closeNotebook- 关闭笔记本 | Close notebooknotebook.renameNotebook- 重命名笔记本 | Rename notebooknotebook.createNotebook- 创建笔记本 | Create notebooknotebook.removeNotebook- 删除笔记本 | Remove notebooknotebook.getNotebookConf- 获取笔记本配置 | Get notebook configurationnotebook.setNotebookConf- 设置笔记本配置 | Set notebook configuration
通知提醒 | Notifications
notification.pushMsg- 发送消息通知 | Push message notificationnotification.pushErrMsg- 发送错误通知 | Push error message notification
查询功能 | Query Functions
query.sql- 执行 SQL 查询 | Execute SQL queryquery.block- 通过 ID 查询块 | Query block by ID
搜索功能 | Search Functions
search.fullTextSearch- 全文搜索 | Full text search
SQL 查询 | SQL Query
sql.sql- 执行 SQL 查询 | Execute SQL query
系统功能 | System Functions
system.getBootProgress- 获取启动进度 | Get boot progresssystem.getVersion- 获取系统版本 | Get system versionsystem.getCurrentTime- 获取当前时间 | Get current time
模板功能 | Template Functions
template.renderTemplate- 渲染模板 | Render templatetemplate.renderSprig- 渲染 Sprig 模板 | Render Sprig template
使用说明 | Usage
环境变量配置 | Environment Variables
服务器需要配置以下环境变量: The server requires the following environment variables:
SIYUAN_TOKEN- 思源笔记 API 令牌(必需)| SiYuan Note API token (required)在思源笔记设置 - 关于 中查看 | Check in SiYuan Note Settings - About
用于 API 认证 | Used for API authentication
在 Claude Desktop 中使用 | Using in Claude Desktop
将以下配置添加到 claude_desktop_config.json:
Add the following configuration to claude_desktop_config.json:
{
"mcpServers": {
"siyuan": {
"command": "npx",
"args": [
"-y",
"@onigeya/siyuan-mcp-server"
],
"env": {
"SIYUAN_TOKEN": "your-siyuan-token"
}
}
}
}本地运行 | Local Run
安装依赖 | Install dependencies:
pnpm install设置环境变量 | Set environment variables:
# Windows
set SIYUAN_TOKEN=your-siyuan-token
# Linux/macOS
export SIYUAN_TOKEN=your-siyuan-token启动服务 | Start service:
pnpm startDocker 运行 | Docker Run
docker run --rm -i \
-e SIYUAN_TOKEN=your-siyuan-token \
mcp/siyuan构建 | Build
环境要求 | Requirements
Node.js >= 23.10.0
pnpm
本地构建 | Local Build
pnpm buildDocker 构建 | Docker Build
docker build -t mcp/siyuan .许可证 | License
本项目基于 ISC 许可证发布。这意味着你可以自由使用、修改和分发本软件,但需要遵守 ISC 许可证的条款和条件。详细信息请参见项目仓库中的 LICENSE 文件。
This project is released under the ISC License. This means you can freely use, modify, and distribute this software, subject to the terms and conditions of the ISC License. For detailed information, please refer to the LICENSE file in the project repository.
相关资源 | Related Resources
Available Tools
3 toolsexecuteCommandD
执行指定的命令
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | 命令类型 | |
| params | No | 命令参数 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations present, the description must carry the full burden of behavioral disclosure. It merely states 'execute the specified command' without mentioning whether it can cause side effects, require permissions, return output, or fail. For a command execution tool, this is a significant transparency gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single short sentence, but it is under-specified rather than concise. It lacks essential information and reads like a placeholder, similar to the low-quality 'process' example.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
This tool has two parameters including a nested object, no output schema, and no annotations. The description provides no details on supported command types, parameter structure, return values, or safety implications. It is critically incomplete for an operational tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides descriptions for both parameters (100% coverage), so the baseline is 3. The tool description adds no extra meaning beyond the schema's minimal 'command type' and 'command parameters' labels, but the schema at least names the parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description '执行指定的命令' (Execute the specified command) is a direct tautology of the tool name 'executeCommand'. It does not specify what types of commands, which resources, or how it differs from siblings like queryCommands or help.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No usage guidance is provided. The description gives no context on when to use executeCommand versus alternatives, nor any prerequisites, scenarios, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
helpB
获取命令的帮助信息
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | 命令类型 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry full weight. 'Get help information' implies a read-only, harmless operation, but it does not disclose any specific behaviors such as the format of returned help text, potential errors, or whether it depends on command types. This is acceptable for a simple help tool but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that is directly to the point. It has no fluff or redundant information, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple help tool with one parameter and no output schema, the description is minimally viable. However, it lacks details about acceptable values for 'type', the nature of the help output, and any examples. This leaves gaps that could confuse an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with the parameter 'type' described as '命令类型' (command type). The description adds no additional meaning beyond the schema. Since the schema is complete, the baseline score of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description '获取命令的帮助信息' (Get help information for commands) clearly states the tool's purpose with a specific verb and resource. It differentiates from siblings like executeCommand and queryCommands by focusing on help, though it does not explicitly name alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like queryCommands or executeCommand. There is no context about prerequisites, expected usage, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
queryCommandsA
查询可用的命令列表
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | 命令命名空间过滤 | |
| type | No | 命令名称过滤 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden of behavioral disclosure. The word '查询' implies a read-only operation, but the description does not explicitly state that it makes no changes, nor does it disclose any permissions or return format details. However, for a simple query tool, the implied safety may be sufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that immediately states the tool's purpose. There is no redundant information or unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity and the schema's full parameter coverage, the description provides the essential function. However, it could be improved by explicitly mentioning that it returns a list or how filters interact, but the phrase '命令列表' implies the return type. Overall, it is adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers both parameters (type and namespace) with descriptions, achieving 100% coverage. The tool description adds no additional parameter semantics, so it does not enhance what the schema already provides. Thus, a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb '查询' (query) and identifies the resource as the list of available commands, clearly distinguishing it from sibling tools like executeCommand and help. It does not just restate the tool name, but elaborates on what is being queried.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like help or executeCommand, nor does it mention any exclusions or prerequisites. It leaves the usage to be inferred from the tool name and description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.2.3- First observed
executeCommand - First observed
help - First observed
queryCommands
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: executeCommand runs a command, help provides help for a specific command, and queryCommands lists available commands. No ambiguity.
Two tools follow a verb_noun pattern (executeCommand, queryCommands), but 'help' is a single word that deviates slightly. The inconsistency is minor and does not cause confusion.
With only 3 tools, the surface is tightly scoped for a command execution helper. Each tool is essential and contributes to the core functionality.
The set covers the essential operations: listing available commands, executing them, and getting help. There are no obvious gaps for the intended purpose of a command execution interface.
Maintenance
Related MCP Connectors
Connect AI to your flomo notes. Search, create, edit notes and manage tags via MCP.
Create, search, and update notes in an xNotepad AI notebook, with semantic search and AI Q&A.
- aNotepadOAuthcom.anotepad
AI access to your aNotepad online notes: read, search, write, and organize via 22 tools.
- KnowtisOAuthapp.knowtis
Create, search and manage Knowtis collaborative notes from AI assistants.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables 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.18 npm15Apache 2.0
- AlicenseCqualityAmaintenanceEnables AI assistants to interact with SiYuan Note for comprehensive notebook management, document editing, and block-level content operations. It supports advanced features like full-text search and SQL queries via secure API integration.327 npm39ISC
- 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.1116 npm1MIT
- AlicenseBqualityBmaintenanceEnables AI assistants to interact with SiYuan Note through its API, supporting notebook and document management, block operations, search, file operations, and more.6964 npm72MIT