visio-mcp
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., "@visio-mcp Draw a circuit schematic with a resistor and capacitor in series"
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.
visio-mcp
MCP (Model Context Protocol) server for drawing circuit schematics and diagrams in Microsoft Visio, driven by an LLM agent. MIT-licensed, 100% original code — no parts copied from other Visio MCP projects.
Why
Drawing schematic netlists in Visio programmatically usually fails because
symbol pins live at unknown coordinates and wires end up floating next to
the symbols. This server ships measured pin geometry for the classic
Analog Circuit stencil: every master was rendered to a 240 DPI PNG and its
pins were located pixel-exact. pin_point() turns those offsets into exact
page coordinates, so wires land on the pins.
Related MCP server: schematic-mcp-bridge
Features
Live COM engine — attaches to a running Visio (
GetActiveObject) or launches a new instance (Dispatch); auto-answers modal dialogs; runs all COM on a single worker threadStencil lock workaround — if a stencil is open in another Visio session (very common), a temporary copy is opened instead
Tools: documents, pages, stencils, masters, shapes (drop / wire / label / junction / weight / delete / find / list), export (PNG/PDF/SVG/EMF…)
Measured pin geometry for
Analog Circuit.vssmasters (NMOS1/PMOS1/Res1/Cap1/Ind2/balun/gnd/vdd) with orientation variantsBundled stencils —
stencils/shipsAnalog Circuit.vss,RFIC_lib.vssandRFsys_lib.vssso the examples run out of the box (third-party academic symbols, seestencils/README.mdfor provenance)Headless mock engine — the same tool layer runs without Visio, so the test suite works on Linux CI
Example: complete two-stage differential 40 GHz LNA schematic generator
Requirements
Requirement | Notes |
Windows 10/11 | live mode |
Microsoft Visio 2016+ | any edition |
Python 3.11+ | |
| bundled with the repo ( |
Install
cd VISIO_MCP
python -m venv .venv
.venv\Scripts\pip install -e ".[dev]"
# stencils ship with the repo; point the server at them
export VISIO_MCP_STENCIL_DIRS="$PWD/stencils"Probe Visio:
.venv\Scripts\python -m visio_mcp --checkRun as an MCP server (stdio)
.venv\Scripts\visio-mcpClaude Code
{
"mcpServers": {
"visio": {
"command": "C:/path/to/your/stencils/VISIO_MCP/.venv/Scripts/python.exe",
"args": ["-m", "visio_mcp"],
"env": {
"VISIO_MCP_STENCIL_DIRS": "C:/path/to/your/stencils"
}
}
}
}Hermes Agent
mcp_servers:
visio:
command: "C:/path/to/your/stencils/VISIO_MCP/.venv/Scripts/python.exe"
args: ["-m", "visio_mcp"]
env:
VISIO_MCP_STENCIL_DIRS: "C:/path/to/your/stencils"Environment variables
Variable | Default | Meaning |
| (empty) |
|
|
| show the Visio window |
|
| attach to a running Visio instance; |
|
| keep the launched Visio instance after exit |
|
| default wire weight |
|
| default label font |
|
| default label size |
| (empty) | junction-dot stencil (e.g. RFIC_lib.vss) |
|
| junction-dot master name |
|
| force the headless mock engine |
Tools
Tool | Description |
| server + Visio connection status |
| document lifecycle (1:1 inch page) |
| page control |
| stencil + master discovery |
| drop a symbol (angle, flip, label, weight) |
| orthogonal polyline, uniform weight |
| centered borderless text (Arial bold) |
| solid junction dot (Point master or filled circle) |
| shape management |
| PNG / JPG / SVG / EMF / PDF / VSDX |
| measured pin geometry & clearance |
Drawing recipe (agent workflow)
new_document(16, 9.5)— coordinates are inchesload_stencil("…/Analog Circuit.vss")— get a stencil keydrop_master(key, "NMOS1", x, y, flip_x=…)for every symbolpin_point("NMOS1", x, y, "gate")— exact pin coordinatedraw_wire([[..], pin_point, ..])— wires first, components on top (series elements cover the wire; usesymbol_boundsto keep descents out of bodies)add_junctionat ≥3-wire nodes,add_labelfor namesexport_page("png", "out.png")— inspect, iterate
Pitfalls
Do not keep the output .vsdx open in Visio while regenerating it — SaveAs then fails with an "invalid DOS handle" error. Close the file first (or write to a new path).
Temporary stencil copies must live next to the original stencil — files in %TEMP% are rejected by the Visio Trust Center file-block settings.
If a user's interactive Visio session feels flaky (stencils open in compatibility mode, unsaved docs, ...), set
VISIO_MCP_ATTACH=0so the server drives its own dedicated instance.
Measured pin data
visio_mcp/data/pins_analog_circuit.json — offsets in inches relative to the
drop point (y-up page coordinates), measured by PNG-render + pixel analysis.
Variants encode rotations (angle) and mirrors (flip_x). Verified against
the two-stage LNA example (all 21 connections pixel-checked).
Project layout
visio_mcp/
engine.py live COM engine (single worker thread, lazy win32com)
mock_engine.py headless engine for CI
server.py FastMCP app + tools
pins.py measured-geometry helpers
data/pins_analog_circuit.json
stencils/ bundled Visio stencils (Analog Circuit / RFIC_lib / RFsys_lib)
examples/lna_two_stage.py two-stage diff LNA schematic generator
tests/ unit tests (headless)License
MIT — the code, the measured pin-geometry JSON, and this documentation are
original work of this project's author. The bundled stencils in stencils/
(Analog Circuit.vss, RFIC_lib.vss, RFsys_lib.vss) are third-party
academic symbols (originally created at Fudan University) and are not
covered by this project's MIT license — see stencils/README.md for their
provenance and terms.
Available Tools
23 toolsadd_junctionA
Place a solid junction dot at (x, y) for >=3-wire nodes.
Inputs: x (required), y (required). Returns: object
add_labelB
Add a centered text label (borderless, transparent) at (x, y).
Inputs: x (required), y (required), text (required), h, +4 more. Returns: object
add_pageC
Add a new page and select it.
Inputs: name (required). Returns: object
close_documentC
Close the current document.
Inputs: save. Returns: object
delete_shapeB
Delete a shape by id.
Inputs: shape_id (required). Returns: object
draw_wireA
Draw an orthogonal polyline through a list of [x, y] points (inches). Each consecutive pair becomes a straight segment. Returns shape ids.
Inputs: points (required), weight. Returns: object
drop_masterB
Drop a stencil master at (x, y) in inches. Returns shape_id.
Inputs: x (required), y (required), master (required), stencil (required), +4 more. Returns: object
export_pageA
Export the current page to a file. fmt: png, jpg, gif, bmp, tif, svg, emf, pdf, vsdx. Returns the written path.
Inputs: fmt (required), path (required). Returns: object
find_shapeB
Find the first shape whose text contains text.
Inputs: text (required). Returns: object
health_checkA
Check server and Visio connection health.
Inputs: no named parameters. Returns: object
list_mastersB
List all masters (symbols) in a stencil file, with shape counts.
Inputs: stencil_path (required). Returns: object
list_pagesA
List pages in the current document.
Inputs: no named parameters. Returns: object
list_shapesA
List all shapes on the current page: id, master, text, position.
Inputs: no named parameters. Returns: object
list_stencilsA
List Visio stencil files (.vss/.vssx/.vssm) found in the configured
stencil directories (VISIO_MCP_STENCIL_DIRS) or in directory.
Inputs: directory. Returns: object
load_stencilA
Open a stencil file. If the file is locked by another Visio session, a temporary copy is opened instead. Returns a stencil key for drop_master.
Inputs: path (required). Returns: object
measured_pinsA
List stencil masters with measured pin geometry available.
Inputs: no named parameters. Returns: object
new_documentA
Create a new blank Visio document; page is scaled 1:1 so coordinates are inches. Returns the document name.
Inputs: title, units, width, height. Returns: object
open_documentA
Open an existing Visio document (.vsdx).
Inputs: path (required). Returns: object
pin_pointA
Absolute page coordinate (inches) of a symbol pin, based on measured geometry. Example: pin_point('NMOS1', 4.3, 6.0, 'gate') -> [4.049, 6.0]. Use the result as the endpoint of draw_wire so wires land on pins.
Inputs: x (required), y (required), pin (required), master (required), +2 more. Returns: object
save_documentA
Save the current document (optionally to a new path).
Inputs: path. Returns: object
select_pageC
Select a page by name.
Inputs: name (required). Returns: object
set_line_weightA
Set LineWeight (e.g. '1.5 pt') on a shape and its sub-shapes.
Inputs: weight (required), shape_id (required). Returns: object
symbol_boundsA
Absolute ink bounding box of a symbol body (inches) for clearance checks — keep wires out of it.
Inputs: x (required), y (required), master (required), angle, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Each tool targets a distinct resource/action, such as document lifecycle vs page management vs stencil operations vs shape operations. The geometry helpers (measured_pins, pin_point, symbol_bounds) are related but serve clearly different query purposes, so no two tools are ambiguous.
Most tools follow a verb_noun pattern (new_document, open_document, list_pages, drop_master, export_page) with consistent style. A few names deviate, such as health_check (object_verb) and measured_pins, pin_point, symbol_bounds (noun/adjective phrases), but the overall pattern is readable and predictable.
With 23 tools, the server feels heavy for a single MCP, though each tool serves a specific purpose within the broad Visio automation domain. The count is above the typical well-scoped range (3-15), but the tools are distributed across document, page, stencil, shape, drawing, and export concerns, so it is borderline rather than excessive.
The core workflow of creating, editing, and exporting diagrams is covered well: document CRUD, page management, stencil loading, master placement, drawing wires/labels/junctions, and export. However, there is no general shape property editor (only line weight), no text updating, no move/rotate/group operations, and no fill/color settings, which are notable gaps for a full Visio automation tool.
Related MCP Connectors
Create and manage Mermaid.js flowcharts and diagrams with AI agents via MCP.
Turn datasheets into source-backed JSON contracts, pinout matrices, and KiCad CAD for AI agents.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
AI agent draws editable hand-drawn diagrams (flowchart, ER, architecture) via MCP, not static images
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to automate 嘉立创 EDA Professional through MCP, including schematic and PCB editing, component search and placement, net routing, DRC, and design capture.-
- FlicenseDqualityDmaintenanceEnables AI agents to design electrical schematics through a high-level semantic API, handling components, pins, nets, validation/ERC, auto-layout, and SVG/KiCad rendering without requiring coordinate or file internals.22-
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to read and modify the EPLAN Electric P8 data model through MCP, including listing pages, reading devices and parts, copying circuits, renaming tags, and fixing texts.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to read and decode, generate from scratch, and reset Crocodile Physics 1.7 circuit files (.cyp) without opening the GUI, exposing components, wires, electrical nodes and saved voltages and currents as MCP tools. Generated circuits open and simulate directly in Crocodile, and the whole format is exposed byte by byte.MIT