raoagbajdos/MCP-Server-Excel-VBA-Macro-Converter-Python-2
If you are the rightful owner of MCP-Server-Excel-VBA-Macro-Converter-Python-2 and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server built with FastMCP that converts Excel files containing VBA macros into equivalent Python code.
convert_vba_file
Convert a single Excel file with VBA
extract_vba_code
Extract VBA code from Excel file
analyze_vba_complexity
Analyze VBA code complexity
batch_convert_files
Convert multiple Excel files
generate_python_equivalent
Generate Python code from VBA
Excel VBA to Python Converter using FastMCP
A Model Context Protocol (MCP) server built with FastMCP that converts Excel files containing VBA macros into equivalent Python code.
Features
- š Convert VBA macros to Python code
- š Extract Excel data and structure
- š Generate clean, readable Python code
- š ļø Support for common VBA constructs
- š Batch processing capabilities
- š Code analysis and optimization suggestions
Installation
- Clone the repository:
git clone <repository-url>
cd python-mcp-vba-conversion
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
Usage
As MCP Server
Start the FastMCP server:
python src/mcp_server.py
Standalone Usage
Convert a single Excel file:
python src/converter.py path/to/your/file.xlsm
Convert multiple files:
python src/batch_converter.py path/to/excel/files/
Project Structure
python-mcp-vba-conversion/
āāā src/
ā āāā mcp_server.py # FastMCP server implementation
ā āāā converter.py # Main VBA to Python converter
ā āāā vba_parser.py # VBA code parsing utilities
ā āāā python_generator.py # Python code generation
ā āāā excel_extractor.py # Excel file processing
ā āāā batch_converter.py # Batch processing utilities
āāā tests/
ā āāā test_converter.py
ā āāā test_vba_parser.py
ā āāā sample_files/
āāā examples/
ā āāā sample_macro.xlsm
ā āāā converted_output.py
āāā requirements.txt
āāā setup.py
āāā README.md
MCP Tools Available
convert_vba_file
: Convert a single Excel file with VBAextract_vba_code
: Extract VBA code from Excel fileanalyze_vba_complexity
: Analyze VBA code complexitybatch_convert_files
: Convert multiple Excel filesgenerate_python_equivalent
: Generate Python code from VBA
Examples
See the examples/
directory for sample Excel files and their Python conversions.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
MIT License