specir-mcp
Enables turning technical documents into a structured intermediate representation (SpecIR) and querying it via five MCP tools: specir_resolve, specir_fetch, specir_explain, specir_search, and specir_status. It provides a standardized way to extract, store, and retrieve document sections, tables, figures, entities, and provenance.
README
specir-mcp
specir-mcp is a data-neutral framework for turning technical documents into
a structured intermediate representation (SpecIR) and querying it through five
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.
- SQLite-backed exact lookup, fetch, explanation, search, and status APIs.
- A five-tool FastMCP surface:
specir_resolve,specir_fetch,specir_explain,specir_search, andspecir_status. - Explicit coverage metadata so missing extraction is not confused with absence from a source document.
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-server
The same server may be launched from a source checkout:
fastmcp run src/specir/query/server.py
Example MCP calls:
specir_resolve(kind="command", id="A1h", spec="acme-device")
specir_fetch(uid="acme-device:2.1", include_xrefs=true)
specir_explain(name="Read Telemetry", kind="command", spec="acme-device")
specir_search(query="telemetry", spec="acme-device")
specir_status()
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.
Development
pytest
python -m build
The tests create temporary synthetic databases and do not require external specifications or network access.
License
Apache License 2.0. See LICENSE.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.