agent_mcp_thoughtflow
The agent_mcp_thoughtflow server is a unified cognitive scaffold that bridges structured reasoning (Tree of Thoughts) with reliable task execution, enabling LLM agents to think deeply, track work, and maintain full provenance from idea to completion.
๐ง Tree of Thoughts (Reasoning)
Create hierarchical reasoning trees with a goal and root thought
Add child thoughts to explore solution branches
Evaluate thoughts with multi-criteria scoring (overall score, creativity, risk, custom criteria)
Verify, select, backtrack, and prune thoughts or entire trees
Generate child thoughts automatically using LLM providers (Grok, Ollama, Mock)
List, retrieve, and delete trees
โ Task Orchestration & Workflows
Create tasks with names, descriptions, dependencies, parent-child hierarchy, and ordering
Retrieve, update, list, and delete tasks and workflows
Start workflow execution and advance runs step-by-step
Monitor workflow runs
๐ Cognitive Bridge Layer (Reasoning โ Execution)
Promote thoughts or entire subtrees into executable tasks with full provenance metadata
Spawn a fresh Tree of Thoughts from a blocked/stuck task for deeper analysis
Create soft bidirectional links between thoughts and tasks
Trace the complete reasoning-to-execution provenance chain
Atomically complete tasks and evaluate linked thoughts
Use
quick_planto create a strategy, workflow, tasks, and root thought in a single call
๐๏ธ Strategy Management
Create top-level strategies to group related reasoning trees and workflows
Associate and remove trees/workflows from strategies
๐งน State Management & Deduplication
Deduplicate strategies and trees by normalized name/goal
Reload state from storage, soft-delete and restore entities, or permanently purge deleted items
Clear all or specific entities from memory and storage
๐ Visualization & Introspection
Generate ASCII tree diagrams (with or without cognitive links) and SVG diagrams for workflows, tasks, and strategies
Retrieve high-level cognitive statistics
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent_mcp_thoughtflowReason about database scaling and convert top thought into tasks"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent_mcp_thoughtflow
Unified Cognitive Scaffold MCP Server โ Bridging Deep Reasoning and Reliable Execution for LLM Agents
Overview
agent_mcp_thoughtflow is a production-ready Model Context Protocol (MCP) server that unifies structured task execution with systematic reasoning.
Modern LLM agents are excellent at planning (using techniques like Tree of Thoughts) but frequently fail at execution โ they explore ideas, then jump straight into implementation while skipping proper task tracking, dependency management, and auditability.
This server solves that gap by providing a single, cohesive cognitive scaffold where:
Strategy โ Top-level organizer that groups related reasoning trees and execution workflows
Tree of Thoughts handles divergent exploration and evaluation
Task Orchestrator handles convergent execution with dependencies and workflows
Cognitive Bridge Layer enables seamless, bidirectional conversion between thoughts and executable tasks
The result: agents can think deeply, commit reasoning to structured work, execute reliably, and โ when blocked โ spawn new reasoning trees from existing tasks.
Related MCP server: MCP Thinking Server
The Core Problem It Solves
Many agents follow this broken pattern:
Use ToT / reasoning tools to explore approaches
Directly implement changes without creating tracked tasks
Lose provenance, auditability, and the ability to resume or delegate work
agent_mcp_thoughtflow makes the correct workflow the easiest path:
Think โ Promote to Tasks โ Execute with Tracking โ (If blocked) Spawn new reasoning from task
Key Features
Cognitive Bridge Layer (The Killer Feature)
promote_thought_to_tasksโ Convert a thought (or entire subtree) into executable tasks with full provenance metadataspawn_tot_from_taskโ When a task is blocked, spawn a fresh Tree of Thoughts from it for deeper analysislink_thought_to_taskโ Create soft bidirectional links between thoughts and tasks for "inspired by" or "related to" relationshipsget_cognitive_provenanceโ Trace the complete reasoning โ execution chain
All bridge operations automatically maintain metadata.cognitive and create auditable cognitiveLinks.
Task Orchestrator
Rich task model with hard/soft dependencies
Hierarchical tasks (
parentTaskId+order)Workflow creation and execution engine with automatic dependency resolution
startWorkflowExecution+advanceWorkflowRunfor controlled executiongetReadyTasksfor just-in-time task dispatchingFirst-class verification fields โ
verified,verifiedAt,verificationNotes,verificationMethodfor tracking verification status
Tree of Thoughts
Full hierarchical thought trees with depth control
Multi-criteria evaluation (
score,creativity,risk, custom criteria)Pruning, backtracking, verification, and selection
Strategy grouping for organizing related reasoning sessions
First-class verification fields โ
verified,verifiedAt,verificationNotes,verificationMethodfor tracking verification status
Strategy Model (Top-Level Organizer)
Strategy groups related Trees of Thoughts and Workflows into cohesive units
Each Strategy can own multiple
treeIdsandworkflowIdsEnables organizing complex projects by linking reasoning and execution
Tools:
add_tree_to_strategy,add_workflow_to_strategy,remove_tree_from_strategy,remove_workflow_from_strategy
Visualization & Introspection
ASCII tree visualization (
visualize_tree_ascii)Tree visualization with cognitive links (
visualize_tree_with_links)SVG workflow diagrams with dependency layout
SVG task and strategy visualizations
get_cognitive_statsfor high-level metrics
Architecture & Extensibility
Clean service-oriented design with
BaseServiceDependency injection between services
Pluggable LLM providers (Grok, Ollama, Mock)
JSON storage (SQLite planned)
Centralized
ToolRegistryfor maintainable tool definitions
Installation
npm install agent_mcp_thoughtflowOr run directly with npx:
npx agent_mcp_thoughtflowQuick Start
1. Start the Server
npx agent_mcp_thoughtflowThe server uses JSON file storage by default (./thoughtflow-state.json).
2. Basic Hybrid Workflow Example
// 1. Create a reasoning tree
create_tree({
"goal": "Design a robust caching strategy for our API",
"rootContent": "Start with a simple in-memory cache"
})
// 2. Explore and evaluate thoughts...
// 3. Promote the best approach to tasks
promote_thought_to_tasks({
"treeId": "...",
"thoughtId": "...",
"includeDescendants": true,
"workflowId": "optional-existing-workflow"
})
// 4. Start executing the workflow
start_workflow_execution({ "workflowId": "..." })
// 5. If a task gets blocked, spawn new reasoning
spawn_tot_from_task({
"taskId": "...",
"goal": "Investigate why the cache invalidation is failing",
"rootContent": "The cache is not being invalidated on write operations"
})3. Quick Plan (One-Call Setup)
For new projects, use quick_plan to create strategy + workflow + tasks + root thought in a single call:
quick_plan({
"goal": "Implement user authentication system",
"tasks": [
{ "name": "Design auth schema", "description": "Define user, session, and token tables" },
{ "name": "Implement password hashing", "dependencies": ["task-1"] },
{ "name": "Create login endpoint", "dependencies": ["task-2"] },
{ "name": "Add JWT token generation", "dependencies": ["task-3"] },
{ "name": "Implement logout logic", "dependencies": ["task-4"] }
],
"strategyName": "auth-system",
"workflowName": "auth-implementation"
})
// Returns:
// {
// strategyId: "auth-system",
// workflowId: "auth-implementation",
// taskIds: ["task-1", "task-2", "task-3", "task-4", "task-5"],
// treeId: "...",
// rootThoughtId: "..."
// }This reduces 4-5 tool calls to 1, making onboarding friction-free.
Web UI Dashboard
The Thoughtflow Dashboard provides a comprehensive web interface for inspecting cognitive provenance, including:
Strategy Overview โ View all strategies with their associated trees and workflows
Task Management โ Monitor task status, dependencies, and execution progress
Tree of Thoughts Visualization โ Explore thought trees with evaluation scores and states
Workflow Tracking โ Track workflow execution status and completion
Cognitive Links โ Inspect bidirectional links between thoughts and tasks
Real-time Updates โ Auto-refresh capability with change indicators
Starting the Dashboard
# Build the project first (if not already built)
npm run build
# Start the dashboard server
npm run dashboardThe dashboard server will start on port 3000 (or the next available port if 3000 is in use). You'll see output like:
Thoughtflow Dashboard server running at http://localhost:3000
Dashboard: http://localhost:3000/dashboard
API: http://localhost:3000/api/state
State Info: http://localhost:3000/api/state/infoAccessing the Dashboard
Open your browser and navigate to:
Dashboard:
http://localhost:3000/dashboard
Dashboard Features
Strategy Filtering โ Click on a strategy to filter trees, workflows, and tasks by that strategy
Show/Hide Deleted Items โ Toggle the checkbox to view soft-deleted items
Auto-Refresh โ Enable/disable automatic data refresh (default: ON)
Manual Refresh โ Click the Refresh button to manually update data
Collapsible Trees โ Expand/collapse thought trees to explore reasoning branches
Status Indicators โ Color-coded status indicators for tasks, thoughts, and workflows
API Endpoints
The dashboard server provides the following API endpoints:
GET /api/stateโ Returns the complete Thoughtflow state (strategies, tasks, trees, workflows, cognitive links)GET /api/state/infoโ Returns state metadata (exists, lastModified, size)
Tool Reference
Bridge Layer Tools
Tool | Purpose |
| Convert reasoning into tracked executable work |
| Spawn fresh reasoning from a blocked task |
| Create soft bidirectional links for "inspired by" or "related to" relationships |
| Trace full reasoning โ execution history |
| Atomically mark task completed and evaluate/verify linked thoughts |
| Single call to create strategy + workflow + tasks + root thought |
| Scan completed tasks and evaluate pending linked thoughts |
Note: promote_thought_to_tasks supports skipEvaluationGate: true for simple workflows that don't need the evaluate+select cycle. The system uses debounce mechanisms to prevent race conditions during heavy LLM usage.
Task Orchestrator Tools
Category | Tools |
Tasks |
|
Workflows |
|
Execution |
|
Hierarchy |
|
Strategies |
|
Soft-Delete |
|
Note: Single-item task creation (create_task) is not available. Use create_tasks (batch) for all task creation. It supports positional references (task-1, task-2) for dependencies and parent-child relationships within the batch, and returns an idMap for mapping positional refs to real IDs.
Tree of Thoughts Tools
Category | Tools |
Trees |
|
Thoughts |
|
Strategies |
|
Note: Single-item idea creation (add_idea) is not available. Use add_ideas (batch) for all idea creation. It supports positional references (idea-1, idea-2) for parentId within the batch, uses fuzzy matching for robustness, and returns an idMap for mapping positional refs to real IDs.
Soft-Delete & Recovery
All delete operations use soft-delete by default โ entities are marked as deleted but preserved for recovery.
includeDeletedparameter: Allget_*andlist_*tools support an optionalincludeDeleted: trueparameter to view soft-deleted items.restore_deleted: Restore a soft-deleted entity back to active state. RequiresentityType('task', 'workflow', 'tree', 'strategy', 'link') andid.purge_deleted: Permanently remove soft-deleted items (cannot be undone). Supports filtering byentityTypeandolderThanDaysfor safe cleanup.
Example workflow:
// 1. Delete a task
delete_task({ "id": "task-123" })
// 2. List active tasks (deleted task hidden)
list_tasks() // โ task-123 not visible
// 3. List with deleted included
list_tasks({ "includeDeleted": true }) // โ task-123 visible with isDeleted flag
// 4. Restore if needed
restore_deleted({ "entityType": "task", "id": "task-123" })
// 5. Permanently purge old deleted items (e.g., older than 30 days)
purge_deleted({ "entityType": "task", "olderThanDays": 30 })State Size & Deduplication
Cognitive links can accumulate over time. The system includes built-in deduplication tools to manage state size:
deduplicate_strategies_and_treesโ Removes duplicate strategies and trees by normalized name/goaldeduplicate_strategiesโ Removes duplicate strategies onlydeduplicate_treesโ Removes duplicate trees only
For production workloads with heavy cognitive link usage, monitor state file size and run deduplication periodically.
Visualization Tools
visualize_tree_asciivisualize_tree_with_linksvisualize_workflow_svgvisualize_task_svgvisualize_strategy_svgget_cognitive_stats
Recommended Agent Workflow
The intended usage pattern for LLM agents:
Explore โ Use
create_tree+add_idea+evaluate_thoughtto explore solution spaceCommit โ Use
promote_thought_to_taskson the most promising branchExecute โ Use
start_workflow_execution+advance_workflow_run(orgetReadyTasks)Reflect โ If blocked, use
spawn_tot_from_taskon the stuck taskAudit โ Use
get_cognitive_provenancewhen traceability is required
This pattern turns ad-hoc reasoning into auditable, resumable, delegable work.
Relationship Model
The system uses a strict hierarchical relationship model for organizing cognitive work:
Strategy (Top-Level Organizer - Mandatory Owner)
โโโ workflowIds: string[] โ Workflows (each workflow belongs to exactly ONE strategy)
โโโ treeIds: string[] โ Trees of Thoughts (reasoning, optional strategy association)
โโโ metadata: Record<string, any>
Workflow (Execution Container - Mandatory Owner)
โโโ strategyId: string โ Strategy (mandatory, exactly one)
โโโ taskIds: string[] โ Tasks (each task belongs to exactly ONE workflow)
โโโ metadata: Record<string, any>
Task (Executable Unit - Mandatory Owner)
โโโ workflowId: string โ Workflow (mandatory, exactly one)
โโโ strategyId: string โ Strategy (denormalized from workflow for convenience)
โโโ parentTaskId?: string โ Subtask parent (must be in same workflow)
โโโ dependencies: string[] โ Task dependencies (must be in same workflow)
โโโ metadata: Record<string, any>
Idea (Thought) โ Task (Soft Bidirectional Links)
โโโ Thought.metadata.cognitive.linkedTaskIds
โโโ Task.metadata.cognitive.linkedThoughtIds
โโโ syncStatus: 'synced' | 'outdated' | 'conflict'
โโโ provenanceChain: ProvenanceEntry[]Key Relationships & Invariants
Strategy โ Workflows: Strict ownership โ each workflow belongs to exactly one strategy
Workflow โ Tasks: Strict ownership โ each task belongs to exactly one workflow
Task โ Strategy: Denormalized from workflow for convenience, automatically kept in sync
Subtasks: Must have parent in the same workflow (enforced by
parentTaskIdvalidation)Dependencies: Must reference tasks in the same workflow (enforced by validation)
Idea โ Task: Soft bidirectional links enable "inspired by" or "related to" relationships without full promotion
Promotion: Full conversion from thought subtree to executable tasks with provenance tracking (requires
workflowId)Spawning: Create new reasoning trees from blocked tasks for deeper analysis
Creation Flow (Strict Hierarchy)
All creation flows must follow the hierarchy:
create_strategyโ Create or get strategy (idempotent by normalized name)create_workflow(strategyId)โ Create workflow with mandatorystrategyIdcreate_task(workflowId)โ Create task with mandatoryworkflowId(automatically inheritsstrategyId)
The system enforces these invariants at every operation to prevent data inconsistency.
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Thoughtflow MCP Server โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ CognitiveBridgeService โโ TaskOrchestratorService โ
โ โ โ โ
โ โ โ โ
โ ToTService Workflow Execution Engine โ
โ โ โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ โ
โ โ โ
โ VisualizationService โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโAll services extend BaseService for unified state management, auto-save, and shutdown behavior.
Storage
Default: JSON file (
thoughtflow-state.json)Future: SQLite support (planned in v1.1)
The storage layer is abstracted via IStorageAdapter, making it easy to add new backends.
LLM Provider Support
The ToT system supports multiple LLM backends:
Grok (
GrokLLMProvider) โ Recommended for high-quality structured evaluationOllama (
OllamaLLMProvider) โ Local/private modelsMock (
MockLLMProvider) โ Testing and development
Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build
npm run buildRoadmap
SQLite storage adapter
Richer workflow visualization and Gantt-style views
Built-in retry policies and task timeout handling
Multi-agent collaboration primitives
Web UI for inspecting cognitive provenance
Contributing
Contributions are welcome! Please open an issue first to discuss major changes.
Focus areas:
Improving the Bridge Layer ergonomics
Additional visualization formats
Performance on large thought trees / workflows
License
MIT ยฉ 2026
Acknowledgments
This project was born from the observation that reasoning without execution tracking is incomplete, and execution without reasoning provenance is fragile.
agent_mcp_thoughtflow exists to make the full cognitive loop first-class in agent systems.
Built with โค๏ธ for agents that need to think and ship.
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
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/HefnySco/agent_mcp_thoughtflow'
If you have feedback or need assistance with the MCP directory API, please join our Discord server