How to write a book from your AI agent with MCP
A step-by-step flow for writing a book from Claude, Cursor, ChatGPT, or Codex using EBookBrew's hosted MCP server, with two human checkpoints.
You can write a book from your AI agent by connecting EBookBrew's hosted MCP server, then working through a short flow: create a project, approve the outline, write chapters, check the claims list, add a cover, and export. You stay in the conversation the whole time, and you approve the key steps.
Before you start
You need an MCP client such as Claude, Cursor, ChatGPT, or Codex, plus an EBookBrew account. The hosted server is at https://mcp.ebookbrew.com/mcp and has 27 tools.
Your agent uses the same outline approval, chapter controls, and export tools as the web app. The book process stays the same. You just work from one place.
Have a book concept ready: a topic, rough notes, or a method you want to turn into a guide.
Free accounts can write and preview a book in the app but can't download it. Open the app to see what you need for generation and downloads.
Step 1: Connect the server
- In Claude, run this command:
claude mcp add --transport http ebookbrew https://mcp.ebookbrew.com/mcp
- In Codex, run this command:
codex mcp add ebookbrew --url https://mcp.ebookbrew.com/mcp
- In Cursor, ChatGPT, or another MCP client, connect to the server URL https://mcp.ebookbrew.com/mcp.
If your client doesn't support remote MCP servers, run npx ebookbrew-mcp login once. Then configure npx -y ebookbrew-mcp as a local server.
Step 2: Create the project from your concept
Tell your agent the book idea. It saves the concept as a new EBookBrew project. Only the concept is saved at this point, so no outline exists yet.
Every change needs an idempotency key, which makes retries safe. Reuse a key only for the same attempted action.
Open the app to see what each generation step needs before you run it.
Step 3: Generate and approve the outline
Ask the agent to generate the brief. You get title options, a chapter plan, and a writing brief.
Checkpoint 1 is outline approval. Read the plan yourself and ask for changes before you approve. Approve only when you accept the title and chapter plan. Approval creates the chapter records and opens chapter writing.
You control the book, not just the prompt, and this is where you shape it.
Step 4: Write chapters
You have two ways to write.
- One chapter at a time: ask for a specific chapter. The agent writes one chapter per call and shouldn't loop unless you request a chapter range.
- The whole book: ask for all chapters. The server writes pending and failed chapters in order.
For a full run, the agent polls get_project. The chain has finished when project.writeAll.active is false.
Read each chapter as it lands. Chapters are written with earlier ones in view, so the book reads coherently.
Step 5: Check the claims list
Each chapter has a claims list of statements the model couldn't verify: figures, studies, quotes, dates, and rules.
Checkpoint 2 is the claims review. Have your agent show you every item, and check each one against a real source before you publish. Fix or cut anything you can't confirm.
Step 6: Add a cover and export
- Ask the agent to make a cover. Cover artwork is made at KDP's 1600 × 2560 ebook size.
- Export as PDF, EPUB, or DOCX. Exports are aimed at Amazon KDP, Apple Books, Etsy, and Gumroad, or your own site.
Open the app to see what you need to unlock downloads. Coloring books export as a print PDF only.
If you publish on KDP, our AI disclosure guide explains how to answer its AI-generated content question.