# PE Civil: Structural Reference Locator — full documentation Base URL: https://pe-exam-env.vercel.app MCP endpoint: https://pe-exam-env.vercel.app/mcp (Streamable HTTP, stateless, MCP protocol 2025-06-18) REST: https://pe-exam-env.vercel.app/api/v1 (JSON, CORS *, OpenAPI 3.1 at /api/v1/openapi.json) Short index: https://pe-exam-env.vercel.app/llms.txt · Human docs: https://pe-exam-env.vercel.app/docs/ ## What it is A locator service over the exam-day reference library of the NCEES PE Civil: Structural exam. The exam is computer-based: the only references are on-screen PDFs, one chapter at a time, so the skill that matters is navigation — knowing which chapter PDF and page holds a provision, table or equation. This service gives an AI tutor (or any agent) that navigation memory: it turns a citation into the exact chapter file, PDF page number, printed page number and a snippet, and produces a link that opens the owner's exam simulator on that page with the term highlighted. It was built for the AI study coach of one candidate; the location layer is public so other tutors and agents can use it. ## Coverage (12 reference groups, 245 chapter PDFs, 10,077 pages) | id | standard | chapter PDFs | pages | |---|---|---|---| | ncees-handbook | NCEES PE Civil Reference Handbook | 7 | 502 | | aashto-lrfd-8 | AASHTO LRFD Bridge Design Specifications, 8th Ed. (2017) | 16 | 1,762 | | ibc-2018 | 2018 International Building Code | 50 | 757 | | asce-7-16 | ASCE/SEI 7-16 Minimum Design Loads (code + commentary) | 74 | 889 | | aci-318-14 | ACI 318-14 Building Code Requirements for Structural Concrete and Commentary | 31 | 524 | | aisc-manual-15 | AISC Steel Construction Manual, 15th Ed. (Part 16 = AISC 360-16 Specification) | 18 | 2,303 | | nds-2018 | AWC NDS 2018 with Commentary + 2018 Supplement | 2 | 292 | | sdpws-2015 | AWC SDPWS 2015 with Commentary | 1 | 56 | | osha-29-cfr | OSHA 29 CFR Part 1910 and Part 1926 (2020) | 2 | 1,778 | | pci-handbook-7 | PCI Design Handbook, 7th Ed. | 18 | 828 | | tms-402-16 | TMS 402/602-16 Masonry Code and Specification | 25 | 382 | | ncees-specs | NCEES PE Civil: Structural exam specification | 1 | 4 | Live catalog: GET /api/v1/standards. Aliases accepted inside citations: "ACI 318", "ACI", "ASCE 7", "ASCE/SEI 7-16", "AISC", "AISC 360-16", "AISC Manual", "NDS", "NDS Supp", "SDPWS", "TMS 402", "TMS 402/602", "IBC", "AASHTO", "AASHTO LRFD", "PCI", "OSHA", "29 CFR 1926", "NCEES Handbook", "Handbook". ## How a citation is resolved 1. The standard is recognised from its name/alias in the citation text (longest alias wins) or from the `standard` parameter. 2. The item type is read from the keyword: §/Section/Sec./Article → section; Table → table; Eq./Equation/(…) → equation; Fig./Figure → figure. With no keyword the service tries section, then equation, table and figure. 3. The number token is looked up in a heading index built from the page text of every chapter PDF: section headings ("22.2.2.4.1 Concrete stress of 0.85fc′…", "3.6.1.3.1—General", "E3. Flexural Buckling…", "§ 1926.501 Duty to have fall protection"), table and figure captions ("Table 21.2.2—Strength reduction factor ϕ…"), and equation definitions ("(12.8-1)", "(Eq. 5-1)"). Contents pages are recognised and demoted so the body heading wins; a chapter whose name carries the citation's leading number (Chapter 22, Section 3, Part 4; IBC 1604 → Chapter 16) is preferred. 4. If the exact heading is missing, the nearest parent section is returned (flagged `resolvedAs`), then pages that merely mention the number (`mentions`). Commentary twins (R22.2.2.4.1, C3.6.1.3.1) come back under `commentary`. 5. Every match carries `page.pdf` (1-based page inside that chapter file), `page.printed` (the number printed on the page, e.g. 348, 3-26, C-117, 16.1-33), `page.section` (first section heading on the page), a snippet starting at the heading, and two links: `links.open` (simulator deep link `/?ref=&page=N&q=`) and `links.pdf` (direct pdf.js viewer link). The simulator and the PDFs themselves require the owner's sign-in; the API does not. ## MCP tools - locate(citation, standard?, type?) — the core tool. Example: locate("ASCE 7-16 Table 12.6-1") → "FOUND asce-7-16 table 12.6-1 / 1. ASCE 7-16 table 12.6-1 → 12 Chapter 12 - Seismic Design Requirements for Building Structures · PDF p. 12/32 · printed p. 100 · open: https://pe-exam-env.vercel.app/?ref=…&page=12&q=12.6-1 · “Table 12.6-1 Permitted Analytical Procedures …”". - search_references(query, standard?, limit?) — ranked full-text search; use "quotes" for phrases. Heading matches rank higher; contents pages and commentary rank lower. - get_toc(standard, chapter?, maxDepth?) — section headings with PDF/printed page numbers. The navigation map. - list_standards() — catalog with chapter indices (needed by read_page). - list_exams(), get_exam(exam), get_question(exam, id) — practice questions with options, answer key and solutions. Solutions start with "Reference path:" lines that cite the standard locations used. - verify_citations(solution) — parses a solution's "Reference path:" block and reports, per cited location, whether it resolves to a real heading (with page numbers). Lines reading "Derived from mechanics" are accepted as non-code steps. - read_section(citation, standard?, maxChars?) and read_page(standard, chapter, page) — full text; require the owner's access key (Authorization: Bearer , or connect to /mcp/). Without the key they return an explanatory error and the public tools still work. - Prompt pe_tutor(topic?) — system guidance: always locate before citing, give chapter + PDF page + printed page + open link, teach navigation not memorisation, label non-code formulas "derived from mechanics", keep answers short. Connect: - Claude Code: claude mcp add --transport http pe-refs https://pe-exam-env.vercel.app/mcp - Any client: {"mcpServers":{"pe-references":{"type":"streamable-http","url":"https://pe-exam-env.vercel.app/mcp"}}} - Raw JSON-RPC: POST /mcp with headers Content-Type: application/json and Accept: application/json, text/event-stream; body {"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"locate","arguments":{"citation":"ACI 318-14 Table 21.2.2"}}}. GET /mcp returns a JSON description for humans. ## REST endpoints - GET /api/v1 — index (also says whether the request is unlocked). - GET /api/v1/openapi.json — OpenAPI 3.1. - GET /api/v1/standards — catalog; GET /api/v1/standards/{id} — one standard; GET /api/v1/standards/{id}/toc?chapter={index|number|name fragment} — headings with pages. - GET /api/v1/locate?cite=…&standard=&type=&token=&limit= — 200 when found or mentioned, 404 otherwise; body {found, query, matches[], commentary[], mentions[], resolvedAs?, error?}. - GET /api/v1/search?q=…&standard=&limit=(1-25) — {query, standard, total, results[]} where each result is a location with `score` and a snippet around the first hit. - GET /api/v1/section?cite=… and GET /api/v1/page?standard=&chapter=&page= — full text; 401 without the key, 403 when the deployment has no key configured. - GET /api/v1/exams, /api/v1/exams/{id}, /api/v1/exams/{id}/questions/{qid}, /api/v1/questions — question bank; question fields: exam, id, stem, image (absolute URL or null), options {A..D}, answer, solution, url. Math markup in text: _x subscript, ^x superscript, {a}/{b} fraction, *i* italic. - POST /api/v1/verify-citations {"solution": "Reference path:\n TMS 402-16 §8.3.5.1.1, Eq. 8-21 → …"} — {ok, startsWithReferencePath, checks:[{line, standard, type, token, ok, status: heading|parent-section|mention-only|missing, location}]}. - GET /api/v1/health — {ok, version, pages, exams}. - Every response sets Access-Control-Allow-Origin: * and JSON content type; OPTIONS preflight returns 204. ## Access policy and licensing The reference standards are copyrighted by their publishers (ACI, AISC, ASCE, ICC, AASHTO, AWC, TMS, PCI, NCEES; the CFR is a US Government work). This service publishes locations (chapter file name, page numbers, headings), short snippets for orientation, search rankings, and the owner's own practice questions. It does not publish the standards' full text: read_section / read_page / /section / /page require an access key held by the owner, and the PDFs and simulator require the owner's sign-in. Agents should cite the standard and location, not reproduce it. ## Operational notes - Hosted on Vercel; cold start ≈ 2 s (loads an 11 MB index of 10,077 pages), warm responses ≈ 0.3 s. - Source: https://github.com/gabe-kafka/pe-exam-env (private at the time of writing). Index built with pdftotext; heading detection in server/text-index.mjs; MCP + REST in server/backend.mjs. - Known gap: the AISC 360-16 Specification (Manual Part 16) has imperfect OCR, so some AISC equation numbers (e.g. E3-1) resolve only to the section, not the equation line. - Contact: via the GitHub repository.