A Python-based MCP server that automates Visio diagram creation and editing via a standardized API.
Configuration
View docs{
"mcpServers": {
"gongrzhe-office-visio-mcp-server": {
"command": "python",
"args": [
"visio_mcp_server.py"
]
}
}
}You can automate Microsoft Visio diagram creation and editing using this MCP Server, enabling you to programmatically create diagrams, add shapes, connect them, and manage text and exports through a standardized API using Python.
Using this MCP Server, you can perform common diagram tasks from your MCP client: create or open Visio documents, add shapes (Rectangle, Circle, Line, etc.), connect shapes with various connectors, attach text to shapes, list shapes in a document, and save or export diagrams. Use the MCP client to send requests that map directly to these capabilities and handle shapes, connections, and text in your Visio diagrams.
Prerequisites you need before running the server:
Windows operating system with Microsoft Visio installed and a supported Python version.
Install Python packages shown in the steps below.
# Ensure Visio is installed on the system
# Install required Python packages
pip install pywin32
pip install mcp-server
# Run the MCP server from the command line
python visio_mcp_server.pyThe server runs as a local Python process. To connect your MCP client, register a stdio MCP server that starts the Python process and runs the Visio MCP server script.
{
"mcpServers": {
"visio": {
"type": "stdio",
"name": "visio_mcp",
"command": "python",
"args": ["visio_mcp_server.py"],
"env": []
}
}
}Create a new Visio diagram or open an existing one to begin editing.
Open an existing Visio file to modify shapes and connections.
Add a shape to the current Visio document, specifying type (Rectangle, Circle, Line, etc.) and its position and size.
Connect two shapes with a selected connector type (Dynamic, Straight, or Curved).
Attach text to a specific shape to annotate the diagram.
List all shapes present in the active Visio document.
Save the current diagram to a specified path.
Export the diagram to image formats or PDFs if supported by the server.