Skip to main content
Glama
lx-mcp

lx-mcp

by Camel031

lx-mcp

An MCP server that reads concert lighting plots (DWG or DXF) and turns them into a checked fixture table. It finds the fixture symbols, matches them to the legend and to the fixture numbers written next to them, compares the counts against the legend, and keeps a fixture library in an Excel workbook. It runs as a stdio MCP server, so it works with any MCP client that can call tools; a client that can show images also gets the preview renders. I use it while preparing power and signal paperwork for shows.

繁體中文說明

Preview of the bundled sample plot after import

The image above is the real plot_preview output for examples/sample_plot.dxf, a synthetic plot with two trusses, a floor row and a legend. The plot has four planted mistakes, and the import finds all of them: red rings mark number problems (106 is missing, 205 is used twice), and dashed rings mark a fixture type that's missing from the library.

What the import returns

examples/make_demo.py builds the sample plot and a two-entry library, imports it and prints what the tools return. Condensed from the actual plot_import result:

Legend label

Library type

Legend qty

Found

BLINDER 2L

(none)

5

4

SPOT 470

SPOT 470

8

8

WASH 19

WASH 19

6

5

Issue

Message

number_missing

1 fixtures have no number nearby

number_duplicate

Number 205 is used by 2 fixtures in this view

type_unknown

4 fixtures with legend label 'BLINDER 2L' have no fixture library entry

legend_count_mismatch

Legend says 5 x BLINDER 2L, found 4

legend_count_mismatch

Legend says 6 x WASH 19, found 5

number_sequence

SPOT 470: numbers 101-108 skip 106

"Found" counts distinct fixture numbers, so the same fixture drawn on several sheets is counted once. That's also why the six washes count as five: two of them share the number 205.

Related MCP server: MCP_Dialux

Install

Requirements: Windows, Python 3.12, uv. DXF files work as they are. DWG files are converted to DXF with AutoCAD's accoreconsole.exe (default path C:\Program Files\Autodesk\AutoCAD 2026\accoreconsole.exe, override with the LX_ACCORECONSOLE environment variable).

git clone https://github.com/Camel031/lx-mcp.git
cd lx-mcp
uv sync
uv run pytest
uv run python examples/make_demo.py

Register the server with your MCP client. Most clients take a JSON entry like this one, which starts the server over stdio:

{
  "mcpServers": {
    "lx": {
      "command": "uv",
      "args": ["--directory", "<path-to-lx-mcp>", "run", "lx-mcp"]
    }
  }
}

For example, Claude Desktop reads this from its claude_desktop_config.json.

Folder layout

The server works on a show folder and looks for the fixture library in a folder named 燈庫 in the show folder or any folder above it:

Lighting/
  燈庫/燈具資料庫.xlsx          fixture library (sheet 燈具)
  2026-11-sample-show/
    plot.dwg
    lx-system/                  created by project_open
      fixtures.json             the current fixture table
      work/<timestamp>/         DWG copy, converted DXF, previous table
      out/previews/             PNG previews

The folder name, sheet name and column headers are in Traditional Chinese because they follow the spreadsheets I already use; they are constants in src/lx/project.py and src/lx/library.py.

To seed the library from an equipment weight list (columns: category, model, weight, rated W, actual W, TOP cable side, FL cable side, note):

uv run python -m lx.library import-weight-table weights.xlsx "Lighting\燈庫\燈具資料庫.xlsx"

Tools

Tool

What it does

project_open

Opens a show folder (absolute path) and creates lx-system/ in it.

plot_import

Imports a DWG or DXF plot. The original is never modified. Returns per-label counts and every open issue. A re-import replaces the fixture table and keeps the old one as fixtures.previous.json.

fixtures_list

Lists fixtures page by page, filtered by view, legend label, or only_issues=True for number problems.

plot_preview

Renders one view as PNG with a ring and number on each fixture.

fixtures_update

Corrects numbers, labels, types or rig positions, deletes false detections, and confirms the table (confirm=True). Any later edit clears the confirmation.

library_lookup, library_propose, library_commit

Look up library entries; add a pending entry; confirm it after review.

project_status

Reports the open folder, whether a plot was imported, and its issues.

All paths must be absolute, because the server's working directory is the repository, not the show folder.

How recognition works

  1. DWG files are copied to a work folder and saved as DXF 2018 by accoreconsole.

  2. Model space is flattened (nested blocks included) into inserts, texts, dimensions and the model-space windows of each paper-space layout. Each layout becomes a view; without layouts the whole drawing is one view named ALL.

  3. Legend rows are found as a block followed by text such as SPOT 470*8 31CH, WASH 19 x6, PROFILE (19CH) or LED BAR @ 8CH. Rows that are lengths or angles (truss and cable pieces) are skipped, and inserts on layers starting with @SITE (the venue base drawing) are never taken as legend symbols.

  4. Every insert whose geometry matches a legend symbol becomes a fixture. Matching uses a geometry signature, so a copy of the block under another name still matches.

  5. Numbers are assigned by distance, within 1.5 symbol sizes, and flagged as ambiguous when two candidates are nearly equally close.

  6. The drawing scale is inferred from linear dimensions (displayed value divided by measured length, assumed to be in cm).

  7. Issues are computed per view and per label: missing, ambiguous, duplicate or skipped numbers, labels without a library entry, and legend counts that don't match.

For acceptance testing on real plots, uv run lx-eval <plot files...> --library <library.xlsx> writes a Markdown report with counts, issues, preview paths and timings to eval_runs/<timestamp>/report.md.

