Thoughtbox

io.github.Kastalien-Research由 GitHub 账号 Kastalien-Research 发布v1.0.3更新于 Oct 24, 2026

Extended reasoning with structured processes, persistence, and workflow guidance

发布方自己的服务:Thoughts

概览

AI 生成的概览

Thoughtbox 是一个本地 MCP 服务器,用于结构化、可持久化的推理:把思考记录成可审计的图谱,并协调多智能体工作区。

可以做什么
  • 以正向、逆向、分支和修订等模式记录与查询推理思考,并为每条思考标注类型
  • 通过两个 Code Mode 工具检索操作目录,并用 JavaScript SDK 串联执行操作
  • 在共享工作区中协调多个智能体:问题、提案、同行评审、共识与问题级频道
  • 以带类型关系的知识图谱实体保存跨会话的持久记忆
  • 运行混合文档与可执行 JavaScript/TypeScript 的笔记本
  • 在本地 Observatory 界面实时查看会话,并导出或分析推理轨迹
适用场景
适合希望把助手的推理过程记录下来、可检查并跨会话复用的场景,也适合多个智能体需要共享、可审计的问题解决流程(含评审与共识环节)。最适合愿意运行本地 Docker 环境的 Claude Code 用户。
运行要求
以 Docker/Docker Compose 本地运行(开发需 Node.js 22+);MCP 服务器监听 1731 端口,Observatory 界面为 1729。可选环境变量用于配置存储、传输方式、项目范围与 Observatory;使用 Supabase 存储需 SUPABASE_URL 与 SUPABASE_SERVICE_ROLE_KEY。
安装前请注意
思考、会话与知识图谱条目默认持久化到本地数据目录,敏感推理内容可能被留存。Supabase 存储会把数据发送到第三方云,且需要权限很大的 service role 密钥。Observatory 界面通过 HTTP 提供且 CORS 可配置,服务器默认绑定所有网络接口。README 说明其针对 Claude Code 优化,其他客户端可能存在问题。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Thoughtbox,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Thoughtbox

Multi-agent collaborative reasoning that's auditable. Thoughtbox is an MCP server for structured, multi-agent reasoning, with a companion web app for workspace and inspection flows. Every step is recorded as a structured thought in a persistent reasoning ledger that can be visualized, exported, and analyzed.

Runtime modes: Local development can use filesystem or in-memory storage. Deployed mode uses Supabase-backed storage, and the current production MCP server runs on Cloud Run.

[Thoughtbox Observatory] Observatory UI showing a reasoning session with 14 thoughts and a branch exploration (purple nodes 13-14) forking from thought 5.

Code Mode

Thoughtbox exposes exactly two MCP tools using the Code Mode pattern:

  • thoughtbox_search — Write JavaScript to query the operation/prompt/resource catalog. The LLM has full programmatic filtering power over the catalog.
  • thoughtbox_execute — Write JavaScript using the tb SDK to chain operations. Access thoughts, sessions, knowledge, notebooks, hub, observability, and protocol tools through a unified namespace.

Workflow: search to discover available operations, then execute code against them. Use console.log() for debugging — output is captured in response logs.

This replaces per-operation tool registration with a two-tool surface that scales without context window bloat.

Multi-Agent Collaboration

The Hub is the coordination layer. Agents register with role-specific profiles, join shared workspaces, and work through a structured problem-solving workflow — all via thoughtbox_execute.

The workflow: register → create workspace → create problem → claim → work → propose solution → peer review → merge → consensus

Workspace primitives:

  • Problem — A unit of work with dependencies, sub-problems, and status tracking (open → in-progress → resolved → closed)
  • Proposal — A proposed solution with a source branch reference and review workflow
  • Consensus — A decision marker tied to a thought reference for traceability
  • Channel — A message stream scoped to a problem for discussion

Agent Profiles: MANAGER, ARCHITECT, DEBUGGER, SECURITY, RESEARCHER, REVIEWER — each provides domain-specific mental models and behavioral priming.

28 operations across identity, workspace management, problems, proposals, consensus, channels, and status reporting.

Auditable Reasoning

Every thought is a node in a graph — numbered, timestamped, linked to its predecessors, and persisted across sessions. This creates an auditable trail of how conclusions were reached.

Agents can think forward, plan backward, branch into parallel explorations, and revise earlier conclusions. Each pattern is a first-class operation:

PatternDescriptionUse Case
ForwardSequential 1→2→3→N progressionExploration, discovery, open-ended analysis
BackwardStart at goal (N), work back to start (1)Planning, system design, working from known goals
BranchingFork into parallel explorations (A, B, C...)Comparing alternatives, A/B scenarios
RevisionUpdate earlier thoughts with new informationError correction, refined understanding

