vba
MCP server for VBA extraction and analysis from Office files
claude mcp add --transport stdio alexistrouve-vba-mcp-server python -m vba_mcp_server
How to use
This MCP server provides tools to extract and analyze VBA code from Microsoft Office files. It exposes a lightweight Python-based MCP server that can parse VBA from workbook or document files and present the extraction results in a structured way for Claude to interact with. Available MCP tools include extract_vba (to pull out VBA code from a specified module), list_modules (to enumerate all VBA modules present in a file), and analyze_structure (to evaluate code structure and complexity). To use it, run the server and configure your MCP client (e.g., Claude Desktop) to point at the vba MCP server. Once connected, you can issue commands to extract code, inspect module lists, or analyze code organization and complexity metrics. The server supports typical workflows for processing .xlsm, .xlsb, .xls, .docm, .doc, and partially .accdb files (with full Access support available in the Pro version).
Within your Claude Desktop or MCP-enabled client, you can invoke:
- extract_vba: Retrieve VBA code for a specific module from a workbook or document.
- list_modules: Get a list of all VBA modules contained in the file.
- analyze_structure: Assess code structure and complexity across modules. These capabilities enable automated VBA extraction, auditing, and preparation for review or transformation during workflows that involve Office files.
How to install
Prerequisites:
- Python 3.8 or newer installed on your system
- PIP (Python package manager)
Installation steps:
-
Create and activate a virtual environment (optional but recommended):
python -m venv venv
macOS/Linux
source venv/bin/activate
Windows
venv\Scripts\activate
-
Install the VBA MCP server package from PyPI:
pip install vba-mcp-server
-
(Optional) Install additional dependencies if not installed automatically (e.g., oletools is used for VBA extraction):
pip install oletools
-
Run the MCP server:
python -m vba_mcp_server
-
Configure your MCP client (e.g., Claude Desktop) to point to the server as described in the Quick Start configuration snippet.
Additional notes
Notes and tips:
- The server currently supports Lite features in the base package (extract, list, analyze). The Pro version adds injection, macro execution, data read/write, form access, VBA compilation checks, and backup/restore capabilities.
- For Access (.accdb) files, support is partial in the Lite version; full Access features are available in the Pro version.
- Ensure oletools is installed in your environment to enable VBA extraction from Office files.
- If you run into environment issues, using a virtual environment (venv) is recommended to isolate dependencies.
- When configuring Claude Desktop, ensure the JSON config uses the correct module path (vba_mcp_server) and that Python is accessible in your PATH.
- For large files or complex projects, consider running the extraction and analysis steps separately to manage resource usage.
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