Office-Visio
MCP server from GongRzhe/Office-Visio-MCP-Server
claude mcp add --transport stdio gongrzhe-office-visio-mcp-server python visio_mcp_server.py
How to use
This MCP server provides programmatic automation for Microsoft Visio diagrams using Python and COM. It exposes a set of endpoints that let you create new diagrams, open existing ones, manipulate shapes, connect shapes with various connectors, attach text, save and export diagrams, and list current shapes in a document. Transactions are performed through simple JSON payloads, making it easy to script Visio workflows or integrate Visio diagram creation into broader automation pipelines. Typical use cases include generating flowcharts from data, programmatically laying out network diagrams, or producing diagram templates on demand.
To use the server, connect to the configured MCP endpoint and issue commands that specify a Visio file and the requested operation. Common operations include creating a new file, adding shapes (Rectangle, Circle, Line, etc.), connecting two shapes with a chosen connector type (Dynamic, Straight, or Curved), inserting text into a shape, listing shapes in a document, and exporting diagrams as images. The server handles the underlying COM interactions with Visio, so you can focus on defining shapes, positions, and relationships in your payloads.
How to install
Prerequisites
- Windows operating system with Microsoft Visio (Professional or Standard) installed
- Python 3.12+ installed on the system
- Internet access to install Python packages
Installation steps
- Install required Python packages
pip install pywin32
pip install mcp-server
-
Clone or download this repository to your Windows machine
-
Run the Visio MCP server
python visio_mcp_server.py
-
(Optional) Configure MCP settings to point to the server (see mcp_config)
-
Verify the server starts and is reachable via your MCP management tool or API client.
Additional notes
Notes and tips:
- Visio automation relies on the Windows COM interface; ensure Visio is installed and licensed on the host.
- The server expects a Visio file path for most operations; absolute paths are often safest.
- If you encounter COM errors, ensure no other Visio instances are hanging and try restarting Visio or the host service.
- The provided example config uses a Python runtime invocation; if you deploy differently (e.g., via uvx or another runner), adjust the mcp_config accordingly.
- For large diagrams or batch operations, consider exporting to images or PDFs after completion to preserve results.
- Environment variables can be added under env in the mcp_config to supply credentials or paths if needed by your workflow.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP