思源笔记集成
STDIO为思源笔记提供AI访问的MCP服务器
为思源笔记提供AI访问的MCP服务器
一个 MCP 服务器实现,提供与思源笔记系统的集成,使 AI 模型能够访问和操作笔记数据。
An MCP server implementation that provides integration with the SiYuan Note system, enabling AI models to access and manipulate note data.
所有命令都支持使用 help
查询获取详细说明。例如:
All commands support detailed documentation via the help
command. For example:
{ "type": "help", "params": { "type": "block.insertBlock" } }
assets.uploadAssets
- 上传资源文件 | Upload assetsattr.setBlockAttrs
- 设置块属性 | Set block attributesattr.getBlockAttrs
- 获取块属性 | Get block attributesblock.insertBlock
- 插入内容块 | Insert a blockblock.updateBlock
- 更新内容块 | Update block contentblock.deleteBlock
- 删除内容块 | Delete a blockblock.moveBlock
- 移动内容块 | Move a blockblock.getBlockKramdown
- 获取块的 Markdown 内容 | Get block Kramdown contentconvert.pandoc
- 使用 Pandoc 转换内容 | Convert content using Pandocexport.exportNotebook
- 导出笔记本 | Export notebookexport.exportDoc
- 导出文档 | Export documentfile.getFile
- 获取文件内容 | Get file contentfile.putFile
- 写入文件内容 | Put file contentfile.removeFile
- 删除文件 | Remove filefile.readDir
- 读取目录内容 | List files in directoryfiletree.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 IDnetwork.forwardProxy
- 网络请求代理 | Forward proxy requestnotebook.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 configurationnotification.pushMsg
- 发送消息通知 | Push message notificationnotification.pushErrMsg
- 发送错误通知 | Push error message notificationquery.sql
- 执行 SQL 查询 | Execute SQL queryquery.block
- 通过 ID 查询块 | Query block by IDsearch.fullTextSearch
- 全文搜索 | Full text searchsql.sql
- 执行 SQL 查询 | Execute SQL querysystem.getBootProgress
- 获取启动进度 | Get boot progresssystem.getVersion
- 获取系统版本 | Get system versionsystem.getCurrentTime
- 获取当前时间 | Get current timetemplate.renderTemplate
- 渲染模板 | Render templatetemplate.renderSprig
- 渲染 Sprig 模板 | Render Sprig template服务器需要配置以下环境变量: The server requires the following environment variables:
SIYUAN_TOKEN
- 思源笔记 API 令牌(必需)| SiYuan Note API token (required)
将以下配置添加到 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" } } } }
pnpm install
# Windows set SIYUAN_TOKEN=your-siyuan-token # Linux/macOS export SIYUAN_TOKEN=your-siyuan-token
pnpm start
docker run --rm -i \ -e SIYUAN_TOKEN=your-siyuan-token \ mcp/siyuan
pnpm build
docker build -t mcp/siyuan .
本项目基于 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.