Each thought carries a semantic thoughtType (reasoning, decision_frame, action_report, belief_snapshot, assumption_update, context_snapshot, progress) that classifies what kind of thought it is, orthogonal to the process pattern used.

See the Patterns Cookbook for comprehensive examples.

Real-Time Observability

The Observatory is a built-in web UI at http://localhost:1729 for watching reasoning unfold live.

  • Live Graph — thoughts appear as nodes in real-time via WebSocket
  • Branch Navigation — branches collapse into clickable stubs; drill in and back out
  • Detail Panel — click any node to view full thought content
  • Multi-Session — switch between active reasoning sessions
  • Deep Analysis — analyze sessions for reasoning patterns, cognitive load, and decision points

The full observability stack includes OpenTelemetry tracing, Prometheus metrics, and Grafana dashboards.

Knowledge & Reasoning Tools

Knowledge Graph — Persistent memory across sessions. Capture insights, concepts, workflows, and decisions as typed entities with typed relations (BUILDS_ON, CONTRADICTS, SUPERSEDES, etc.) and visibility controls (public, agent-private, team-private).

Notebooks — Interactive literate programming combining documentation with executable JavaScript/TypeScript in isolated environments.

Client Compatibility

Thoughtbox is currently optimized for Claude Code. We are actively working on supporting additional MCP clients. Due to variation in capability support across the MCP ecosystem — server features (prompts, resources, tools), client features (roots, sampling, elicitation), and behaviors like listChanged notifications — we implement custom adaptations for many clients.

If you're using a client other than Claude Code and encounter issues, please open an issue describing your client and the problem.

Installation

Thoughtbox runs as a Docker-based MCP server. It requires Docker and Docker Compose.

Quick Start

bash
git clone https://github.com/Kastalien-Research/thoughtbox.gitcd thoughtboxdocker compose up --build

This starts Thoughtbox and the full observability stack. The MCP server listens on port 1731 and the Observatory UI is available at http://localhost:1729.

MCP Client Configuration

Since Thoughtbox uses HTTP transport, configure your MCP client to connect via URL.

Claude Code

Add to your ~/.claude/settings.json or project .claude/settings.json:

json
{  "mcpServers": {    "thoughtbox": {      "url": "http://localhost:1731/mcp"    }  }}

To connect through the observability sidecar (adds OpenTelemetry tracing):

json
{  "mcpServers": {    "thoughtbox": {      "url": "http://localhost:4000/mcp"    }  }}
Cline / VS Code

Add to your MCP settings or .vscode/mcp.json:

json
{  "servers": {    "thoughtbox": {      "url": "http://localhost:1731/mcp"    }  }}

Usage Examples

Forward Thinking — Problem Analysis

text
Thought 1: "Users report slow checkout. Let's analyze..."Thought 2: "Data shows 45s average, target is 10s..."Thought 3: "Root causes: 3 API calls, no caching..."Thought 4: "Options: Redis cache, query optimization, parallel calls..."Thought 5: "Recommendation: Implement Redis cache for product data"

Backward Thinking — System Design

text
Thought 8: [GOAL] "System handles 10k req/s with <100ms latency"Thought 7: "Before that: monitoring and alerting operational"Thought 6: "Before that: resilience patterns implemented"Thought 5: "Before that: caching layer with invalidation"...Thought 1: [START] "Current state: 1k req/s, 500ms latency"

Branching — Comparing Alternatives

text
Thought 4: "Need to choose database architecture..."
Branch A (thought 5): branchId="sql-path"  "PostgreSQL: ACID compliance, mature tooling, relational integrity"
Branch B (thought 5): branchId="nosql-path"  "MongoDB: Flexible schema, horizontal scaling, document model"
Thought 6: [SYNTHESIS] "Use PostgreSQL for transactions, MongoDB for analytics"

Environment Variables

VariableDescriptionDefault
DISABLE_THOUGHT_LOGGINGSuppress thought logging to stderrfalse
THOUGHTBOX_DATA_DIRBase directory for persistent storage~/.thoughtbox
THOUGHTBOX_PROJECTProject scope for session isolation_default
THOUGHTBOX_TRANSPORTTransport type (stdio or http)http
THOUGHTBOX_STORAGEStorage backend (fs, memory, or supabase)fs
THOUGHTBOX_OBSERVATORY_ENABLEDEnable Observatory web UIfalse
THOUGHTBOX_OBSERVATORY_PORTObservatory UI port1729
THOUGHTBOX_OBSERVATORY_CORSCORS origins for Observatory (comma-separated)(none)
THOUGHTBOX_AGENT_IDPre-assigned Hub agent ID(none)
THOUGHTBOX_AGENT_NAMEPre-assigned Hub agent name(none)
SUPABASE_URLSupabase project URL (required for supabase storage)(none)
SUPABASE_SERVICE_ROLE_KEYSupabase service role key (required for supabase storage)(none)
PORTHTTP server port1731
HOSTHTTP server bind address0.0.0.0
NODE_ENVNode environment(none)
PROMETHEUS_URLPrometheus endpoint (Docker)http://prometheus:9090
GRAFANA_URLGrafana endpoint (Docker)http://grafana:3000

