mcp-sentinel

DSH PLUGIN模型与账号接入

仓库 GCS-ZHN/mcp-sentinel

模型与账号接入 L4 · 沙盒安装通过 安全审查:低风险 可信度:银 可安装插件
安装这个插件

mcp-sentinel 是 GCS-ZHN 维护的 模型与账号接入 类 DSH 可安装插件, 仓库为 GCS-ZHN/mcp-sentinel,许可证 MIT。 下面按「装什么、怎么装、验没验过、跑起来要注意什么」逐项列出。

一句话选型结论

按资料字段整理

mcp-sentinel 是模型与账号接入类的 DSH 可安装插件,验证等级 L4 · 沙盒安装通过,安全审查为低风险,有可直接复制的安装命令。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类模型与账号接入 收录类型可安装插件 验证等级L4 · 沙盒安装通过 安全审查低风险
验证等级 L4 L4 · 沙盒安装通过
GitHub 星标 6 复刻 未标注 · 未关闭 issue 未标注
最近更新 2026-08-26 创建于 未标注
README 15.5 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add github:GCS-ZHN/mcp-sentinel#v1.4.0
  1. 1
    确认版本与运行环境

    仓库没有标注兼容版本与 Node.js 要求,先确认你的 DSH 版本能装,再继续。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本未标注版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名未发布到 npm可用 npm view 查看包信息

验证等级与安全审查

L4 · 沙盒安装通过
自动化流程结论,不是人工审核
验证等级L4 · 沙盒安装通过安装命令在隔离沙盒内真实执行成功,无依赖错误
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度稳定按仓库活跃度与最近更新时间给出
可信度银综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-10-08): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
L5 · 运行已测 ✕ 未通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 boot failed
  • L5.3_HTTP_SERVED HTTP 服务响应
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询

风险详情

  • 审查结论 通过
  • 结论说明 vet 静态分析未发现可疑行为,判定为干净(clean)。
  • 风险计数 严重 0 / 高 0 / 中 0
  • 风险详情 未发现严重或警告级问题。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 验证等级 L4:在沙盒里真实装过,依赖能装上,不是纸面声明。
  • 静态安全审查为低风险,没有发现明显可疑行为。
  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有声明 Node.js 版本要求,版本不匹配可能装不上。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在模型与账号接入场景里给 DSH 补能力的人。
  • 想装完就能用、不想自己排依赖的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
mcp-sentinel当前 L4 · 沙盒安装通过 低风险 6 未标注 有
archify L4 · 沙盒安装通过 低风险 8.0 万 未标注 有
DeepSeek-Reasonix L4 · 沙盒安装通过 低风险 3.6 万 未标注 有
nocobase L3 · 安装规范通过 低风险 2.5 万 0.1.1-rc.2 无
learn-harness-engineering L4 · 沙盒安装通过 低风险 2.0 万 未标注 有
dsh-our-free-model 未做沙盒验证 未标注 8,064 未标注 无

仓库档案

模型与账号接入
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方GCS-ZHN仓库 mcp-sentinel · 默认分支 未标注
分类模型与账号接入ai
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言未标注仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue6 / 未标注 / 未标注收录时的数值,非实时
创建 / 更新未标注 · 2026-08-26最后推送 未标注
本站收录2026-10-14首次进入本站目录的时间

README 全文

15.5 KB
作者原文,中文版优先;只做安全转义,不改内容

mcp-sentinel

A sentinel between an AI agent and MCP servers — polling long-running tasks on the agent's behalf so that token-costly status loops never enter the LLM inference path.

This is a monorepo: a harness-agnostic core (@gcszhn/mcp-sentinel-core) plus one thin plugin package per agent host.

Design principle

