SiYuan Note MCP Server
镜子 (jìng zi)
MCP-Mirror
README
SiYuan Note MCP Server
一个 MCP 服务器实现,提供与思源笔记系统的集成,使 AI 模型能够访问和操作笔记数据。
功能特性 | Features
- 笔记本管理 | Notebook Management
- 文档操作 | Document Operations
- 内容块控制 | Block Control
- 文件和资源管理 | File and Asset Management
- SQL 查询支持 | SQL Query Support
- 属性管理 | Attribute Management
- 导出和转换 | Export and Conversion
- 系统功能 | System Functions
命令列表 | Command List
所有命令都支持使用 help
查询获取详细说明。例如:
{
"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
服务器需要配置以下环境变量:
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
:
{
"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 start
Docker 运行 | 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 build
Docker 构建 | Docker Build
docker build -t mcp/siyuan .
许可证 | License
本项目基于 ISC 许可证发布。这意味着你可以自由使用、修改和分发本软件,但需要遵守 ISC 许可证的条款和条件。详细信息请参见项目仓库中的 LICENSE 文件。
相关资源 | Related Resources
推荐服务器
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
MCP Package Docs Server
促进大型语言模型高效访问和获取 Go、Python 和 NPM 包的结构化文档,通过多语言支持和性能优化来增强软件开发。
Claude Code MCP
一个实现了 Claude Code 作为模型上下文协议(Model Context Protocol, MCP)服务器的方案,它可以通过标准化的 MCP 接口来使用 Claude 的软件工程能力(代码生成、编辑、审查和文件操作)。
@kazuph/mcp-taskmanager
用于任务管理的模型上下文协议服务器。它允许 Claude Desktop(或任何 MCP 客户端)在基于队列的系统中管理和执行任务。
mermaid-mcp-server
一个模型上下文协议 (MCP) 服务器,用于将 Mermaid 图表转换为 PNG 图像。
Jira-Context-MCP
MCP 服务器向 AI 编码助手(如 Cursor)提供 Jira 工单信息。

Linear MCP Server
一个模型上下文协议(Model Context Protocol)服务器,它与 Linear 的问题跟踪系统集成,允许大型语言模型(LLM)通过自然语言交互来创建、更新、搜索和评论 Linear 问题。

Sequential Thinking MCP Server
这个服务器通过将复杂问题分解为顺序步骤来促进结构化的问题解决,支持修订,并通过完整的 MCP 集成来实现多条解决方案路径。
Curri MCP Server
通过管理文本笔记、提供笔记创建工具以及使用结构化提示生成摘要,从而实现与 Curri API 的交互。