A TypeScript Model Context Protocol (MCP) server designed to enable Large Language Models (LLMs) to programmatically construct mind maps for exploring idea spaces, with enforced "metacognitive" self-reflection.
The Structured Thinking MCP Server is a tool that helps LLMs organize their thoughts into structured mind maps. It enforces metacognitive self-reflection by assigning quality scores to thoughts, tagging them with stages, and managing their life-cycle.
Each thought captured by the LLM is assigned a quality score between 0 and 1. This score, combined with the thought's stage, provides feedback to the LLM on how to steer its thinking process.
Thoughts are tagged with stages such as Problem Definition, Analysis, and Ideation. These stages help manage the life-cycle of the LLM's thinking process. If the LLM spends too long in one stage or produces low-quality thoughts, the server provides feedback to encourage the LLM to move to other stages or adopt different thinking strategies.
The LLM can spawn branches off a particular thought to explore different lines of reasoning in parallel. Each branch is tracked separately, allowing for the coexistence of multiple solutions or ideas.
The server maintains a short-term memory buffer of the LLM's ten most recent thoughts and a long-term memory of thoughts that can be retrieved based on their tags. This allows for summarization of the entire history of the LLM's thinking process on a given topic.
To set up the Structured Thinking MCP Server, configure the tool in Claude Desktop, Cursor, or another MCP client as follows:
{
"structured-thinking": {
"command": "npx",
"args": ["-y", "structured-thinking"]
}
}
The server exposes the following MCP tools:
capture_thought
Create a thought in the thought history, with metadata about the thought's type, quality, content, and relationships to other thoughts.
Parameters:
- thought
: The content of the current thought
- thought_number
: Current position in the sequence
- total_thoughts
: Expected total number of thoughts
- next_thought_needed
: Whether another thought should follow
- stage
: Current thinking stage (e.g., "Problem Definition", "Analysis")
- is_revision
(optional): Whether this revises a previous thought
- revises_thought
(optional): Number of thought being revised
- branch_from_thought
(optional): Starting point for a new thought branch
- branch_id
(optional): Identifier for the current branch
- needs_more_thoughts
(optional): Whether additional thoughts are needed
- score
(optional): Quality score (0.0 to 1.0)
- tags
(optional): Categories or labels for the thought
revise_thought
Revise a thought in the thought history, with metadata about the thought's type, quality, content, and relationships to other thoughts.
Parameters:
- thought_id
: The ID of the thought to revise
- Parameters from capture_thought
retrieve_relevant_thoughts
Retrieve thoughts from long-term storage that share tags with the specified thought.
Parameters:
- thought_id
: The ID of the thought to retrieve relevant thoughts for
get_thinking_summary
Generate a comprehensive summary of the entire thinking process.
clear_thinking_history
Clear all recorded thoughts and reset the server state.
The current quality metrics and metacognitive feedback are derived mechanically from naive stage-based multipliers applied to a single self-reported quality score. Future work will include more sophisticated metacognitive feedback, semantic analysis of thought content, and intelligent monitoring for reasoning errors.
The server currently stores all thoughts in memory and does not persist them to a file or database. There is also no user interface for reviewing the thought space or visualizing the mind map. Future work will include a simple visualization client.
This project is licensed under the MIT License.