Development

For local development (requires Node.js 22+):

bash
pnpm installpnpm buildpnpm dev      # Development with hot reload

Testing

bash
npx vitest run              # Unit testspnpm test                   # Full suite (build + vitest)pnpm test:agentic           # Agentic tests — full suite (build + run)pnpm test:agentic:tool      # Agentic tests — tool-level onlypnpm test:agentic:quick     # Agentic tests — quick (no build)pnpm test:behavioral        # Behavioral contract tests

Docker Compose

docker compose up --build starts the full stack:

ServicePortDescription
thoughtbox1731 (MCP), 1729 (Observatory)Core MCP server + Observatory UI
mcp-sidecar4000Observability proxy with OpenTelemetry
otel-collector4318 (HTTP), 8889 (metrics)OpenTelemetry Collector
prometheus9090Metrics storage + alerting
grafana3001Dashboards and visualization

Persistent data is stored in named volumes: thoughtbox-data, prometheus-data, grafana-data.

Architecture

text
src/├── index.ts                # Entry point (Streamable HTTP transport)├── server-factory.ts       # MCP server factory with tool registration├── thought-handler.ts      # Core thought recording logic├── types.ts                # Shared type definitions├── database.types.ts       # Supabase generated types├── code-mode/              # Code Mode tool surface│   ├── search-tool.ts      # thoughtbox_search — catalog query via JS│   ├── execute-tool.ts     # thoughtbox_execute — operation chaining via tb SDK│   ├── search-index.ts     # Frozen catalog of operations/prompts/resources│   └── sdk-types.ts        # TypeScript definitions for the tb SDK├── thought/                # Thought operations and tool definitions├── sessions/               # Session management├── persistence/            # Storage layer│   ├── storage.ts          # InMemoryStorage with LinkedThoughtStore│   ├── filesystem-storage.ts  # FileSystemStorage with atomic writes│   └── supabase-storage.ts # SupabaseStorage for deployed/cloud usage├── observatory/            # Real-time visualization│   ├── ui/                 # Self-contained HTML/CSS/JS│   └── ws-server.ts        # WebSocket server for live updates├── hub/                    # Multi-agent collaboration│   ├── identity.ts         # Agent registration│   ├── workspace.ts        # Workspace management│   ├── problems.ts         # Problem tracking with dependencies│   ├── proposals.ts        # Solution proposals with reviews│   ├── consensus.ts        # Decision recording│   ├── channels.ts         # Problem-scoped messaging│   ├── hub-handler.ts      # Hub operation dispatcher│   └── operations.ts       # 28-operation catalog├── channel/                # Hub event channels and SSE streaming├── protocol/               # Ulysses and Theseus protocol tools├── knowledge/              # Knowledge graph memory├── auth/                   # API key authentication├── audit/                  # Audit manifest generation├── evaluation/             # LangSmith evaluation and online monitoring├── notebook/               # Literate programming engine├── events/                 # Event emission system├── observability/          # Prometheus/Grafana integration├── prompts/                # MCP prompt definitions├── references/             # Anchor parsing and resolution├── revision/               # Revision indexing├── operations-tool/        # Operations tool handler└── resources/              # Documentation and patterns cookbook

Storage

Thoughtbox supports three storage backends:

  • InMemoryStorage: Volatile storage for testing, uses LinkedThoughtStore for O(1) thought lookups
  • FileSystemStorage: Persistent storage with atomic writes and project isolation (default)
  • SupabaseStorage: Cloud-native storage backed by Supabase Postgres for deployed instances

Data is stored at ~/.thoughtbox/ by default (FileSystemStorage):

text
~/.thoughtbox/├── config.json           # Global configuration└── projects/    └── {project}/        └── sessions/            └── {date}/                └── {session-id}/                    ├── manifest.json                    └── {thought-number}.json

Contributing

We welcome contributions! See CONTRIBUTING.md for:

  • Development setup
  • Commit conventions (optimized for thick_read code comprehension)
  • Testing with vitest and agentic scripts
  • Pull request process

License

MIT License — free to use, modify, and distribute.

来源:README.md,提交 85a6230

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Thoughtbox 集成