sequential-thinking: readOnlyHint and idempotentHint annotations are inaccurate (server is stateful, non-idempotent)
维护者通常 1 天内回复
@Jack11111eee 已经在做这个了。
开始于 2026年8月30日。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- api
调研方向
从 src/sequentialthinking/index.ts 中的工具注解开始,然后阅读 src/sequentialthinking/lib.ts 中提到的状态字段和变更。确认元数据与服务器的有状态行为一致,并确认更改完成后,关于只读和幂等性的声明是准确的。
由索引模型根据 Issue 内容生成。
描述
Summary
The sequentialthinking tool annotations readOnlyHint: true and idempotentHint: true are inaccurate. The server is stateful and non-idempotent — it maintains per-session thoughtHistory and branches instance state that persists across calls and changes on every invocation.
These annotations were added per #3403's suggestion, but the suggested values were not verified against the server's actual stateful behavior.
Evidence (BETS cycle, 2026-08-30)
Ran a governed Benchmarking/Evaluation/Testing/Standards (BETS) cycle against @modelcontextprotocol/server-sequential-thinking (published npm version, via npx -y). 11 test cases across 4 lanes.
readOnlyHint: true is misleading
The SequentialThinkingServer class (confirmed in src/sequentialthinking/lib.ts on main) holds instance state:
private thoughtHistory: ThoughtData[] = [](line 23-24)private branches: Record<string, ThoughtData[]> = {}(line 25-26)
Each processThought call mutates this state:
this.thoughtHistory.push(input)(line 101) — appends to history on every callthis.branches[input.branchId].push(input)(line 111-112) — appends to branch whenbranchFromThought+branchIdprovided
Observed across 11 calls in one session: thoughtHistoryLength incremented linearly (1, 2, 3, ... 11). The server is not read-only — it accumulates session state with each invocation.
idempotentHint: true is false
A tool is idempotent if repeated calls with the same arguments produce the same result. Calling sequentialthinking twice with identical arguments produces different thoughtHistoryLength values (N, then N+1) and potentially different branches contents. The tool is non-idempotent by definition.
Suggested fix
annotations: {
readOnlyHint: false, // server maintains thoughtHistory and branches state
destructiveHint: false, // accurate — no external side effects
idempotentHint: false, // repeated calls produce different history lengths
openWorldHint: false, // accurate — operates on internal reasoning state
},
Impact
Clients relying on readOnlyHint: true for safety assumptions (e.g., "safe to call in parallel", "no state side effects to roll back") will miss the session-state accumulation. Clients relying on idempotentHint: true for caching/retry (e.g., "safe to retry without checking result") will misbehave — a retried call produces a different history length and may create a duplicate branch entry.
Source confirmed on main
src/sequentialthinking/index.ts lines 201-209 (current main as of 2026-08-30):
annotations: {
readOnlyHint: true, // ← should be false
destructiveHint: false,
idempotentHint: true, // ← should be false
openWorldHint: false,
},
src/sequentialthinking/lib.ts lines 23-26, 101, 111-112 confirm the stateful behavior.
Context
- BETS receipt:
agents/_state/bets/20260830T092705Z_sequential-thinking.json(HUMMBL internal, available on request) - Related: #3403 (added these annotations without verification — the suggestion was accepted as-is)
- Discovered during a governed BETS cycle on the MCP fleet, not via automated scanner
Happy to open a PR if that's preferred.
- 主要语言
- TypeScript
- 星标
- 91.4k
- 派生
- 11.8k
- 平均合并
- 7 小时 36 分钟
- 30 天内合并 PR
- 126
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/servers 的其他 Issue
-
bug v2
难度 2/5 1-3 小时 新手友好度 76/100
modelcontextprotocol/servers#5217 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/servers#5216 ·
维护者通常 1 天内回复
-
bug v2
难度 2/5 1-3 小时 新手友好度 79/100
modelcontextprotocol/servers#5215 ·
维护者通常 1 天内回复
-
documentation server-git server-time v2
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/servers#5213 · 2 条评论 ·
维护者通常 1 天内回复
-
documentation v2
难度 1/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/servers#5212 · 1 条评论 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/servers 的全部 Issue
相似的 Issue
-
native
难度 2/5 1-3 小时 新手友好度 72/100
prime-radiant-inc/evener#4839 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
processone/fluux-messenger#1790 ·
维护者通常 1 天内回复
-
🛣️ Infrastructure
难度 2/5 1-3 小时 新手友好度 65/100
opencrvs/opencrvs-core#14232 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
kunchenguid/gh-axi#220 ·
维护者通常 1 天内回复