Skip to main content
Glama

Schematic PDF to JSON

Precision-first conversion of vector PDF circuit schematics into an evidence-preserving SchematicIR JSON document. The project includes a Python conversion engine, command-line interface, MCP server, reusable Codex skill, and validation tools.

This project deliberately prefers missing uncertain content over emitting plausible but incorrect electrical information. A result marked needs_review must not be treated as a verified netlist.

Architecture

  1. PDF parsing — extracts native text, vector paths, styles, coordinates, source IDs, and evidence.

  2. Primitive recognition — identifies conservative wire, component, pin, junction, label, and network-flag candidates.

  3. Connectivity recovery — applies explicit endpoint, T-junction, junction marker, and evidence-backed named-net rules.

  4. JSON output — emits validated SchematicIR, unresolved issues, topology checks, and a deterministic hash.

Each conversion preserves all four stages as separate JSON artifacts.

Related MCP server: liteparse-mcp

One-click agent installation

Codex plugin:

codex plugin marketplace add ght123247/schematic-pdf-to-json --ref v0.2.0
codex plugin add schematic-pdf-to-json@schematic-pdf-tools

Start a new Codex task after installation. The bundled plugin installs its isolated Python runtime automatically on the first MCP connection.

Claude Desktop, Cursor, and Gemini CLI on Windows:

irm https://raw.githubusercontent.com/ght123247/schematic-pdf-to-json/v0.2.0/install.ps1 | iex

Claude Desktop, Cursor, and Gemini CLI on macOS/Linux:

curl -fsSL https://raw.githubusercontent.com/ght123247/schematic-pdf-to-json/v0.2.0/install.sh | sh

The installer creates an isolated runtime under ~/.schematic-pdf-to-json, preserves unrelated settings, backs up every changed config, performs a real MCP handshake, and prints the tools it found. Python 3.11 or newer is the only prerequisite.

See Agent installation for selecting one agent, custom allowed roots, upgrades, uninstalling, and manual configuration.

Development install

Python 3.11 or newer is required.

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e ".[test]"

Command line

schematic-pdf inspect "D:\path\drawing.pdf"
schematic-pdf convert "D:\path\drawing.pdf" --output output\artifacts
schematic-pdf validate "D:\path\schematic.final.json"

The conversion output contains:

job-.../
├── layer1/raw.json
├── layer2/semantic.json
├── layer3/connectivity.json
├── layer4/schematic.final.json
└── manifest.json

Altium Designer PDF support

For native vector PDFs exported by Altium Designer, the recognizer selects an Altium-specific profile automatically. It handles Altium's dark-blue wiring, blue symbol graphics, black pin stubs, red/yellow sheet ports, adjacent reference/value text pairs, large multi-pin IC bodies, and exact cross-page named-net merging. Dense PCB-artwork pages embedded in a schematic PDF are excluded with a reviewable warning instead of being interpreted as a schematic.

The profile remains precision-first: unsupported or ambiguous values, pins, symbols, and labels are omitted from resolved JSON and retained as issues for manual review.

MCP server

Start the stdio server with:

schematic-pdf-mcp

Available tools:

  • inspect_schematic_pdf

  • convert_schematic_pdf

  • validate_schematic_ir

The server exposes schematic://schema/current and staged artifacts through schematic://jobs/{job_id}/{stage}. Restrict readable local paths with SCHEMATIC_PDF_ALLOWED_ROOTS; set SCHEMATIC_PDF_ARTIFACT_ROOT to control the artifact destination.

Generic MCP configuration:

{
  "mcpServers": {
    "schematic-pdf": {
      "command": "schematic-pdf-mcp",
      "env": {
        "SCHEMATIC_PDF_ALLOWED_ROOTS": "D:\\schematics",
        "SCHEMATIC_PDF_ARTIFACT_ROOT": "D:\\schematic-output"
      }
    }
  }
}

Accuracy and validation

The final JSON contains source evidence and explicit issues for unresolved content. Schema validity and topology validity are independent of recognition completeness. Important policies include:

  • no inferred connection at a four-way crossing without explicit evidence;

  • no invented pin numbers, reference-designator suffixes, or net names;

  • ambiguous part-number-like text is omitted and reported for review;

  • recognition changes must keep 100% precision on registered real-PDF regression samples.

Run the automated suite:

python -m pytest

Run the EasyEDA-backed precision regression after placing authorized local sample PDFs and truth exports at the paths registered in the script:

python scripts\run_precision_regression.py

For a genuinely unseen PDF, lock the conversion before reading EDA truth:

python scripts\blind_validate_pdf.py lock "Test_PDF_SCH\new.pdf"
python scripts\blind_validate_pdf.py compare `
  "output\blind\job-...\blind-lock.json" `
  "output\accuracy\new.easyeda-ground-truth.json"

Test schematics, EasyEDA truth exports, and generated artifacts are excluded from the repository because they may contain proprietary circuit designs.

Codex skill

The reusable skill is in skill/convert-schematic-pdf. It defines the precision-first workflow, acceptance order, validation policy, MCP contract, and current limitations.

