Thoughtboxのロゴ

Thoughtbox

組織
Kastalien-Research

Thoughtbox is an intention ledger for agents. Evaluate AI's decisions against its decision-making.

公開者Kastalien-Research
リポジトリthoughtbox
言語TypeScript
フォーク
20
スター
64
利用可能なツール
4
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Thoughtboxは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 4個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには64件のスターと20件のフォークがあります。

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.git
cd thoughtbox
docker 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 install
pnpm build
pnpm dev      # Development with hot reload

Testing

bash
npx vitest run              # Unit tests
pnpm test                   # Full suite (build + vitest)
pnpm test:agentic           # Agentic tests — full suite (build + run)
pnpm test:agentic:tool      # Agentic tests — tool-level only
pnpm 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.

インストール

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "kastalien-research-thoughtbox": {
      "command": "npx",
      "args": [
        "-y",
        "@kastalien-research/thoughtbox"
      ]
    }
  }
}

利用可能なツール

  • thoughtbox

    Step-by-step thinking tool for complex problem-solving.

    Supports flexible reasoning: forward thinking (1→N), backward thinking (N→1), branching, and revision. Adjust your approach dynamically as understanding deepens.

    Use for:

    • Multi-step analysis and planning
    • Problems requiring course correction
    • Hypothesis generation and testing
    • System design and architecture decisions

    Patterns Cookbook: Automatically provided at thought 1 with 6 core reasoning patterns, examples, and best practices. Request anytime with includeGuide parameter.

  • notebook

    Notebook toolhost for literate programming with JavaScript/TypeScript.

    Create, manage, and execute interactive notebooks with markdown documentation and executable code cells. Each notebook runs in an isolated environment with its own package.json and workspace.

    ✨ NEW: Pre-structured templates for guided workflows

    • Use template: "sequential-feynman" for deep learning with Feynman Technique
    • Templates provide scaffolded cells, metacognitive prompts, and progress tracking
    • Perfect for complex topics requiring validated understanding

    Available operations:

    • create: Create a new notebook (optionally from template)
    • list: List all active notebooks
    • load: Load notebook from .src.md file
    • add_cell: Add cell (title/markdown/code)
    • update_cell: Update cell content
    • run_cell: Execute code cell
    • install_deps: Install npm dependencies
    • list_cells: List all cells in notebook
    • get_cell: Get cell details
    • export: Export notebook to .src.md

    Common operation examples:

    Create a blank no

  • mental_models

    Access 15 mental models for structured reasoning. Each model provides a complete prompt with process steps, examples, and pitfalls.

    Mental models are process scaffolds that tell you HOW to think about a problem, not WHAT to think. They're infrastructure for your reasoning.

    Operations:

    • get_model: Retrieve a specific mental model prompt
    • list_models: List available models (optionally filtered by tag)
    • list_tags: List all available tags with descriptions
    • get_capability_graph: Get structured data for knowledge graph initialization

    Available tags: debugging, planning, decision-making, risk-analysis, estimation, prioritization, communication, architecture, validation

    Use list_models with a tag filter to discover relevant models for your task. For example, use tag "debugging" when stuck on an issue, or "decision-making" when choosing between options.

  • export_reasoning_chain

    Export a reasoning session to filesystem as linked JSON structure. Useful for persisting reasoning chains, sharing sessions, or archiving completed work.

ThoughtboxのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Thoughtboxに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Thoughtboxをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. ThoughtboxのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "kastalien-research-thoughtbox": {
      "command": "npx",
      "args": [
        "-y",
        "@kastalien-research/thoughtbox"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてThoughtboxのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. ThoughtboxのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Thoughtboxを使ってこのタスクを手伝ってもらえますか?
Thoughtbox
はい、読みました。
Thoughtboxで調べた結果をお伝えします。

よくある質問

Thoughtbox MCPサーバーは何に使いますか?

Thoughtboxは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでThoughtbox MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでThoughtboxを利用できます。

TypingMindでThoughtbox MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Thoughtboxを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Thoughtbox MCPをTypingMindに接続するにはどうすればよいですか?

ThoughtboxはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでThoughtbox MCPのどのようなツールを利用できますか?

Thoughtboxは4個のMCPツールを提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Thoughtbox MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Thoughtboxで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

Thoughtbox Init Flow

START HERE FIRST: Read this resource before using any Thoughtbox tools. Initializes session context and loads previous work for continuity.

Notebook Server Status

Health snapshot of the notebook server

Notebook Operations Catalog

Complete catalog of notebook operations with schemas and examples

Thoughtbox Patterns Cookbook

Guide to core reasoning patterns for thoughtbox tool

Server Architecture Guide

Interactive notebook explaining Thoughtbox MCP server architecture and implementation patterns

Mental Models Operations Catalog

Complete catalog of mental models, tags, and operations

Mental Models Root

Root directory: 15 models across 9 tags

Tag: debugging

Finding and fixing issues in code, logic, or systems (2 models)

Tag: planning

Breaking down work, sequencing tasks, project organization (6 models)

Tag: decision-making

Choosing between options under uncertainty (4 models)

Tag: risk-analysis

Identifying what could go wrong and how to prevent it (3 models)

Tag: estimation

Making reasonable guesses with limited information (1 models)

Tag: prioritization

Deciding what to do first, resource allocation (3 models)

Tag: communication

Explaining clearly to humans, documentation (2 models)

Tag: architecture

System design, component relationships, structure (3 models)

Tag: validation

Checking assumptions, testing hypotheses, verification (4 models)

list_mcp_assets

Overview of all MCP capabilities, tools, resources, and quickstart guide

interleaved-thinking

Use this Thoughtbox server as a reasoning workspace to alternate between internal reasoning steps and external tool/action invocation. Enables structured multi-phase execution with tooling inventory, sufficiency assessment, strategy development, and execution.

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