Chain of Draft Server

Chain of Draft Server

Chain of Draft Server is a powerful AI-driven tool that helps developers make better decisions through systematic, iterative refinement of thoughts and designs. It integrates seamlessly with popular AI agents and provides a structured approach to reasoning, API design, architecture decisions, code r

bsmi021

Remote Shell Execution
Advanced AI Reasoning
AI Integration Systems
Visit Server

Tools

chain-of-draft

# Chain of Draft (CoD): Systematic Reasoning Tool ⚠️ REQUIRED PARAMETERS - ALL MUST BE PROVIDED: 1. reasoning_chain: string[] - At least one reasoning step 2. next_step_needed: boolean - Whether another iteration is needed 3. draft_number: number - Current draft number (≥ 1) 4. total_drafts: number - Total planned drafts (≥ draft_number) Optional parameters only required based on context: - is_critique?: boolean - If true, critique_focus is required - critique_focus?: string - Required when is_critique=true - revision_instructions?: string - Recommended for revision steps - step_to_review?: number - Specific step index to review - is_final_draft?: boolean - Marks final iteration ## Purpose: Enhances problem-solving through structured, iterative critique and revision. Chain of Draft is an advanced reasoning tool that enhances problem-solving through structured, iterative critique and revision. Unlike traditional reasoning approaches, CoD mimics the human drafting process to improve clarity, accuracy, and robustness of conclusions. ## When to Use This Tool: - **Complex Problem-Solving:** Tasks requiring detailed, multi-step analysis with high accuracy demands - **Critical Reasoning:** Problems where logical flow and consistency are essential - **Error-Prone Scenarios:** Questions where initial reasoning might contain mistakes or oversight - **Multi-Perspective Analysis:** Cases benefiting from examining a problem from different angles - **Self-Correction Needs:** When validation and refinement of initial thoughts are crucial - **Detailed Solutions:** Tasks requiring comprehensive explanations with supporting evidence - **Mathematical or Logical Puzzles:** Problems with potential for calculation errors or logical gaps - **Nuanced Analysis:** Situations with subtle distinctions that might be missed in a single pass ## Key Capabilities: - **Iterative Improvement:** Systematically refines reasoning through multiple drafts - **Self-Critique:** Critically examines previous reasoning to identify flaws and opportunities - **Focused Revision:** Targets specific aspects of reasoning in each iteration - **Perspective Flexibility:** Can adopt different analytical viewpoints during critique - **Progressive Refinement:** Builds toward optimal solutions through controlled iterations - **Context Preservation:** Maintains understanding across multiple drafts and revisions - **Adaptable Depth:** Adjusts the number of iterations based on problem complexity - **Targeted Improvements:** Addresses specific weaknesses in each revision cycle ## Parameters Explained: - **reasoning_chain:** Array of strings representing your current reasoning steps. Each element should contain a clear, complete thought that contributes to the overall analysis. - **next_step_needed:** Boolean flag indicating whether additional critique or revision is required. Set to true until the final, refined reasoning chain is complete. - **draft_number:** Integer tracking the current iteration (starting from 1). Increments with each critique or revision. - **total_drafts:** Estimated number of drafts needed for completion. This can be adjusted as the solution evolves. - **is_critique:** Boolean indicating the current mode: * true = Evaluating previous reasoning * false = Implementing revisions - **critique_focus:** (Required when is_critique=true) Specific aspect being evaluated, such as: * "logical_consistency": Checking for contradictions or flaws in reasoning * "factual_accuracy": Verifying correctness of facts and calculations * "completeness": Ensuring all relevant aspects are considered * "clarity": Evaluating how understandable the reasoning is * "relevance": Assessing if reasoning directly addresses the problem - **revision_instructions:** (Required when is_critique=false) Detailed guidance for improving the reasoning based on the preceding critique. - **step_to_review:** (Optional) Zero-based index of the specific reasoning step being critiqued or revised. When omitted, applies to the entire chain. - **is_final_draft:** (Optional) Boolean indicating whether this is the final iteration of reasoning. ## Best Practice Workflow: 1. **Start with Initial Draft:** Begin with your first-pass reasoning and set a reasonable total_drafts (typically 3-5). 2. **Alternate Critique and Revision:** Use is_critique=true to evaluate reasoning, then is_critique=false to implement improvements. 3. **Focus Each Critique:** Choose a specific critique_focus for each evaluation cycle rather than attempting to address everything at once. 4. **Provide Detailed Revision Guidance:** Include specific, actionable revision_instructions based on each critique. 5. **Target Specific Steps When Needed:** Use step_to_review to focus on particular reasoning steps that need improvement. 6. **Adjust Total Drafts As Needed:** Modify total_drafts based on problem complexity and progress. 7. **Mark Completion Appropriately:** Set next_step_needed=false only when the reasoning chain is complete and satisfactory. 8. **Aim for Progressive Improvement:** Each iteration should measurably improve the reasoning quality. ## Example Application: - **Initial Draft:** First-pass reasoning about a complex problem - **Critique #1:** Focus on logical consistency and identify contradictions - **Revision #1:** Address logical flaws found in the critique - **Critique #2:** Focus on completeness and identify missing considerations - **Revision #2:** Incorporate overlooked aspects and strengthen reasoning - **Final Critique:** Holistic review of clarity and relevance - **Final Revision:** Refine presentation and ensure direct addressing of the problem Chain of Draft is particularly effective when complex reasoning must be broken down into clear steps, analyzed from multiple perspectives, and refined through systematic critique. By mimicking the human drafting process, it produces more robust and accurate reasoning than single-pass approaches.