Zero MCP re-configuration. The sentinel never asks the user to configure MCP
servers of its own. Installing the plugin is the whole setup — it discovers and
reuses the MCP servers the harness already has, in whichever way that harness
exposes them:

  • From the host's MCP config — OpenCode. The plugin reads
    client.config.get().mcp and hands the resolved servers to the core, which
    owns the connection lifecycle. No extra MCP setup.
  • Through the harness SDK — DeepSeek Harness. The plugin calls the
    mcp____ tools already registered by
    @deepseek-ai/dsh-mcp-client via ctx.tools.execute. No extra MCP setup.
  • As a harness-agnostic MCP CLI — any harness. mcp-sentinel mcp --harness is a plain stdio MCP server that discovers the MCP
    servers the harness already exposes (codex mcp list --json, opencode debug config, or a --mcp-config file) and skips its own entry. No message
    notification channel by default — agents collect results with
    attach/status/read, unless they opt into a command-based notifier via
    mcp_sentinel_set_notifier_commands.

The agent immediately sees the MCP servers it already configured for that
harness; there is no sentinel-specific MCP config, mock server, or demo wiring
to maintain.

Supported harnesses

Install instructions and per-harness details live in each plugin's own README.

Harness Plugin package Docs
OpenCode @gcszhn/mcp-sentinel-opencode-plugin README
DeepSeek Harness @gcszhn/mcp-sentinel-deepseek-harness-plugin README
Any harness (CLI) @gcszhn/mcp-sentinel-cli README

The shared core ships separately as @gcszhn/mcp-sentinel-core — see its README.

Motivation

When an agent submits a long-running job through an MCP tool, it must repeatedly call the server to check progress — each round-trip burns context window tokens.

sequenceDiagram
participant A as Agent (LLM)
participant M as MCP Server

Note over A: Without sentinel
A->>M: check status
M-->>A: running...
Note over A: token cost 💸
A->>M: check status
M-->>A: running...
Note over A: token cost 💸
A->>M: check status
M-->>A: completed ✓
Note over A: token cost 💸

mcp-sentinel moves the polling loop out of the agent and into the plugin runtime — 2 inference calls regardless of task duration.

sequenceDiagram
participant A as Agent (LLM)
participant S as Sentinel Plugin
participant M as MCP Server

A->>S: poll_mcp(server, tool, until)
Note over A: token cost 💸 (once)

loop silent polling (zero tokens)
S->>M: call tool
M-->>S: running...
S->>S: evaluate condition
end

S->>M: call tool
M-->>S: completed ✓
S->>A: promptAsync(result)
Note over A: token cost 💸 (once)

Configuration

Environment variables for controlling memory usage:

Variable Default Description
SENTINEL_MAX_POLL_LOG unlimited Max poll log entries per task (FIFO trim)
SENTINEL_TASK_TTL_MS unlimited Auto-cleanup completed tasks after N milliseconds

Both accept positive integers only. Zero, negative, or non-numeric values are treated as unlimited/disabled.

Tools

mcp_sentinel_poll

Submit a long-running MCP tool call and poll it at regular intervals until a condition is met. The sentinel polls silently (zero token cost) and notifies you when done.

