Skip to main content
Glama
kruschdev

krusch-sequential-mcp

by kruschdev

⚡ 为什么选择 Krusch Sequential MCP?

标准的 sequential-thinking MCP 为思维链推理提供了一个很好的工具,但在多智能体环境中,它会遇到“传话游戏”问题,即智能体可能会自信地产生无根据的幻觉思维,从而污染上下文窗口。

krusch-sequential-mcp 通过引入语义合理性门控 (Semantic Plausibility Gating) 以及高度可靠的 DBOS PostgreSQL 持久化层解决了这个问题。

核心特性

  • 🧠 语义合理性门控: 通过边缘模型评估器自动拒绝偏离或产生幻觉的思维。

  • 💾 DBOS PostgreSQL 持久化: 将每一个思维、分支和修订同步持久化到 dbos_thoughts 表中,创建一个可审计的推理有向无环图 (DAG)。

  • 🛑 确定性状态可靠性: 停止被污染的思维执行,强制智能体重新评估其推理路径。

  • 🔌 直接替换: 完全兼容标准的 sequential-thinking 接口,同时支持新的 groundingContext 参数。

  • 📦 零外部依赖: 合理性评估器完全自包含——无需外部工具包。


🧠 架构:语义合理性门控

当智能体提出一个思维时,内部评估器会根据提供的 groundingContext 对其进行筛选。

graph TD;
    A[Agent Thought Proposed] --> B{Grounding Context Provided?};
    B -- No --> C[Accept & Persist to DBOS];
    B -- Yes --> D[Edge Model Evaluator];
    D -- Plausible --> C;
    D -- Hallucinated/Drifted --> E[Reject Thought];
    E --> F[Return Soft Error to Agent];
    F --> G[Agent Re-evaluates];

📦 安装

npm install -g krusch-sequential-mcp

或者在您的 MCP 配置文件(例如 claude_desktop_config.json.cursor/mcp.json)中进行配置:

{
  "mcpServers": {
    "krusch-sequential-mcp": {
      "command": "npx",
      "args": ["-y", "krusch-sequential-mcp"]
    }
  }
}

🚀 快速入门指南

智能体可以使用标准参数(thoughtthoughtNumbertotalThoughtsnextThoughtNeeded 等)调用 sequentialthinking 工具。

要启用合理性门控,请在工具调用中包含 groundingContext 参数:

{
  "thought": "Since the user is asking about the database schema, I will assume it uses MongoDB and write a query for it.",
  "thoughtNumber": 1,
  "totalThoughts": 3,
  "nextThoughtNeeded": true,
  "groundingContext": "The current codebase exclusively uses DBOS PostgreSQL for persistence. No NoSQL databases are present."
}

由于该思维与 groundingContext 冲突,评估器将自动拒绝它,并向智能体返回错误,要求其重新思考其方法。


⚙️ 环境变量

变量

必需

默认值

描述

DATABASE_URL

(无 — 禁用持久化)

PostgreSQL 连接字符串(例如 postgres://user:pass@localhost:5432/mydb)。如果未设置,服务器将在纯内存模式下运行。

OLLAMA_URL

http://localhost:11434

用于合理性检查的 Ollama 服务基础 URL。

PLAUSIBILITY_MODEL

qwen2.5-coder:1.5b

用于合理性筛选的 Ollama 模型。应为一个小型、快速的模型。

复制 .env.example 以快速开始:

cp .env.example .env

🤝 贡献

我们欢迎贡献!请确保您的测试通过并遵守项目格式标准。 通过 npm run buildnpm start(或 node build/index.js)运行测试。

📄 许可证

MIT License © 2026 kruschdev

A
license - permissive license
-
quality - not tested
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kruschdev/krusch-sequential-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server