SiYuan MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SIYUAN_TOKEN | No | Legacy alias for SIYUAN_API_TOKEN. | |
| SIYUAN_API_URL | No | SiYuan base URL. If omitted, auto-discovers port 6806-6808. | |
| SIYUAN_BASE_URL | No | Legacy alias for SIYUAN_API_URL. | |
| SIYUAN_API_TOKEN | No | SiYuan API token (Settings > About > API token). Required. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| prompts | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| siyuan_sqlA | Execute a SQL SELECT on SiYuan's SQLite database. Use for ALL reads: blocks, documents, tags, backlinks, search. Read the siyuan://static/sql-schema resource for table schema and example queries. NOTE: Attribute View (database) data is NOT in SQLite — use read_database instead. |
| read_databaseA | Read Attribute View (database) data: fields, entries, values. Supports modes: list all DBs (mode:"list"), read full DB (id only), filter entries (id + filter), get single entry (id + entryId). |
| workspace_mapA | Get a map of the SiYuan workspace: all notebooks, top-level documents (2 levels), and all Attribute View database IDs. Call this first to orient yourself. |
| list_notebooksB | List all notebooks, or create a new one. Without params: returns all notebooks with IDs. With name: creates a new notebook. |
| create_documentA | Create a document (or subdocument) in a notebook. Use nested path for subdocuments: path:"/Parent/Child". Returns the document block ID — use it as parentDocId in create_database to embed a DB inside this doc. |
| update_documentA | Rename, replace content, and/or move a document. Provide title to rename, content to replace body, parentId to move under another doc. |
| delete_documentA | Delete a document. Use dryRun:true to preview without deleting. Set cascade:true to also delete child documents. |
| insert_blockB | Insert a markdown block into a document. To embed an existing database, use: |
| update_blockB | Replace the content of an existing block. |
| batch_block_opsB | Execute multiple block operations in one call. Each operation: action "insert", "update", or "delete". |
| create_databaseA | Create a new Attribute View database. With parentDocId: embeds the database TABLE INSIDE that document (appears as content in the page). Without parentDocId: creates a standalone DB page at notebook root. Do NOT include "block" in fields — the primary Name field is auto-created. |
| write_db_rowsC | Create one or more entries (rows) in a database. Each row can have a name and initial field values. |
| update_db_cellsC | Update field values in one or more database entries. Each update targets an entry and specifies which cells to change. |
| delete_db_rowsC | Delete one or more entries from a database. |
| list_viewsA | List database views and their current layout/group/filter/sort configuration. |
| add_viewC | Add a new table, kanban, or gallery view to a database. |
| update_viewB | Update an existing database view layout, name, grouping, filters, or sorts. |
| delete_viewC | Delete a database view by ID. |
| bind_row_to_docB | Convert an existing detached row into a document-backed row bound to an existing document. |
| create_doc_backed_rowC | Create a new document and add it to the database as a document-backed row. |
| list_select_optionsB | List the current options for a select or multi-select database field. |
| set_select_optionsC | Set or update the available options for a select or multi-select database field. |
| rename_notebookC | Rename a notebook by ID. |
| manage_db_fieldsA | Add or remove fields (columns) in a database. Renaming is not supported by SiYuan API — use the GUI. |
| set_block_attrsB | Set custom attributes (key-value metadata) on any block. Also used for tags. |
| upload_assetB | Upload a file as a SiYuan asset. Provide base64-encoded file content. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| note-search-assistant | Note search assistant - search and find information in SiYuan notes |
| document-creator | Document creation assistant - create structured document content |
| content-summarizer | Content summarization assistant - summarize and analyze document content |
| knowledge-connector | Knowledge connection assistant - discover and build connections between ideas |
| learning-path-planner | Learning path planner - create personalized study plans |
| writing-assistant | Writing assistant - help create various types of documents |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| SiYuan MCP v2 — Object Model & Rules | SiYuan object types, IDs, and critical rules for correct tool use |
| SiYuan SQL Schema & Examples | SQLite table schema and example queries for use with siyuan_sql tool |
| SiYuan MCP v2 — CRUD Workflows | Step-by-step tool sequences for common operations |
TDQS
Scored across 26 tools
Most tools target clearly distinct resource+action pairs, and descriptions actively help (siyuan_sql explicitly defers database reads to read_database, workspace_map is flagged as the entry point). The main friction is that insert_block/update_block duplicate the 'insert'/'update' actions of batch_block_ops, and list_notebooks secretly doubles as create, so a few boundaries need the description to resolve.
The dominant pattern is verb_noun snake_case (create_document, update_block, delete_view, set_select_options, upload_asset), which is predictable. Deviations are minor but present: workspace_map and batch_block_ops are bare noun phrases, and siyuan_sql is namespaced unlike anything else.
26 tools is at the heavy end, and the domain (notebooks, documents, blocks, attribute-view databases, views, fields, rows, options, assets) genuinely justifies most of them. Still, redundancy exists — insert_block/update_block overlap with batch_block_ops, and there are five view/field management tools alongside a dual-purpose list_notebooks — so the surface could be trimmed.
Core lifecycle is covered: notebooks (create/rename), documents (create/update/delete), blocks (insert/update/attr, delete via batch), databases (rows/fields/views/select options full CRUD), and assets. Notable gaps remain: no delete_notebook, no standalone delete_block, no asset listing/removal, and field renaming is explicitly unsupported, forcing agents to drop to SQL or the GUI.