SiYuan MCP Sisyphus 标志

SiYuan MCP Sisyphus

社区
yangtaihong59

一个用于连接Agent与Siyuan的工具

发布者yangtaihong59
代码仓库siyuan-plugins-mcp-sisyphus
语言TypeScript
复刻数
23
星标数
118
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    SiYuan MCP Sisyphus 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 118 个星标和 23 个复刻。

SiYuan Sisyphus MCP & CLI

Connect external AI agents, the existing Sisyphus toolset, and SiYuan's official MCP plugin ecosystem.

Latest: v0.6.13 — Fixes DSH compatibility: clients without form confirmation support no longer trigger elicitation errors, while permissions and safe-write preflight remain enforced. MCP settings now provide DSH Cordis YAML configuration.

v0.6.12: — Fixes database filter defaults, validation, and carrier identification for reliable preflight, commits, and no-change detection; fixes same-path document creation across notebooks, template readback, and scoped reference queries; preserves complete link-target mappings and clarifies SQL permissions and bilingual help. CLI is now v0.2.13.

v0.6.11: — Introduces AV v2 structure reads, paginated queries, explicit database creation, and combined view updates, with durable creation receipts and configuration checks. Legacy AV actions and the top-level id alias are removed; see the migration guide. CLI is now v0.2.12.

v0.6.4: v0.6.4 — Expands guarded AV configuration, adds auditable Markdown snapshots, image-reference auditing, permission-scoped visual image delivery, extension diagnostics, and clearer path semantics. Thanks to @LoneFireBlossom for PR #48 and PRs #50–#56, @ray24777 for PR #57, and @adminclaw for PR #58. CLI is now v0.2.6.

Project Direction Update

I originally built SiYuan Sisyphus simply because I wanted my own SiYuan notes to connect more naturally with external AI agents. Now that SiYuan provides an official MCP implementation, I am glad to see a broader shared ecosystem taking shape. As one plugin developer within that ecosystem, I want Sisyphus to preserve its existing workflows while embracing official MCP and working alongside other plugins to make the connection between SiYuan and external agents smoother and more reliable.

This does not replace the existing project:

  • the 14 Sisyphus aggregate tools and notebook permissions remain available; AV v2 changes database actions as described in the migration guide;
  • Sisyphus now connects to SiYuan's official MCP endpoint and discovers tools registered by other plugins;
  • native SiYuan MCP tools can also be included explicitly, but remain disabled by default because they have a different security boundary;
  • permission management, the document timeline, and multiple connection options continue to be maintained.

SiYuan Sisyphus architecture

