How to add pdf2takeoff to your agent

  1. Install Node. Install Node.js 22.13 or later. Nothing else needs installing: npx runs pdf2takeoff straight from GitHub.
  2. Add the MCP server. In Claude Code, run claude mcp add pdf2takeoff -- npx -y github:ajflow/pdf2takeoff mcp, or add the same command to the MCP settings of Cursor, Claude Desktop or another client.
  3. Ask for a takeoff. Give the agent a local drawing and the job, for example: open plan.pdf, read the scale, fill each room and count the downlights.
  4. Review the marked-up PDF. The agent saves an annotated PDF. Open it in pdf2takeoff, Bluebeam Revu or Acrobat, confirm or delete the flagged items, then export.
# add it to Claude Code
claude mcp add pdf2takeoff -- npx -y github:ajflow/pdf2takeoff mcp

For Cursor, Claude Desktop and other clients, add this to the MCP settings:

{
  "mcpServers": {
    "pdf2takeoff": {
      "command": "npx",
      "args": ["-y", "github:ajflow/pdf2takeoff", "mcp"]
    }
  }
}

What can the agent do with the 15 tools?

  • Open and look: open_document opens a PDF, image or DXF (a DXF arrives with its scale set, reported as drawingScale); render_page returns a PNG of any sheet; read_text returns printed scales, dimensions and labels exactly, with positions, so the agent never guesses them off the image.
  • Scale and measure: set_scale from a ratio, a known dimension or the sheet itself; measure for lengths, areas, perimeters, volumes, angles and counts; fill_area for a room's area from one point inside it.
  • Count: scan_symbol counts every match of one symbol; propose_items adds doors, windows and spaces as flagged markups; count_items totals them under a counting preset such as aecv or schedule.
  • Compare: compare_revisions for two drawings or two folders of revisions.
  • Review and hand back: list_markups, set_status and delete_markup; export writes CSV, TSV or Excel; save_annotated writes the marked-up PDF.

How do I run it from the command line?

The same engine runs as a command line tool, straight from GitHub with nothing installed:

# count every match of the symbol at a point, in PDF points
npx github:ajflow/pdf2takeoff scan plan.pdf --page 1 --at 88,271
# the PDF's quantities as an Excel workbook
npx github:ajflow/pdf2takeoff export plan.pdf --format xlsx -o takeoff.xlsx

Other commands include info (page sizes, so you can place --at), compare for two files or two revision folders, annotate, ocr, ai-count and run, which regenerates a takeoff from a committed takeoff.yaml and, with --prev, shows which quantities changed since the last revision.

Why does a person still review the result?

AI models cannot yet count a floor plan reliably on their own: the best published model gets 54.3% of counts exactly right on AECV-Bench. So the server is built for review. Proposed doors, windows and spaces land as count markups flagged check, quantities come from count_items under your counting rules rather than the model's own tally, and the output is a PDF that a person opens, checks and confirms.

Does anything leave my machine?

The server is a local process working on local files, and pdf2takeoff uploads nothing. It makes two network calls: the OCR language pack on first use (a few MB, then cached), and ai-count, which sends the page you choose to the provider you choose, only when you run it. The agent you connect is a separate matter: it sends what it reads, such as rendered pages, to its own model provider, as any agent does.

FAQ

How do I install pdf2takeoff?

Run it straight from GitHub with npx github:ajflow/pdf2takeoff, or register the MCP server with npx -y github:ajflow/pdf2takeoff mcp. It is not published to the npm registry, so always include the github:ajflow/ prefix.

Which AI clients work with it?

Any MCP client that runs a local stdio server, including Claude Code, Claude Desktop, Cursor and Codex.

Does the MCP server need an API key?

No. The agent you already use does the reading and reasoning. Only the optional ai-count command needs a key for the provider you choose, read from an environment variable, and a local model through Ollama or LM Studio needs none.

Can the agent open DXF files and images?

Yes. open_document accepts PDFs, images and ASCII DXF files. A DXF arrives with its scale already set, and open_document reports it as drawingScale.

What Node version does it need?

Node.js 22.13 or later.

Is it free?

Yes. The CLI and MCP server are free and open source under Apache-2.0, built on the same engine as the browser app.

Give your agent a drawing

Add the server with one command, or open the browser app to see the same engine at work on the sample drawing.

Related guides