| Crates.io | kodegen_tools_sequential_thinking |
| lib.rs | kodegen_tools_sequential_thinking |
| version | 0.10.11 |
| created_at | 2025-11-03 15:52:19.679426+00 |
| updated_at | 2026-01-02 15:06:12.651323+00 |
| description | KODEGEN.ᴀɪ: Memory-efficient, Blazing-Fast, MCP tools for code generation agents. |
| homepage | https://kodegen.ai |
| repository | https://github.com/cyrup-ai/kodegen-tools-sequential-thinking |
| max_upload_size | |
| id | 1914877 |
| size | 4,143,164 |
A blazing-fast, memory-efficient MCP (Model Context Protocol) tool that provides sequential thinking capabilities for AI agents. Part of the KODEGEN.ᴀɪ ecosystem.
rust-toolchain.toml)# Clone the repository
git clone https://github.com/cyrup-ai/kodegen-tools-sequential-thinking.git
cd kodegen-tools-sequential-thinking
# Build the project
cargo build --release
# Run the MCP server
cargo run --release --bin kodegen-sequential-thinking --features server
The tool runs as an HTTP/HTTPS server implementing the Model Context Protocol:
# Start the server (typically managed by kodegend daemon)
cargo run --bin kodegen-sequential-thinking --features server
Default port: 30437 (configured by kodegend)
{
"thought": "Your reasoning step",
"thought_number": 1,
"total_thoughts": 5,
"next_thought_needed": true,
"session_id": "optional-uuid",
"is_revision": false,
"revises_thought": null,
"branch_from_thought": null,
"branch_id": null,
"needs_more_thoughts": false
}
// Thought 1: Initial analysis
{
"thought": "I need to calculate 15 * 24 step by step",
"thought_number": 1,
"total_thoughts": 3,
"next_thought_needed": true
}
// Thought 2: Break down the problem
{
"thought": "Using distribution: 15 * 24 = 15 * (20 + 4)",
"thought_number": 2,
"total_thoughts": 3,
"next_thought_needed": true
}
// Thought 3: Final answer
{
"thought": "15*20 = 300, 15*4 = 60, so 300 + 60 = 360",
"thought_number": 3,
"total_thoughts": 3,
"next_thought_needed": false
}
Correct a previous thought when you realize an error:
{
"thought": "Wait, I need to revise my earlier assumption",
"thought_number": 3,
"total_thoughts": 5,
"is_revision": true,
"revises_thought": 2,
"next_thought_needed": true
}
Explore alternative approaches:
{
"thought": "Let me explore denormalization as an alternative",
"thought_number": 3,
"total_thoughts": 5,
"branch_from_thought": 2,
"branch_id": "denormalize-approach",
"next_thought_needed": true
}
Expand your thinking mid-process:
{
"thought": "Actually, this needs more steps than I thought",
"thought_number": 3,
"total_thoughts": 7, // Increased from 5
"needs_more_thoughts": true,
"next_thought_needed": true
}
The tool uses an MPSC actor model for session management:
Sessions are stored in: $XDG_CONFIG_HOME/kodegen-mcp/sequential_thinking/{session-id}/
Files:
session.json - Metadata (timestamps, thought count, branches)thought{n}.json - Individual thoughtsbranch_{id}_thought{n}.json - Branch thoughts# Run unit tests
cargo test
# Run the comprehensive demo
cargo run --example sequential_thinking_demo
# Run with verbose output
cargo test -- --nocapture
# Format code
cargo fmt
# Run linter
cargo clippy --all-features
# Check all targets
cargo check --all-targets --all-features
DISABLE_THOUGHT_LOGGING=true - Suppress colorful stderr output during testingsrc/
├── lib.rs # Public API exports
├── sequential_thinking.rs # Core implementation
└── main.rs # HTTP server binary
examples/
├── sequential_thinking_demo.rs # Comprehensive feature demo
└── common/mod.rs # Test utilities
This tool is designed to work seamlessly with Claude Code and other MCP-compatible AI agents:
Use the sequential_thinking tool to break down complex problems:
1. Start with an initial thought and estimated total
2. Progress through your reasoning step by step
3. Revise or branch when you discover new insights
4. Conclude when you reach a satisfactory solution
Part of the kodegen-tools family:
kodegen_mcp_tool - Tool trait and error typeskodegen_mcp_schema - Shared schema definitionskodegen_server_http - HTTP/HTTPS MCP transportDual-licensed under:
You may choose either license for your use.
Contributions are welcome! Please ensure:
cargo fmtcargo testcargo clippy --all-featuresKODEGEN.ᴀɪ - Memory-efficient, Blazing-Fast, MCP tools for code generation agents.
Copyright © 2025 David Maple / kodegen.ai