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.
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:
-
Clone the repository: git clone https://github.com/bsmi021/mcp-chain-of-draft-server.git cd mcp-chain-of-draft-server
-
Install dependencies: npm install
-
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
-
Run the server: npm run dev
or if you have a production script:
npm start
-
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
easy
Absurdly easy Model Context Protocol Servers in Typescript
git
An MCP (Model Context Protocol) server enabling LLMs and AI agents to interact with Git repositories. Provides tools for comprehensive Git operations including clone, commit, branch, diff, log, status, push, pull, merge, rebase, worktree, tag management, and more, via the MCP standard. STDIO & HTTP.
mcp-ts-template
TypeScript template for building Model Context Protocol (MCP) servers. Ships with declarative tools/resources, pluggable auth, multi-backend storage, OpenTelemetry observability, and first-class support for both local and edge (Cloudflare Workers) runtimes.
MediaWiki
Model Context Protocol (MCP) Server to connect your AI with any MediaWiki
filesystem
A Model Context Protocol (MCP) server for platform-agnostic file capabilities, including advanced search/replace and directory tree traversal
mcp-claude-spotify
An integration that allows Claude Desktop to interact with Spotify using the Model Context Protocol (MCP).