An MCP server for construction takeoff
pdf2takeoff runs as an MCP server and a command line tool, so AI agents such as Claude, Cursor and Codex, or any MCP client, can run a construction takeoff on your machine and hand back a marked-up PDF for a person to review. It has 15 tools, needs Node 22.13 or later, and adds to Claude Code with one command.
How to add pdf2takeoff to your agent
- Install Node. Install Node.js 22.13 or later. Nothing else needs installing: npx runs pdf2takeoff straight from GitHub.
- 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.
- 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.
- 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.
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_documentopens a PDF, image or DXF (a DXF arrives with its scale set, reported asdrawingScale);render_pagereturns a PNG of any sheet;read_textreturns printed scales, dimensions and labels exactly, with positions, so the agent never guesses them off the image. - Scale and measure:
set_scalefrom a ratio, a known dimension or the sheet itself;measurefor lengths, areas, perimeters, volumes, angles and counts;fill_areafor a room's area from one point inside it. - Count:
scan_symbolcounts every match of one symbol;propose_itemsadds doors, windows and spaces as flagged markups;count_itemstotals them under a counting preset such asaecvorschedule. - Compare:
compare_revisionsfor two drawings or two folders of revisions. - Review and hand back:
list_markups,set_statusanddelete_markup;exportwrites CSV, TSV or Excel;save_annotatedwrites 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:
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
- pdf2takeoff accuracy benchmarks: every benchmark, weak results included.
- DXF takeoff without AutoCAD: open a DXF with its scale already set.
- Takeoff without uploading drawings: how your files stay on your own computer.
- pdf2takeoff home: free construction takeoff software that runs in your browser.