README

MCP Chain of Draft Server 🧠

Chain of Draft Server is a powerful AI-driven tool that helps developers make better decisions through systematic, iterative refinement of thoughts and designs. It integrates seamlessly with popular AI agents and provides a structured approach to reasoning, API design, architecture decisions, code reviews, and implementation planning.

🌟 Features

Core Capabilities

  • Iterative Reasoning: Systematic improvement through the Chain of Draft protocol
  • Thought History: Track and manage reasoning iterations
  • Branching Support: Focus reviews on specific reasoning steps
  • TypeScript Support: Full TypeScript implementation with Zod validation
  • Error Handling: Comprehensive error types and handling
  • Real-time Logging: Built-in debugging and monitoring system

🚀 Getting Started

Prerequisites

  • Node.js >= 16.0.0
  • npm >= 8.0.0

Installation

  1. Clone the repository:
git clone https://github.com/bsmi021/mcp-chain-of-draft-server.git
cd mcp-chain-of-draft-server
  1. Install dependencies:
npm install

Configuration

Simple server configuration in initialize.ts:

const serverConfig = {
    name: "chain-of-draft",
    version: "1.0.0",
}

💡 Usage Examples

Chain of Draft Protocol

const thoughtData = {
    reasoning_chain: ["Initial analysis of the problem"],
    next_step_needed: true,
    draft_number: 1,
    total_drafts: 3,
    is_critique: true,
    critique_focus: "logical_consistency"
};

🛠️ Development

Project Structure

src/
├── tools/                          # Specialized Tools
│   ├── chainOfDraft/              # Core Protocol
│   └── index.ts / # Entry Point
├── utils/                         # Utilities
└── index.ts                      # Entry Point

Starting Development Server

npm run dev

❓ FAQ

How does the Chain of Draft protocol work?

The protocol guides you through systematic improvement of your thinking through iterative drafts and focused critiques.

Can I customize the critique dimensions?

Yes! Each tool supports custom critique focuses tailored to your specific needs.

How many drafts should I plan for?

We recommend 3-5 drafts for most tasks, but you can adjust based on complexity.

🤝 Contributing

We welcome contributions! Please check our Contributing Guidelines.

👥 Community & Support

  • GitHub Issues - Report bugs or suggest features
  • Pull Requests - Submit your contributions
  • Documentation - Check our detailed docs

📝 License

MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Thanks to our contributors and early adopters
  • Special thanks to the MCP community
  • Inspired by systematic reasoning methodologies

Made with 🧠 by @bsmi021

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
AIO-MCP Server

AIO-MCP Server

🚀 All-in-one MCP server with AI search, RAG, and multi-service integrations (GitLab/Jira/Confluence/YouTube) for AI-enhanced development workflows. Folk from

Featured
Local
React MCP

React MCP

react-mcp integrates with Claude Desktop, enabling the creation and modification of React apps based on user prompts

Featured
Local
Atlassian Integration

Atlassian Integration

Model Context Protocol (MCP) server for Atlassian Cloud products (Confluence and Jira). This integration is designed specifically for Atlassian Cloud instances and does not support Atlassian Server or Data Center deployments.

Featured
Any OpenAI Compatible API Integrations

Any OpenAI Compatible API Integrations

Integrate Claude with Any OpenAI SDK Compatible Chat Completion API - OpenAI, Perplexity, Groq, xAI, PyroPrompts and more.

Featured
Exa MCP

Exa MCP

A Model Context Protocol server that enables AI assistants like Claude to perform real-time web searches using the Exa AI Search API in a safe and controlled manner.

Featured
MySQL Server

MySQL Server

Allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.

Featured