SiYuan MCP Server
Enables AI assistants to create, read, update, and manage notes, documents, blocks, databases (attribute views), files, and more within a SiYuan Note instance via the SiYuan API.
Click on "Install 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 Servercreate note titled 'Ideas' in my personal notebook"
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 MCP Server
English | 简体中文
Model Context Protocol (MCP) server for SiYuan Note.
Enable AI assistants to create, read, update, and manage your SiYuan notes directly.
Features
Notebook Management — Create, rename, open/close, and organize notebooks
Document Operations — List, create, edit, move, and delete documents
Block-level Editing — Insert, prepend, append, update, delete, move, fold/unfold, and query content blocks
Database (Attribute View) — Create tables, add/update/delete rows and columns
Search & Query — Full-text search and SQL queries
File Operations — Upload, download, list, and manage assets
Export & Conversion — Export Markdown, Pandoc conversion
Installation
Requirements
Node.js >= 18
SiYuan Note running with API enabled
SiYuan API Token (Settings → About → API Token)
NPM
npm install -g siyuan-mcp-serverNPX (no install)
npx siyuan-mcp-serverConfiguration
Set the SIYUAN_TOKEN environment variable to your SiYuan API token.
Optional: set SIYUAN_API_URL (default: http://localhost:6806).
Claude Desktop
Add to your Claude Desktop config:
{
"mcpServers": {
"siyuan": {
"command": "npx",
"args": ["-y", "siyuan-mcp-server"],
"env": {
"SIYUAN_TOKEN": "your-api-token"
}
}
}
}Available Commands
All commands are exposed both as standalone MCP tools and via the executeCommand dispatcher.
Namespace | Description |
| Database (Attribute View) operations |
| Block-level CRUD, move, fold/unfold, query children |
| Document list/create/rename/remove/move |
| Notebook management |
| File read/write/list |
| Full-text search |
| SQL queries and block lookup |
| Block attributes |
| Asset upload |
| Export notebook / document |
| Pandoc conversion |
| System info |
| Push messages |
| Template rendering |
| SQL queries |
| Forward proxy |
Notebook Commands
Command | Description |
| List all notebooks |
| Open a closed notebook |
| Close a notebook |
| Rename a notebook |
| Create a new notebook |
| Remove a notebook |
| Get notebook configuration |
| Set notebook configuration |
Document Commands
Command | Description |
| List documents in a notebook by path |
| Create a document with Markdown content |
| Rename a document |
| Rename a document by ID |
| Remove a document |
| Remove a document by ID |
| Move documents |
| Move documents by ID |
| Get human-readable path by path |
| Get human-readable path by ID |
Block Commands
Command | Description |
| Insert a block after a specific block |
| Prepend blocks to a parent block |
| Append blocks to a parent block |
| Update block content |
| Delete a block |
| Move a block |
| Get block Kramdown content |
| Get child blocks of a parent block |
| Fold a block |
| Unfold a block |
Database Operations (Attribute View)
Command | Description |
| Create a new database table |
| View database structure and rows |
| Add rows to a database |
| Update row values |
| Delete rows |
| Add a column |
| Remove a column |
| Update a single cell |
Search & Query
Command | Description |
| Full-text search across notes |
| Execute SQL query on the database |
| Query a single block by ID |
File & Asset Commands
Command | Description |
| Get file content |
| Upload/write a file |
| Remove a file |
| List files in a directory |
| Upload asset files |
Other Commands
Command | Description |
| Set block attributes |
| Get block attributes |
| Export notebook |
| Export document |
| Convert files via Pandoc |
| Get boot progress |
| Get SiYuan version |
| Get server current time |
| Push a notification message |
| Push an error message |
| Render a template |
| Render a Sprig template |
| Execute SQL query |
| Forward HTTP request via proxy |
MCP Tools
In addition to executeCommand, the following standalone MCP tools are registered for direct LLM discoverability:
queryCommands— List available commandsexecuteCommand— Execute any command by namehelp— Get detailed help for a specific commandav_createAttributeView/av_getAttributeView/av_addRow/av_updateRow/av_deleteRow/av_addColumn/av_removeColumn/av_updateCell
Development
npm install
npm run build
npm test
npm run devReinstalling after updates
NPX users: No action needed —
npxalways fetches the latest published version.NPM global install: Run
npm install -g siyuan-mcp-serveragain to upgrade.Local source / development: Run
npm run buildafter pulling changes.
Attribution
This project is based on the original siyuan-mcp-server by Fromsko, which in turn builds upon earlier work by onigeya.
Significant modifications and enhancements have been made, including:
Database (Attribute View) creation and full CRUD support
Fixed
file.getFileandfile.putFilecommandsIndependent MCP tool registration for better LLM discoverability
Added
filetree.listDocsByPath,block.prependBlock,block.appendBlock,block.getChildBlocks,block.foldBlock,block.unfoldBlockAdded
filetree.removeDocByID,filetree.renameDocByID,filetree.moveDocsByIDAdded
export.exportNotebook,system.getBootProgress,notification.pushErrMsg,template.renderSprigAV blockID-to-avID auto-resolution and SQL fallback for robust database access
Known API Behaviors
filetree.createDocWithMd: Does not overwrite existing documents when the samepathis used repeatedly.block.updateBlock: Replaces the content of a single block, not the entire document. To rewrite a whole document, delete its child blocks and append new content.filetree.removeDoc: May return success while the document remains visible due to SiYuan's internal index/cache. Usefiletree.removeDocByIDas a more reliable alternative when you have the document ID.
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rexding97/siyuan-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server