raoagbajdos/MCP-Server-Excel-VBA-Macro-Converter-Python-2
3.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 dayong@mcphub.com.
A Model Context Protocol (MCP) server built with FastMCP that converts Excel files containing VBA macros into equivalent Python code.
Tools
5
Resources
0
Prompts
0
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