Architecture summary: external AI agents connect to Sisyphus. Its aggregate tools access the SiYuan workspace through /api/*, while extension uses the official /mcp endpoint to bridge tools registered by other plugins. Native SiYuan MCP tools are optional and disabled by default.

The boundary is deliberate: Sisyphus-owned capabilities—including fs, the document timeline, permission management, CLI, document tools, and the other aggregate workflows—always use SiYuan's /api/* endpoints and never depend on official MCP. /mcp belongs exclusively to extension, where it discovers and forwards tools registered by other plugins and native SiYuan tools explicitly enabled by the user.

One Connection, Two Compatible Tool Ecosystems

Tool sourceDefaultBest suited forCompatibility and security boundary
Sisyphus aggregate toolsEnabledStable read, search, edit, database, permission, and automation workflowsPass through Sisyphus permissions and dangerous-action controls; database calls follow AV v2
Official plugin MCP toolsEnabledNew capabilities registered by other SiYuan plugins through official MCPDynamically discovered by extension; the official tool name becomes the action
Native SiYuan MCP toolsDisabledTesting and comparison in trusted local environmentsExecute with the administrator session or API Token and bypass Sisyphus notebook permissions and dangerous-action confirmation

Existing users do not need to rewrite Sisyphus calls as official tools. Database scripts must adopt AV v2; official plugin tools add a new ecosystem entry point over the same connection.

Plugin developers only need to register a tool with SiYuan's official MCP registry. Sisyphus can discover it there without requiring a separate Sisyphus-specific adapter.

What It Is

SiYuan Sisyphus connects external AI agents to SiYuan so they can safely read, search, edit, and organize the workspace.

It provides two entry points:

  • MCP plugin: connect SiYuan to Claude Desktop, Claude Code, Codex, Cursor, Cherry Studio, Cline, and other MCP-capable clients while bridging the official MCP plugin ecosystem.
  • CLI siyuan-sisyphus: let agents, terminals, and scripts operate SiYuan through short commands for one-shot tasks and automation.

Both entry points share the same underlying SiYuan operations. Sisyphus-owned tools share one permission model; official tools forwarded through extension retain their own permission semantics.

Quick Start

  1. Install the plugin from the SiYuan marketplace, or build it from source using the development guide.
  2. Open Plugin -> SiYuan Sisyphus MCP & CLI -> Settings.
  3. Choose MCP or CLI on the connection page.
  4. Copy the generated client configuration, or initialize the CLI with siyuan-sisyphus init.
  5. Verify the connection with a read-only task such as listing notebooks or reading the SiYuan version.
  6. To use official MCP tools registered by other plugins, expand “Extension Tools” in tool settings and inspect the discovery status.
bash
npm i -g siyuan-sisyphus
siyuan-sisyphus init
sisyphus notebook list

For complete installation and connection instructions, see Getting Started.

Core Capabilities

  • Official MCP plugin ecosystem integration: discover tools registered by other plugins through SiYuan's official MCP and expose them to external agents.
  • Shared agent workflows: retain Sisyphus aggregate tools, CLI, and notebook permission configuration; database workflows use AV v2.
  • AI-friendly note access: use human-readable fs paths such as /Notebook/Project/Note without requiring agents to understand block IDs or document-tree internals.
  • MCP and CLI entry points: use MCP for multi-step agent workflows and CLI for scripts, automation, and small one-shot tasks.
  • Notebook-level safety: assign each notebook none, r, rw, or rwd access.
  • Low-context tool design: group 100+ SiYuan capabilities into 14 action-routed tools and load detailed guidance only when needed.
  • Scenario Skills for agents: provide guidance for browsing, editing, search, databases, exports, tags, flashcards, document timelines, system safety, and SiYuan markup.
  • MCP Apps views: dedicated launch tools open flashcard review, document timeline, and mascot shop exactly once; ordinary aggregate tools never render duplicate Apps, and human actions are managed on a separate MCP Apps settings page.
  • Git-like document timeline: create named timeline nodes, compare snapshots, and roll back a document when needed.
  • Practical connection setup: generate connection snippets for common AI clients and local, remote, and Docker deployments.

MCP Apps: Interactive Workflows Inside The Conversation

Version 0.6.0 adds three inline MCP Apps for clients that negotiate io.modelcontextprotocol/ui. Instead of turning an interactive task into a long sequence of chat messages, the agent prepares the required context once and opens a focused interface where the user finishes the workflow directly.

AppDedicated launcherWhat happens in the App
Flashcard reviewflashcard_review_sessionThe agent selects 1–20 due cards from a fixed, permission-checked candidate snapshot. The user reveals each answer and rates it Again / Hard / Good / Easy without exposing the remaining cards in chat. After the round, the user can ask the agent to explain the reviewed material.
Document timelinetimeline_appBrowse and create named nodes, compare a snapshot with the current document, inspect a compact block-level diff, and restore the whole document or one supported block. Pass documentId for a document timeline; omitting it intentionally opens a global-only view that can show only global nodes. Rollback uses an in-place second-click confirmation, so the target button does not move under the pointer.
Mascot shopmascot_shop_appBrowse the pixel-art vending machine, queue items in the pickup slot, and complete a purchase only when the item is collected. A successful pickup also triggers the desktop mascot's item and heart animation.

The Apps follow a deliberately separated interaction model:

  • One launcher, one App: only the dedicated launcher carries the UI resource. Ordinary flashcard, timeline, and mascot calls remain data tools and never produce duplicate App panels.
  • The agent prepares; the user decides: once an App opens, it becomes the sole interaction surface for that round. The model does not answer flashcards, choose ratings, roll back notes, or purchase items on the user's behalf.
  • Independent human-action permissions: App actions are hidden from the model with visibility: ["app"] and can be enabled individually under Settings → MCP → MCP Apps. Notebook permissions, action switches, and server-side confirmation for high-risk operations still apply.
  • Graceful compatibility: clients that do not advertise MCP Apps support do not receive the launchers or App-only actions. Existing aggregate-tool responses, structuredContent, and standalone CLI behavior remain unchanged.

See the detailed guides for flashcard review, the timeline App, and the mascot shop.

Official MCP Ecosystem Integration

On SiYuan 3.7.0+, extension reads the official /mcp registry and turns allowed official tools into dynamic actions:

json
{
  "action": "plugin__example__search",
  "arguments": {
    "action": "query",
    "keyword": "MCP"
  }
}

All downstream parameters stay inside arguments, so a downstream tool can use its own action field without colliding with Sisyphus routing.

The tool settings page reports plugin/native tool counts, exposed count, schema size, source, and risk information. Individual tools can also be disabled.

Connections are version-gated and lazy. Sisyphus first reads the SiYuan version through /api/system/version; versions below 3.7.0 never receive a /mcp request. The official endpoint is contacted only when extension is enabled or when the user inspects or refreshes extension tools in settings. The outer MCP Server does not wait for initial discovery when listing tools: successful results are cached, a tool-list-changed notification is sent, and later tools/list calls reuse the cache instead of forcing a refresh.

If /mcp is unavailable, only dynamic extension actions are hidden. The remaining aggregate tools continue to work and outer MCP Server startup is unaffected. Official MCP integration does not raise the installation floor for the plugin; minAppVersion remains 2.9.0.

Security note: official plugin tools and optional native SiYuan tools do not pass through the notebook permissions or action-level dangerous-operation controls applied to Sisyphus-owned tools. Native tools in particular should only be enabled for local or fully trusted clients.

See the extension tool documentation for full calling conventions.

Git-Like Document Timeline

The timeline gives ordinary SiYuan documents a source-control-style safety layer:

  • create document-only nodes or global nodes visible in every document;
  • manage nodes in a compact, collapsible left dock inspired by VSCode Source Control;
  • open the right Document Diff dock automatically when selecting a node, while node creation only refreshes and highlights the new entry;
  • distinguish scopes with colored dots and Document / Global badges in one chronological list;
  • delete document or global nodes by removing only their protective tags while retaining the underlying snapshots;
  • compare a historical snapshot with the current document;
  • switch between unified and split diff;
  • use a minimap-style change navigator and collapse unchanged blocks;
  • preserve older timeline nodes in a legacy archive, link one legacy node to multiple documents, or safely convert it into a new global node;
  • roll back the whole document, or restore supported parsed blocks individually.

The snapshots dock reads only attribute and tag metadata. A current-state snapshot and diff are created only after a node is selected, and only for that node. The foundation is still SiYuan's workspace-wide snapshots: document ownership is recorded in document attributes, while global nodes are recovered from tags. It is intentionally not a complete Git replacement or source-control workflow.

The same workflow is available to MCP clients and the standalone CLI through the timeline aggregate tool. Direct AI access to node deletion and both rollback actions is high-risk and disabled by default; MCP App writes use independent permissions so a user can click rollback without exposing that Tool to the model.

MCP And CLI Entry Points

Use MCP when an AI client should discover tools, compose multi-step operations, and verify results. It fits agent workflows involving search, reading, editing, database inspection, and official plugin tools.

Use CLI when one terminal command is enough. It avoids placing long tool schemas in the model context and works well for scripts, automation, and small one-shot tasks.

MCP and CLI share the same Sisyphus core call path, preventing one capability from developing different semantics across two entry points.

MCP 2026-07-28 compatibility

The server uses MCP TypeScript SDK v2. stdio automatically serves both protocol eras. HTTP uses the SDK classifier: MCP 2026-07-28 requests are stateless and carry per-request metadata, while 2025-era clients retain the existing isolated mcp-session-id sessions. The built-in official-SiYuan MCP bridge negotiates the newest mutually supported era and falls back to legacy automatically.

Modern dangerous calls use MCP multi-round-trip input: the operation is not dispatched until an elicitation-capable client returns explicit approval. Legacy clients keep the existing instruction/help confirmation contract for compatibility. Browser requests are Origin-validated; configure extra allowed hostnames with SIYUAN_MCP_ALLOWED_ORIGINS.

Scenario Skills For Agents

The MCP server includes scenario-oriented guidance for browsing, editing, search, databases, exports, tags, flashcards, document timelines, system safety, and SiYuan markup. A regular MCP client does not need to install anything: it can read siyuan://skills/index, then load the matching siyuan://skills/{name} resource. For timeline work, load siyuan://skills/siyuan-mcp-timeline or invoke the siyuan_timeline prompt. The matching MCP prompts are user-invoked workflow starters; they are not applied automatically.

Agents that support installable SKILL.md packages can install the same guidance locally:

bash
siyuan-sisyphus skill install --bundle mcp # MCP calling conventions
siyuan-sisyphus skill install --bundle all # MCP and CLI bundles

Plain siyuan-sisyphus skill install remains the CLI bundle for backward compatibility. Skills describe workflows and safety decisions; the current parameter source of truth remains siyuan://help/action/{tool}/{action} or the corresponding action="help" response.

Draft SEP-2640 Skills-over-MCP support is enabled by default for both HTTP and stdio transports and publishes all bundled workflow skills. For the plugin's built-in HTTP server, it can be toggled under Connection Config → HTTP/HTTPS Connection → Skills over MCP; saving restarts the server. Standalone servers can disable it with SIYUAN_MCP_SKILLS_EXTENSION=false. The extension advertises io.modelcontextprotocol/skills, implements skills/list and skills/get, and serves digest-addressed skill://.../SKILL.md resources. Because SEP-2640 is still a draft, the existing siyuan://skills/* resources and prompts remain the stable fallback.

A standalone Codex Agent Plugin wrapper is available in agent-plugin/siyuan-sisyphus. It connects to the default local HTTP endpoint and packages the same five entry skills; configure HTTP authentication separately when the endpoint requires a bearer token.

Safety Model

Sisyphus-owned tools are designed around explicit user control:

  • each notebook can be read-only, writable, deletable, or hidden from AI;
  • dangerous actions such as delete, move, replace, and asset upload are treated separately;
  • Strict Safe Writes is enabled by default under Settings → MCP → Settings & Debug. A mutation first uses validateOnly=true to obtain the current-state hash, then submits the server-issued requestId with the matching expected*Hash;
  • write transport is attempted once. A timeout or disconnect returns outcome_unknown instead of risking a duplicate through a blind retry; a committed requestId is replayed from the metadata ledger;
  • strict mode creates no SiYuan data snapshots. It relies on target-state hashes, serial coordination, post-write readback, and a hash/ID-only idempotency ledger; notifications, sync, exports, and third-party tools that cannot be read back are explicitly marked as not strictly guaranteed;
  • MCP and CLI share the same core behavior, so switching entry points does not create a second permission model;
  • remote and Docker use cases go through the SiYuan HTTP API instead of assuming direct access to local workspace files.

See Strict Safe Writes for the call protocol, error semantics, and current boundaries. Strict writes from the standalone CLI and stdio server are forwarded to the plugin-hosted HTTP server's single coordinator, so that HTTP service must remain enabled. Disabling the setting restores the legacy argument and direct-call behavior, while mutation responses explicitly state that the strict guarantee is absent.

The official MCP bridge is a separate tool source. Forwarded calls execute with the current SiYuan administrator session or API Token and do not automatically inherit the notebook permissions or dangerous-action controls above. Before enabling or invoking them, ensure that the external agent, network environment, and downstream tool are trusted.

Future Direction And Feedback

The project will focus on improving the complete experience of connecting external agents to SiYuan, including:

  • connection configuration and compatibility across popular agent products;
  • HTTP, stdio, local, remote, and Docker deployments;
  • discovery, synchronization, filtering, and schema footprint of official MCP tools;
  • clearer call status, actionable errors, and connection recovery;
  • task-oriented Skills, help, and progressive disclosure;
  • real-world validation and experience comparisons across agent products.

Bug reports, experience notes, and design suggestions are welcome:

  • GitHub Issues for public discussion of problems, requests, and design ideas;
  • the built-in feedback tool, which agents can call as feedback(action="submit", description="...").

Do not include API tokens, secrets, private note content, or sensitive local paths in feedback.

Read The Docs

❤️ Contributors

Made with contrib.rocks.

Support

If you find this project helpful, please consider supporting it. Your support helps sustain maintenance and future Agent integration work.

Sponsor Thanks

Thanks to undefined, Fngd Z, ou, 米建, 锋🌀☁️, wooh, 芝士柴犬 and all other kind supporters for sponsoring this project.

License

MIT

安装

TypingMind
{
  "mcpServers": {
    "siyuan-plugins-mcp-sisyphus": {
      "command": "node",
      "args": [
        "/absolute/path/SiYuan/data/plugins/siyuan-plugins-mcp-sisyphus/mcp-server.cjs"
      ]
    }
  }
}

将 SiYuan MCP Sisyphus MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 SiYuan MCP Sisyphus 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 SiYuan MCP Sisyphus 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 SiYuan MCP Sisyphus MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "siyuan-plugins-mcp-sisyphus": {
      "command": "npx",
      "args": [
        "-y",
        "siyuan-plugins-mcp-sisyphus"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 SiYuan MCP Sisyphus MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 SiYuan MCP Sisyphus MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 SiYuan MCP Sisyphus 帮我完成这项任务吗?
SiYuan MCP Sisyphus
当然,我看过了。
以下是我使用 SiYuan MCP Sisyphus 得到的结果。

常见问题

SiYuan MCP Sisyphus MCP 服务器有什么用途?

SiYuan MCP Sisyphus 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 SiYuan MCP Sisyphus MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 SiYuan MCP Sisyphus。

为什么在 TypingMind 中使用 SiYuan MCP Sisyphus MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 SiYuan MCP Sisyphus 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 SiYuan MCP Sisyphus MCP 连接到 TypingMind?

SiYuan MCP Sisyphus 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

SiYuan MCP Sisyphus MCP 在 TypingMind 中提供哪些工具?

SiYuan MCP Sisyphus 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 SiYuan MCP Sisyphus MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 SiYuan MCP Sisyphus 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