| name | siyuan-mcp-file-export |
| description | MCP playbook for SiYuan assets and exports. Use for uploads, Markdown export, document extraction, resource ZIP export, OCR text, templates, and safe asset maintenance. |
Handle SiYuan Files and Exports with MCP
File actions are the explicit exception to the normal remote-only data path: uploads and local exports may touch the machine running the server. Confirm local paths and scope first.
file(action="upload_asset", assetsDirPath="/assets/", localFilePath="/absolute/path/to/image.png")
file(action="export_md", id="<doc-id>")
file(action="extract_doc", id="<doc-id>", outputDir="/tmp/siyuan-extract")
file(action="export_resources", paths=["assets/file.png","assets/file.pdf"])
file(action="get_doc_assets", id="<doc-id>", assetType="image")
file(action="get_image_ocr_text", path="assets/image.png")
Large uploads must stop and require explicit confirmation before retrying with the large-file confirmation field. A document extraction output directory may be cleared; use a task-specific empty directory. Before renaming, deleting, or removing unused assets, list the exact targets and obtain approval. Verify returned paths after the operation. Read siyuan://help/action/file/upload_asset for current size and path constraints.