Current limitations

  • Native vector PDFs are the primary supported input.

  • Native Altium Designer schematic exports have a dedicated auto-detected recognition profile; custom print styles may still require calibration.

  • Raster OCR and raster primitive recognition are not implemented.

  • Hidden pin numbers and ambiguous symbol identity remain unresolved.

  • Long-distance value/label association is intentionally conservative.

  • Human review is still required whenever blocking issues remain.

License

MIT

Available Tools

3 tools
convert_schematic_pdfB

Run the four-layer baseline conversion and save raw, semantic, and final JSON artifacts.

ParametersJSON Schema
NameRequiredDescriptionDefault
pagesNo
source_pathYes

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool saves raw, semantic, and final JSON artifacts, which implies file-writing side effects. However, it does not state whether it overwrites files, what error handling occurs, or whether it is idempotent, leaving important behavioral details unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that states the action and outcome without extraneous words. It is front-loaded and efficient, though it uses jargon ('four-layer baseline') that could be expanded. Overall, it is appropriately sized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has two parameters, no output schema, and no annotations, yet the description gives only a high-level summary. It does not explain the meaning of 'four-layer baseline', what the JSON artifacts look like, or how the pages parameter affects conversion. For a tool with siblings, this lacks sufficient context for reliable invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides zero information about the input parameters. With 0% schema description coverage and no mention of source_path or pages in the description, the agent has no understanding of what parameters mean or how to populate them. The description completely fails to compensate for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs a conversion and saves specific JSON artifacts. The verb 'Run' combined with 'conversion' and the tool name 'convert' make the purpose clear. It distinguishes from siblings ('inspect' and 'validate') by indicating a conversion/output-producing step, though it does not explicitly compare to them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit guidance on when to use this tool versus the sibling tools. The mention of 'baseline conversion' implies a standard conversion process, but no prerequisites, exclusions, or alternative references are provided. Usage is only implied by the tool's name and general function.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

inspect_schematic_pdfB

Inspect a local PDF and classify each page as vector, raster, hybrid, or empty.

ParametersJSON Schema
NameRequiredDescriptionDefault
source_pathYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It states the action (inspect and classify) but does not explicitly confirm it is read-only, mention permissions, or describe error behavior or side effects. The term 'inspect' implies non-destructive, but this is not explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no redundant information. Every word contributes to understanding the tool's purpose, achieving high conciseness and clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (one parameter, no output schema), but the description lacks context about return values, classification criteria, or how the results might be used. Agents are left without information about what the tool outputs, making it incomplete for reliable invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has a single parameter `source_path` with no description (0% schema coverage). The description adds minimal value by implying that `source_path` refers to the local PDF file, but it does not elaborate on path format, required extension, or any restrictions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: inspect a local PDF and classify each page as vector, raster, hybrid, or empty. It uses specific verbs (inspect, classify) and specifies the resource (local PDF) and output categories, making it distinct from sibling tools like convert or validate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool instead of alternatives. The description does not mention prerequisites, intended scenarios, or compare with sibling tools such as convert_schematic_pdf or validate_schematic_ir.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_schematic_irA

Validate a local SchematicIR JSON file without changing its semantic content.

ParametersJSON Schema
NameRequiredDescriptionDefault
ir_pathYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses a key behavioral guarantee (non-mutating), but lacks details on validation semantics, error reporting, or output/exit behavior. With no annotations available, this leaves significant uncertainty.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The single sentence is concise, front-loaded, and contains no filler. It states the action, resource, and a key constraint efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter validation tool, the description gives the core action and parameter type, but omits details like what validation entails, how results are returned, and any error handling. Given no annotations or output schema, this is a moderate gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description clarifies that 'ir_path' refers to a local JSON file path, which the schema does not convey beyond the title 'Ir Path'. However, it does not specify path constraints (relative/absolute, extension, etc.).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action (validate) on a specific resource (local SchematicIR JSON file) and adds a constraint (without changing semantic content), which distinguishes it from sibling PDF tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have a local SchematicIR JSON file to validate, but it does not explicitly compare to sibling tools or state when not to use it. No alternative tools are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.2.0
    • First observedconvert_schematic_pdf
    • First observedinspect_schematic_pdf
    • First observedvalidate_schematic_ir

TDQS

A3.7/5.0

Scored across 3 tools

Disambiguation5/5

Each tool targets a distinct stage of the PDF conversion pipeline: inspection, conversion, and validation. There is no overlap in their purposes, making selection unambiguous.

Naming Consistency5/5

All tool names follow a consistent verb_noun snake_case pattern (inspect_schematic_pdf, convert_schematic_pdf, validate_schematic_ir). This is highly predictable and readable.

Tool Count5/5

With 3 tools, the set is well-scoped for a specialized schematic PDF conversion workflow. Each tool serves a necessary function without redundancy or bloat.

Completeness5/5

The tool surface covers the full lifecycle from inspecting a PDF to converting it to JSON and validating the resulting IR. No critical missing operations are apparent for the stated domain.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    B
    maintenance
    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.
    5
    1
    Apache 2.0
  • A
    license
    A
    quality
    A
    maintenance
    Local electronics tools for MCP-capable assistants, enabling static analysis of CRUMB save files and Logisim-evolution projects, including net tracing, BOM building, electrical rule checks, and optional truth table generation.
    22
    94 npm
    1
    Apache 2.0