About SpecR
SpecR is an MCP server published by wrzonance in the Maps category: a system for construction document specification automation with round-trip DOCX support.
The repository has 1 stars and 0 forks, with the last commit 5 days ago. Recent commit activity is the strongest signal that reported issues will get attention.
Install
git clone https://github.com/wrzonance/SpecRThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Tools (16)
coordination_reportProject errors-and-omissions report
Parameters not published.
generate_docxGenerate DOCX from a stored spec
Parameters not published.
get_numbering_profileRead a spec's effective structural numbering profile
Parameters not published.
get_onboarding_reportSpec onboarding report (editability summary, style source, status)
Parameters not published.
get_paragraphOne paragraph with its ancestor chain
Parameters not published.
get_specFull spec tree + reference resolution + style/onboarding status
Parameters not published.
get_spec_diff3-way merge diff for a returned DOCX
Parameters not published.
get_spec_lineageChain of custody for a spec (ADR-015)
Parameters not published.
list_sectionsList CSI sections with an `inDatabase` flag
Parameters not published.
load_filesBulk-load specs by glob or paths
Parameters not published.
Show all 16 tools
open_comments_reportOpen (unclosed) Word comments in a spec or project
Parameters not published.
parse_documentParse and store a base64 DOCX/SEC/TXT/PDF
Parameters not published.
reclassify_specRe-run classification; returns the before/after diff
Parameters not published.
review_editabilityPer-paragraph editability + confidence + evidence (low-confidence filter)
Parameters not published.
search_libraryFull-text search the paragraph library
Parameters not published.
submittal_registerProduct-driven submittal register for selected specs
Parameters not published.
Ask AI
Ask AI about SpecR
Powered by Claude · Grounded in docs
Security checks
Static checks derived from the repository 4 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository ships documentation.
- ✓License declaredUsable under a stated license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedA lockfile pins dependency versions.
- ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
1 check has not been run yet.
README
SpecR
Headless REST API for CSI MasterFormat-compatible specification automation.
SpecR parses specification documents into a canonical CSI AST (Abstract Syntax Tree: a structured, tree-shaped model of the document's content and hierarchy, independent of any file format), stores the result in PostgreSQL, and renders the same structure back to DOCX, Markdown, JSON, and SpecsIntact .SEC.
SpecR is an independent project and is not affiliated with CSI.
What It Does
SpecR treats specifications as structured data rather than opaque Word files.
The core workflow is:
- Upload a
.docx,.SEC,.txt, or.pdfspec. - Parse it into a parent/child CSI paragraph tree.
- Store the canonical AST and paragraph lineage in PostgreSQL.
- Generate DOCX or
.SECoutput from the AST. - Diff and merge reviewer-edited DOCX files back into the database by UUID content-control anchors.
The current backend is API-first. Browser UI, authentication, and full Revit sync workflows are still roadmap items.
Analytical outputs: coordination report, submittal register, spec diff, and reference sets are computed by deterministic endpoints over that structured AST and surfaced to agents through a first-class MCP contract, not generated by a language model summarizing retrieved text. See Deterministic-First: Grounded Data, Not RAG.
Included Today
- DOCX parser with 5-signal hierarchy inference, inference-conflict surfacing, source-fact capture, hidden/
vanishcontent retention (excluded from structural inference, not discarded), and ARCAT/CPI/LibreOffice fixture coverage. - UFGS SpecsIntact
.SECparser and.SECoutput renderer. - Plaintext
.txtparser for read-only ingest. - PDF parser: text-layer extraction with a
pdfjs-distfallback, automatic OCR (tesseract.js) for scanned pages, and font-encoding recovery, feeding the same text-based inference path with graceful degradation warnings. - PostgreSQL-backed specs, paragraphs, versions, projects, libraries, design packages, package revisions, style templates, conventions, locks, and lineage.
- DOCX generator with CSI multilevel numbering (seven CSI tiers), content-control UUID anchors, style-template application, multi-section manual assembly, cover page, and TOC field support.
- Immutable package revisions with revision/addendum manual rendering (
POST /revisions/{id}/generate) and project-scoped revision-nomenclature profiles. - Diff and merge endpoints for round-trip reviewer redlines.
- Document concurrency: optimistic paragraph writes, advisory spec locks, and a review/active lifecycle state.
- Project coordination / errors-&-omissions report: required-vs-present sections, dangling references, Related-Sections/References article-body consistency, umbrella↔subordinate call-outs, implied related sections, and a product-driven submittal register.
- Onboarding pipeline: async library-master import, per-paragraph editability classification with human overrides, reclassify, finalize/reopen, comment closure + open-comments reporting, and structural numbering profiles.
- Style-template CRUD, DOCX template import, convention profile CRUD, and spec/project soft-delete (withdraw) with restore.
- MCP Streamable HTTP server (
POST /mcp) with read-oriented tools/resources — stateless per request by default; aninitializecall can mint a stateful session (server-issuedmcp-session-id) that later requests reuse andDELETE /mcpterminates. - Revit add-in scaffold (one build per Revit runtime: 2024 / 2025–2026 / 2027) with a typed REST client and health-check ribbon command.
See ROADMAP.md for the fuller capability inventory and planned work.
API Surface
The canonical contract is openapi.yaml, CI-enforced by a route↔spec coverage gate. It is rendered as a live Scalar reference at GET /docs and served raw at GET /openapi.yaml. Key groups:
- Parsing:
POST /parse(.docx/.SEC/.txt/.pdf, optional numbering profile),GET /parse/jobs/{jobId} - Specs:
GET/PATCH/DELETE /specs/{id}(soft-withdraw) +restore, paragraph updates, editability overrides, reversible paragraph removal, reclassify, finalize/reopen, external-content associations, lineage, style-source, numbering-profile assignment, and advisory locks - Generation:
POST /specs/{id}/generate,POST /projects/{id}/generate,POST /revisions/{id}/generate(issued/addendum manuals) - Round trip:
POST /specs/{id}/diff,POST /specs/{id}/merge - Projects: list/create, rename + settings, soft-delete + restore, sources, TOC, references (broken/inbound), division general-spec
- Coordination: required-sections (project + package),
GET /projects/{id}/coordination-report,POST /projects/{id}/submittal-register, open-comments - Libraries: list, client-tier create, rename, specs, async master import, convention profiles, numbering profiles
- Packages and revisions: design packages, immutable revision snapshots, and revision-nomenclature profiles
- Templates and conventions: style templates, DOCX template import, convention profiles
- MCP:
POST /mcp
MCP tools
The Streamable HTTP server at POST /mcp exposes these tools (all stateless, reading or correcting via db/index.js queries, rate-limited by the shared /mcp limiter):
| Tool | Purpose |
|---|---|
search_library |
Full-text search the paragraph library |
list_sections |
List CSI sections with an inDatabase flag |
get_spec |
Full spec tree + reference resolution + style/onboarding status |
get_paragraph |
One paragraph with its ancestor chain |
get_spec_lineage |
Chain of custody for a spec (ADR-015) |
get_spec_diff |
3-way merge diff for a returned DOCX |
get_numbering_profile |
Read a spec's effective structural numbering profile |
parse_document |
Parse and store a base64 DOCX/SEC/TXT/PDF |
generate_docx |
Generate DOCX from a stored spec |
load_files |
Bulk-load specs by glob or paths |
list_projects / get_references |
Project list and per-section cross-references |
coordination_report |
Project errors-and-omissions report |
submittal_register |
Product-driven submittal register for selected specs |
open_comments_report |
Open (unclosed) Word comments in a spec or project |
review_editability |
Per-paragraph editability + confidence + evidence (low-confidence filter) |
get_onboarding_report |
Spec onboarding report (editability summary, style source, status) |
set_editability_override / clear_editability_override |
Apply or remove a human editability override |
reclassify_spec |
Re-run classification; returns the before/after diff |
Quick Start
Requires Node 24 LTS — pinned via .nvmrc, and pnpm install fails on anything else. See
CONTRIBUTING → Node version for per-version-manager setup.
Switch to Node 24 with your version manager first — see the table linked above for the exact
command (nvm use, fnm use, asdf install nodejs, or mise install).
pnpm install
docker compose up -d postgres
pnpm migrate
pnpm seed
pnpm dev
The API starts on the port configured by .env (see .env.example).
Useful commands:
pnpm test
pnpm test:integration
pnpm lint
pnpm build
pnpm load:files 'docs/references/UFGS/**/*.SEC'
Development workflow, testing rules, and local Postgres notes live in CONTRIBUTING.md.
Deployment & security
The API is unauthenticated until auth lands (#43): both the REST surface and the write-capable MCP tools accept any request, and the server binds all interfaces. Keep it behind a trusted network (localhost, a private LAN, or a VPN) — do not expose it to the public internet. At startup SpecR logs a warn restating this whenever no authentication is configured; the warning goes silent automatically once #43 adds real auth.
Architecture
The full design is in ARCHITECTURE.md. The short version:
src/ast/owns the canonical CSI AST and schemas.src/parser/converts DOCX,.SEC, and.txtinto the AST.src/generator/renders AST output to DOCX, Markdown, and.SEC.src/merge/performs UUID-anchored 3-way diff and merge.src/db/owns migrations and persistence queries.src/api/exposes REST routes.src/mcp/exposes MCP tools and resources.revit-addin/contains the separate C#/.NET Revit add-in scaffold.
Module boundaries are intentionally strict: import sibling modules through their index.ts barrels, not internal files.
Example Client
examples/web_ui_demo/ is a standalone reference web client for the REST API, a static front end plus a small proxy server. It lives under examples/ on purpose: it may drift as the API evolves and must never require backend changes. See examples/web_ui_demo/README.md to run it, including Windows/corporate-proxy launch helpers.
Reference Data
docs/references/UFGS/contains public-domain UFGS.SECseed data.docs/references/ARCAT/README.mdanddocs/references/MANUFACTURER_CPI/README.mddescribe fixture acquisition for copyrighted vendor samples that are not stored in this repository.
Gold-corpus regression gate (local, maintainer-only)
The .docx reference corpus is gitignored, so its inference safety nets skip in CI.
gold:verify is a local binary veto against a maintainer-blessed baseline
(gold/expectations.json, committed — fingerprints are facts, the docs are not):
pnpm gold:verify # before merging any inference change — non-zero exit on drift
pnpm gold:bless # after confirming parses in the web UI — bless the whole corpus
pnpm gold:bless 'docs/references/ARCAT/**/*.docx' # bless one vendor/section
Bless loop: open a spec in the demo → confirm the parse is correct → gold:bless <glob>.
Only blessed files gate; an un-blessed file is reported, not failed. See ADR-057.
License
README fetched from the repository 4 days ago. The original is authoritative.