Microsoft Visio MCP Server
Create and manipulate Microsoft Visio documents with an MCP server for reading, editing, and automating Visio files.
npx -y @GongRzhe/Office-Visio-MCP-ServerOverview
This MCP (Model Context Protocol) server provides a programmatic bridge to create, read, edit and automate Microsoft Visio documents. It exposes a RESTful API that represents Visio files as JSON models, accepts model patches/commands, and performs common file operations (upload, export, download). The server is intended for automation scenarios, batch processing, and integrating Visio diagram manipulation into developer workflows and services.
Because Visio desktop automation typically relies on the Visio COM object model, the server is designed to run where Microsoft Visio is available (commonly a Windows host with Visio installed). The server simplifies common tasks such as generating diagrams from templates, applying model-driven updates (add/remove shapes, change text, set connectors), and exporting drawings to PDF/PNG for downstream consumption.
Features
- Expose Visio documents as JSON-models via a RESTful MCP-compatible API
- Upload and download Visio (.vsdx/.vsd) files
- Apply model patches or commands to add, remove, or modify shapes and connectors
- Export drawings to common formats (PDF, PNG, SVG)
- Batch and headless automation for CI/CD or backend processing
- Health and metadata endpoints for integration checks
- Simple authentication token support for basic protection
- Example clients and scripts to demonstrate usage (upload, patch, export)
Installation / Configuration
Prerequisites:
- Microsoft Visio (desktop) installed on the host where you run the server
- Windows host is recommended when the server uses Visio COM automation
- Node.js (16+) or .NET runtime depending on the release build (check repository README for exact runtime)
Clone and run locally:
Install and run (Node.js example):
# install dependencies
# set environment variables, then start
Or run with .NET (if a .NET build is provided):
# build & run .NET server
Docker: because Visio often requires a desktop Windows environment, a Linux Docker image may not support Visio COM automation. Use Docker only if the project includes a Windows container image and you have the required licensing and Visio installed inside the container.
Configuration environment variables
| Name | Default | Description |
|---|---|---|
| PORT | 3000 | HTTP port to listen on |
| STORAGE_DIR | ./data | Directory to store uploaded files and temp exports |
| AUTH_TOKEN | (none) | Bearer token required by API (optional) |
| MAX_UPLOAD_MB | 100 | Maximum allowed upload size in MB |
Notes:
- Ensure the process can interact with the Visio application (desktop session, proper user permissions).
- If running as a Windows service, configure the service to allow desktop interaction if using COM automation.
Available Resources
- API endpoints (HTTP REST) — use for integration and automation
- Example scripts — small clients demonstrating upload, patch application, and export
- Postman collection / OpenAPI — check the repo for swagger.json or Postman files to import (if present)
- Logs and health endpoints — for monitoring and integration checks
Common REST endpoints (example):
| Method | Path | Description |
|---|---|---|
| GET | /health | Server liveness and basic Visio availability |
| POST | /upload | Upload a Visio file (.vsdx) |
| GET | /files/{id} | Download stored Visio file |
| GET | /model/{id} | Retrieve JSON model representation of the diagram |
| POST | /model/{id}/patch | Apply JSON patch/model changes |
| POST | /export/{id}?format=pdf | Export file to PDF/PNG/SVG |
Example: upload a file
Get model JSON
Apply a patch (JSON body)
Export to PDF
Use Cases
- Automated report generation: programmatically populate a Visio template with data (e.g., network devices, flowchart steps), export to PDF, and attach to reports or emails.
- Batch conversion: convert large numbers of legacy Visio files to PDF/PNG/SVG as part of an archival or migration pipeline.
- Model-driven diagram updates: represent diagrams as JSON models, apply patches from external systems (CMDB, orches