Limitations

  • DWG and DXF only. DWG needs a local AutoCAD install for accoreconsole.

  • Fixtures must be blocks. If a plot was exploded into loose lines, the import reports legend_count_mismatch (found 0) or No fixtures were recognised, and you fix the drawing or the table by hand.

  • Large plots are slow: a DWG of tens of MB takes 3 to 5 minutes to convert and read, and the first preview takes about 3 minutes more. Each import keeps a DXF copy (up to about 500 MB) in work/; old work folders aren't deleted automatically.

  • Writing the library with openpyxl drops charts and images from the workbook and clears cached formula results until Excel recalculates and saves it. Text written by the tools is always stored as text, never as a formula.

  • preview.py uses an internal ezdxf API, so ezdxf is pinned to 1.4.x.

  • Power and signal planning (the reason the fixture table exists) isn't part of this release.

License

MIT, see LICENSE.

Available Tools

9 tools
fixtures_listA

List recognised fixtures in a compact form, one page at a time.

Filters: view (a name from the summary's views), legend_label, and only_issues=True for fixtures with a
number problem (number_missing, number_ambiguous, number_duplicate, number_sequence). Issues about a whole
legend label (type_unknown, legend_count_mismatch) are in the summary's issue list and do not select fixtures.
Returns `total`, the number of fixtures that match the filters, and at most `limit` of them starting at
`offset`; call again with a larger offset for the next page. x and y are drawing units rounded to 0.1;
issue_kinds names the number issues of each fixture.

Inputs: view, limit, offset, only_issues, +1 more. Returns: total, fixtures

fixtures_updateA

Correct numbers, legend labels, library types or rig positions, delete false detections, and set confirm=True only after the user has reviewed and accepted the fixture table.

A fixture number is 1-4 digits; full-width digits are stored as ASCII. Every call without confirm=True clears an earlier confirmation, so confirm again after the last correction.

Inputs: changes (required), confirm. Returns: views, issues, by_label, confirmed, +5 more

library_commitB

Mark pending library entries as confirmed. Call only after the user approves the values.

Inputs: models (required). Returns: result

library_lookupB

Find fixture library entries by model name or alias (exact or partial match).

Inputs: query (required). Returns: result

library_proposeB

Add or replace a pending fixture library entry. Put the spec sheet or URL in source.

Inputs: entry (required). Returns: mode, note, model, source, +14 more

plot_importA

Import a DWG or DXF lighting plot and recognise fixtures, numbers and the legend.

plot_file must be an absolute path. The original file is never modified. The summary lists every open issue
(kind, view, message and how many fixtures it concerns); tell the user about each of them. Review the fixtures
behind number issues with fixtures_list(only_issues=True) and plot_preview before asking the user to confirm
the fixture table.

A re-import replaces the fixture table of this show folder, including every correction made with
fixtures_update and the confirmation; the old table is kept as fixtures.previous.json in the new import's
work folder, and the summary's previous_table gives its path.

Inputs: plot_file (required). Returns: views, issues, by_label, confirmed, +5 more

plot_previewB

Render one view as PNG: fixtures coloured by legend label with their numbers ("?" when missing).

Red rings mark fixtures with a number issue and the fixtures in highlight_ids; a dashed ring marks a fixture
whose legend label has no library entry. Count mismatches are not drawn; they are in the issue list.

Inputs: view (required), highlight_ids.

project_openA

Open (or create) the lx-system folder inside a show folder (an absolute path). Call this before any other tool.

Inputs: show_dir (required). Returns: summary, imported, show_dir, library_file

project_statusA

Report the open show folder, whether a plot was imported, and its open issues with their messages.

Inputs: no named parameters. Returns: summary, imported, show_dir, library_file

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a clearly distinct action within its resource group: project open vs status, plot import vs preview, fixtures list vs update, and library lookup/propose/commit form a clean lifecycle. No two tools appear to do the same thing, and the descriptions reinforce the boundaries.

    Naming Consistency5/5

    All nine tools follow a consistent domain_verb snake_case pattern (project_open, plot_import, fixtures_list, library_lookup, etc.). The naming is predictable and readable throughout.

    Tool Count5/5

    Nine tools is well within the ideal 3-15 range and each earns its place across project setup, import, inspection, correction, and library management. Nothing feels redundant or gratuitously added.

    Completeness4/5

    The core workflow—open, import, preview, list, correct, and manage the fixture library—is fully covered with confirmation gating. Minor gaps exist, such as no export/save-back of corrections to the plot or an explicit project close, but agents can work around these.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP clients to query Vectorworks Spotlight fixture data from automatically exported Lightwright XML files, including counts, channels, weights, and plot QC, and to write fixture patch changes back to Vectorworks.
      13
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables converting a DWG lighting exercise floor plan into a DIALux evo–importable building by reconstructing rooms, reading the embedded assignment text, and consulting the UNE-EN 12464-1 standard.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables source-preserving import and analysis of EPLAN export reports (devices, connections, PLC I/O, terminals, cables, parts, network, pages) as immutable queryable snapshots, plus inspection of DXF/PDF/DWG drawings and derivation of electrical project evidence. Works offline without EPLAN, supporting querying, duplicate/endpoint checks, revision comparison, and verified JSON export.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to work with AutoCAD/Plant 3D drawings either live through COM or headlessly through DXF, supporting drawing creation and editing, entity queries, block attributes, dimensions, Excel round-trips, support-register QA, and PDF/PNG/SVG export for piping and pipe-support workflows.
      50
      MIT