specir-mcp
This server provides a structured query interface for technical specification documents, enabling exact entity resolution, data fetching with graph context, explanations, searches, and status reports.
specir_resolve: Resolve an exact domain entity (command, section, table, figure, etc.) by kind and ID, optionally constrained to a specific spec.
specir_fetch: Fetch a full entity record by its canonical UID, with an option to include graph edges (cross-references) to related entities; profile filtering options (e.g., test_points, generic) may be available.
specir_explain: Combine a named entity with its defining section to understand its context and purpose.
specir_search: Search for structured entities or raw passages using a query string, supporting hybrid, entity, or passage modes, with customizable result limits and spec filtering.
specir_status: Report the current state of loaded plugins and database coverage metadata.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@specir-mcp search for telemetry in acme-device spec"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
specir-mcp
specir-mcp is a data-neutral framework for turning technical documents into
a structured intermediate representation (SpecIR) and querying it through six
stable MCP tools.
The repository contains no standards PDFs, extracted specification text, knowledge-base databases, model weights, or vendor-specific protocol tables. All bundled demo content is fictional.
Features
Document, section, table, figure, entity, passage, provenance, and edge IR.
Extensible domain plugin manifests with dependency-aware loading.
PDF outline-based section extraction and reusable structure parsers.
Multi-engine PDF table candidates with deterministic arbitration, geometry, non-table rejection, cross-page matching, and auditable review decisions.
SQLite-backed exact lookup, fetch, explanation, search, and status APIs.
A six-tool FastMCP surface:
specir_resolve,specir_fetch,specir_explain,specir_search,specir_status, andspecir_validate.Product-ranked
related_entitiesplus evidence-completexrefs_raw.Data-neutral typed edges for definitions, listings, field membership, and named status mentions.
Explicit coverage metadata so missing extraction is not confused with absence from a source document.
Related MCP server: knowledge-mcp
Quick start
python -m venv .venv
. .venv/bin/activate
pip install -e ".[test]"
# Generate a small database from the fictional Acme Device Interface fixture.
specir-demo --output data/demo.db
export SPEC_IR_DB="$PWD/data/demo.db"
specir-mcp-serverThe same server may be launched from a source checkout:
fastmcp run src/specir/query/server.pyExample MCP calls:
specir_resolve(kind="command", id="A1h", spec="acme-device")
specir_fetch(uid="acme-device:2.1", include_xrefs=true,
xref_profile="test_points")
specir_explain(name="Read Telemetry", kind="command", spec="acme-device")
specir_search(query="telemetry", spec="acme-device")
specir_status()
specir_validate(mode="summary")test_points is the default fetch profile: weak or boilerplate edges remain
auditable under xrefs_raw.suppressed_references but do not enter the ranked
related_entities list. Request xref_profile="generic" for an unfiltered
debug view.
When a database contains one document, spec="auto" selects it. With multiple
documents, exact lookups return candidates and request an explicit spec.
Using your own data
Create a database with specir.query.schema.create_database, then insert
documents and entities using the schema documented by the Python dataclasses.
Set SPEC_IR_DB to that database before starting the server. The framework
never downloads or bundles source documents.
The optional PDF extractor can build coordinate-clipped section records:
from specir.extractors.pdf import build_section_tree
sections = build_section_tree("my-spec", "path/to/your-document.pdf")You are responsible for having permission to process and store the documents you supply.
Optional table extraction
Install only the engines you need. PyMuPDF is included in the core package; the other engines are optional and unavailable engines are skipped safely.
pip install -e ".[tables]" # pdfplumber
pip install -e ".[table-camelot]" # Camelot; may need system libraries
pip install -e ".[table-docling]" # neural candidate adapterfrom specir.extractors import arbitrate_candidates, generate_candidates
candidates = generate_candidates(
"path/to/your-document.pdf",
pages=[10, 11],
engines=("pymupdf", "pdfplumber"),
)
results = arbitrate_candidates(candidates)Every candidate retains its engine, strategy, bounding box, cell geometry,
quality metrics, and deterministic ID. Arbitration never treats the first
engine result as authoritative. It reports TRUSTED_AUTOMATIC,
NEEDS_REVIEW, CONFLICTING_CANDIDATES, or REJECTED_NON_TABLE and preserves
alternatives as evidence.
table_continuations.assess_continuation scores adjacent-page fragments and
keeps disagreements in a review state. recover_outer_fragment repairs nested
fragments only when the smallest enclosing candidate passes semantic,
geometric, caption-boundary, and unrelated-table checks. Neural extraction is
configured with explicit DoclingTableProfile values; no document names or
vendor rules are built into the framework.
Use build_review_queue and apply_review_decisions to bind a human decision
to the exact candidate state. Stale decisions, duplicate decisions, and
unknown replacement candidates fail closed.
Development
pytest
python -m buildThe tests create temporary synthetic databases and do not require external specifications or network access.
License
Apache License 2.0. See LICENSE.
Available Tools
5 toolsspecir_explainD
Combine a named entity with its defining section.
Inputs: name (required), kind, spec. Returns: result
specir_fetchB
Fetch an entity by canonical UID, optionally with graph edges.
Inputs: uid (required), include_xrefs. Returns: result
specir_resolveC
Resolve an exact domain entity, section, table, or figure.
Inputs: id (required), kind (required), spec. Returns: result
specir_searchC
Search structured entities or raw passages.
Inputs: query (required), mode, spec, limit. Returns: result
specir_statusB
Report plugin state and database coverage.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct primary purpose: resolve by name, fetch by UID, explain with context, search broadly, and status for system info. Resolve and fetch are similar but differentiated by input type (name vs UID), while explain is a composite of entity and section.
All tools follow a consistent specir_ prefix followed by a clear action verb (resolve, fetch, explain, search, status). The pattern is uniform and predictable, making it easy to infer tool behavior from name alone.
Five tools is ideal for a focused specification entity retrieval service. Each tool covers a distinct interaction mode without redundancy, and the count is well within the typical range for a useful MCP server.
The tool set covers the core needs for querying a spec database: search, targeted retrieval by name or UID, contextual explanation, and system status. No obvious lifecycle operations are missing because the domain is read-only retrieval, and the provided methods form a complete workflow.
Maintenance
Related MCP Connectors
SpecProof: Search standards specs with MCP-ready precision.
Auditable MCP server for PubMed, Europe PMC, ClinicalTrials.gov, and bioRxiv/medRxiv queries
Entity-resolved NIH grant corpus (FY1985-2026) via 14 read-only, provenance-carrying MCP tools.
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI agents to search, discover, and retrieve technical specifications from a SpecLib instance. It provides tools for full-text search, scope listing, and reading specs as markdown content.-
- AlicenseAqualityDmaintenanceVendor-neutral MCP server for knowledge retrieval across repositories, offering stable tools for searching, getting, and listing documents with hybrid lexical and optional semantic search.3MIT
- AlicenseBqualityBmaintenanceEnables provenance-first scholarly retrieval, paper ingestion, and reproducible research workflows by searching academic and developer sources, extracting source-located facts and claims, and preserving evidence and provider uncertainty for MCP clients.371Apache 2.0
- AlicenseBqualityCmaintenanceEnables biomedical research workflows via MCP, including experiment and document search, PDF text extraction, evidence retrieval, and validation with provenance tracking.10MIT