Parameter Type Default Description
server string required MCP server name (resolved from the host's MCP config)
tool string required Tool name to call on the server
args object {} JSON object of arguments for the tool
interval number 5000 Poll interval in milliseconds
timeout number optional Max poll duration in ms (unset = no limit)
until object required JSON condition object

Returns a sentinel ID immediately. The agent is notified when done (the
delivery mechanism is host-specific).

args and until are native JSON values in the tool arguments — not JSON
strings. interval is clamped to a minimum of 1000 ms; a positive timeout is
clamped to a minimum of 5000 ms (values below the floor are raised).

mcp_sentinel_status

Check the status of sentinel tasks, list active tasks, or cancel a running task.

Parameter Type Description
action "status" | "list" | "cancel" Action to perform
id string Sentinel ID (required for status and cancel)

mcp_sentinel_attach

Block the agent, waiting for a sentinel task to complete. Sleeps and checks status internally with zero token cost. If interrupted by harness, the background async notification still fires normally.

Parameter Type Default Description
id string required Sentinel ID to wait for
timeout number optional Max wait time in ms (unset = wait indefinitely)

mcp_sentinel_read

Read raw poll outputs from a sentinel task. Useful for debugging when a condition isn't matching — inspect actual MCP responses. Supports range-based pagination via offset.

Parameter Type Default Description
id string required Sentinel ID to read outputs from
offset number end-N 0-based start index (default: from end)
limit number 5 Max number of outputs to return

Condition Model

Conditions are pure declarative data — no executable code, no injection surface.

// Simple comparison
{ "path": "status", "is": "eq", "value": "completed" }

// Array index access
{ "path": "[0].data.path", "is": "eq", "value": "found" }

// Regex match
{ "path": "log", "is": "match", "value": "^error" }

// Logical composition
{
"and": [
{ "path": "status", "is": "eq", "value": "completed" },
{ "path": "tasks[0].exit_code", "is": "eq", "value": 0 }
]
}

Operators

Operator Description
eq Strict equality
ne Not equal
gt Greater than (numeric)
gte Greater than or equal
lt Less than
lte Less than or equal
contains String contains
match Regex match (new RegExp(value).test(data))

Logical combinators

Combinator Description
{ "not": } Negation
{ "and": [...] } All must match
{ "or": [...] } Any must match

Path syntax

Uses property-access notation with array index support:

status               → obj.status
tasks[0].exit_code   → obj.tasks[0].exit_code
[0].data.path        → obj[0].data.path
items[2].name        → obj.items[2].name

Architecture

The project is a monorepo where each layer ships as its own npm package. The
core knows nothing about any host; every harness is a thin, self-contained
package layered on top of it.

Layers

Package Purpose Published as
packages/core sentinel engine, tool handlers, condition evaluator, connection pool, env, logger, types @gcszhn/mcp-sentinel-core
packages/opencode OpenCode adapter: tool() definitions + client.config.get() + session.promptAsync @gcszhn/mcp-sentinel-opencode-plugin
packages/deepseek-harness DeepSeek Harness adapter: external-invoker mode via ctx.tools.execute + Agent.followup @gcszhn/mcp-sentinel-deepseek-harness-plugin
packages/cli harness-agnostic MCP stdio CLI (mcp-sentinel mcp --harness …) @gcszhn/mcp-sentinel-cli
packages/ (future) one entry per host, e.g. claude-code @gcszhn/mcp-sentinel--plugin

Core / harness contract

The core exposes one uniform seam — ToolInvoker, a
(server, tool, args) => Promise function the engine calls once per
poll — so each harness can plug in its own MCP access strategy without the core
knowing which host it is running under.

// core — the uniform interface (harness-agnostic)
type ToolInvoker = (server: string, tool: string, args: Record) => Promise;

// the core engine accepts an invoker instead of reading host config itself
startSentinel(request, invoke: ToolInvoker): Promise;

There are two ways to build the invoker:

  1. Connection-pool mode — the harness parses the host's MCP config into a
    core McpConfig, builds a ServerResolver with makeServerResolver, and
    wraps it in makeConnectionInvoker, letting the core own the connection
    lifecycle.
  2. External-invoker mode — the host already owns MCP (e.g. its own bridge
    registered tools on a tool registry); the harness passes its own
    (server, tool, args) => result function and the core never opens a
    connection.

MCP config discovery is the harness's job — different hosts fetch it
differently (OpenCode via client.config.get().data mcp.* flat keys, Codex
via codex mcp list --json, a --mcp-config file, …), and external-invoker
hosts skip config discovery entirely.

The core's second seam is the notifier: a harness installs a completion
callback with setNotifier(task, event), delivered through the host's message
channel (OpenCode promptAsync, DeepSeek Harness Agent.followup). The core
has no opinion on how a notification is rendered or pushed.

Adding a new harness

  1. Develop it in its own git worktree — a new harness plugin is isolated
    from the core and from other harnesses; see AGENTS.md.
  2. Create packages//package.json named @gcszhn/mcp-sentinel--plugin
    with a dependency on @gcszhn/mcp-sentinel-core.
  3. Build a ToolInvoker: either parse the host's MCP config into a McpConfig
    and wrap it with makeConnectionInvoker(makeServerResolver(...))
    (connection-pool mode), or pass a host-owned (server, tool, args) => result
    function (external-invoker mode).
  4. Register the four tools, delegating to the core's handlePoll /
    handleStatus / handleAttach / handleRead handlers.
  5. Install the notifier with setNotifier, pushing completions through the
    host's message channel (e.g. OpenCode promptAsync, DeepSeek Harness
    Agent.followup).

