Get the FREE Ultimate OpenClaw Setup Guide →

mcp-chain-of-draft

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio bsmi021-mcp-chain-of-draft-server node dist/index.js \
  --env PORT="3000" \
  --env LOG_LEVEL="info"

How to use

The MCP Chain of Draft Server provides an AI-assisted iterative reasoning workflow based on the Chain of Draft protocol. It exposes tools to manage thought iterations, track draft progress, and apply focused critiques to improve design, architecture, and implementation planning. The server is built with TypeScript, includes Zod validation for input/output, and offers real-time logging to help you monitor thought history and decision points. To use it, install and run the server, then interact with the mapped endpoints or CLI tools provided by the server to begin iterative drafting sessions, manage branches for specific reasoning steps, and review outputs across multiple drafts.

Once running, you can start a drafting session, push a draft iteration, and request critiques focused on dimensions such as logical consistency, architectural feasibility, or API design. The tools are organized under the chainOfDraft core protocol and are accessible via the server’s entry point. You can tailor critique focuses per task to drive targeted improvements, trace the thought history, and compare different branches of reasoning. The real-time logging helps you observe the flow of ideas as drafts are produced and refined.

How to install

Prerequisites:

  • Node.js v16 or newer
  • npm v8 or newer

Installation steps:

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

  2. Install dependencies: npm install

  3. Build or prepare for running (if the project uses a build step): npm run build

    or if no build step is defined, you can skip to running the dev/server

  4. Run the server: npm run dev

    or if you have a production script:

    npm start

  5. Verify server is running (default port 3000): curl http://localhost:3000/health

Notes:

  • If you customize environment variables, ensure they are set before starting the server.
  • The exact entry path may differ depending on your build setup; ensure dist/index.js (or the emitted entry) exists before starting the server.

Additional notes

Tips:

  • The server exposes the Chain of Draft protocol tooling; you can adjust critique dimensions per task to tailor iterative reviews.
  • Enable verbose logging in development to trace thought iterations and branch changes.
  • If you encounter type validation errors, verify inputs against the Zod schemas used by the tools in src/tools/chainOfDraft.
  • Common env vars include PORT, LOG_LEVEL, and any API keys required by connected AI services. Keep sensitive keys out of logs.
  • If you plan to run multiple sessions, consider creating separate draft branches to isolate iterations and critiques.

Related MCP Servers

Sponsor this space

Reach thousands of developers