Data flow (core)

sequenceDiagram
participant A as Agent (any host)
participant H as Harness adapter
participant C as Core engine
participant M as MCP Server

A->>H: poll(server, tool, until)
H->>H: resolveServer()
H->>C: startSentinel(...)
C-->>H: sentinel ID
H-->>A: acknowledgment

loop every interval ms (zero tokens)
C->>M: call tool(args)
M-->>C: response
C->>C: evaluateCondition(until, response)
end

C->>H: notify(completed)
H->>A: host-specific completion push

Layout

packages/
core/                         # @gcszhn/mcp-sentinel-core (zero host deps)
src/
engine.ts                 # startSentinel / cancel / getTask / getActive / cleanup
tools.ts                  # handlePoll / handleStatus / handleAttach / handleRead
condition.ts              # condition evaluator
connection-pool.ts        # MCP client pool (@modelcontextprotocol/sdk)
env.ts                    # SENTINEL_* env
logger.ts                 # pluggable sink
resolver.ts               # makeServerResolver (McpConfig → ServerResolver)
types.ts                  # McpServerConfig / ServerResolver / Sentinel*
index.ts                  # public barrel
tests/
opencode/                     # @gcszhn/mcp-sentinel-opencode-plugin
src/
plugin.ts                 # PluginModule entry
index.ts                  # tool() definitions + promptAsync notifier
config.ts                 # parseOpencodeMcpConfig (opencode `mcp` block) → McpConfig
tests/
deepseek-harness/             # @gcszhn/mcp-sentinel-deepseek-harness-plugin
src/
index.ts                  # external-invoker mode: ctx.tools.execute + Agent.followup
tests/
cli/                          # @gcszhn/mcp-sentinel-cli (harness-agnostic stdio MCP server)
src/
cli.ts                    # CLI entry: mcp-sentinel mcp --harness
mcp-server.ts             # registers the 4 tools; connection-pool mode; no notifier
config.ts                 # codex mcp list / opencode debug config / --mcp-config discovery
schema/                     # mcp-config.schema.json (ships in the npm tarball)
tests/
# future harnesses, one concrete package each:
#   claude-code/   ...

> Build order: each package builds independently, but the adapters
> type-check and run against @gcszhn/mcp-sentinel-core's published dist/.
> Run bun run build (core first, then opencode, deepseek-harness, cli)
> before bun test.

License

MIT

常见问题

5 问
答案由本站依据条目字段整理,不引用上游原文
mcp-sentinel 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add github:GCS-ZHN/mcp-sentinel#v1.4.0` 即可。

mcp-sentinel 的验证等级是什么意思?

L4 · 沙盒安装通过。安装命令在隔离沙盒内真实执行成功,无依赖错误

mcp-sentinel 安全吗?

低风险。vet 静态分析未发现可疑行为,判定为干净(clean)。

mcp-sentinel 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

mcp-sentinel 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

模型与账号接入
按星标排序,可作替代方案

archify

archify

从仓库或系统描述生成经过校验的自包含交互式架构图、流程图、时序图、数据流图和生命周期图。

L4 · 沙盒安装通过 8.0 万 星

nocobase

nocobase

L3 · 安装规范通过 2.5 万 星

dsh-our-free-model

dsh-our-free-model

为 DeepSeek Harness 挂载免登录、免 API Key 的免费前沿模型通道,装完即用,并附用量看板与 OpenAI 兼容本地转

未标注验证等级 8,064 星

dsh-purge

dsh-purge

dsh-purge 是一款 DeepSeek Harness 设置插件,可修改默认副本、权限策略和工具限制,并添加规则卡片以分组应用补丁,支

L5 · 运行验证通过 4,573 星

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-10-08。