rubberduck-mcp
Bridges AI assistants with Rubberduck VBA to enable code analysis, module management, and Git operations on VBA projects.
README
rubberduck-mcp
⚠️ Maintenance Mode — This project is no longer actively developed. It should still work with compatible versions of Rubberduck VBA, but there are no plans for new features or bug fixes. Pull requests from the community are welcome if you'd like to maintain a fork.
A TypeScript-based Model Context Protocol (MCP) server that bridges AI assistants with Rubberduck VBA's source control and code analysis functionality.
Overview
rubberduck-mcp enables AI systems to access, analyze, modify, and manage VBA codebases through standardized MCP interfaces. This bridge allows AI assistants like Claude to work directly with VBA projects using Rubberduck's powerful source control and code analysis features.
Features
- VBA Module Management: Export and import VBA modules as text
- Git Integration: Perform Git operations (commit, branch, push, pull) directly on VBA projects
- Code Analysis: Run Rubberduck's code analysis and get detailed results
- Automated Refactoring: Execute Rubberduck refactorings on VBA code
- Project Structure: Access and navigate VBA project structure
- Secure Authentication: API key validation for secure access
Prerequisites
- Node.js 16.0.0 or later
- Rubberduck VBA Add-in installed and configured
- Windows environment (for COM interoperability)
- VBA host application (Excel, Word, etc.) with a VBA project loaded
Installation
From npm (when published)
npm install -g rubberduck-mcp
From Source
git clone https://github.com/yourusername/rubberduck-mcp.git
cd rubberduck-mcp
npm install
npm run build
Usage
As a command-line tool:
rubberduck-mcp [options]
Available options:
--api-key <key>- API key for authentication (can also use env varRUBBERDUCK_API_KEY)--debug- Enable debug logging (can also use env varRUBBERDUCK_DEBUG=true)--com-timeout <ms>- Timeout for COM operations in ms (can also use env varRUBBERDUCK_COM_TIMEOUT)--max-retries <num>- Maximum retries for COM operations (can also use env varRUBBERDUCK_MAX_RETRIES)-h, --help- Show help information-v, --version- Show version information
With Claude Desktop:
- Add to your Claude Desktop configuration file (typically
~/.claude/config.jsonon macOS/Linux or%APPDATA%\Claude\config.jsonon Windows):
{
"mcpServers": {
"rubberduck": {
"command": "rubberduck-mcp",
"args": [],
"env": {
"RUBBERDUCK_API_KEY": "your-api-key-here",
"RUBBERDUCK_DEBUG": "true"
}
}
}
}
- In Claude, you can now use the following MCP tools to interact with your VBA projects:
- exportVBAModule: Export a VBA module to text format with optional attributes
- importVBAModule: Import VBA code back into a module, optionally creating it
- analyzeCode: Perform Rubberduck code analysis with configurable rulesets
- executeRefactoring: Execute Rubberduck refactorings on specified code
- gitCommit: Commit changes with a specified message and optional file selection
- gitBranch: Create and/or checkout Git branches
- gitSync: Perform Git synchronization operations (push, pull, fetch)
- You can also access these MCP resources:
- rubberduck://project-structure: JSON representation of VBA project hierarchy
- rubberduck://modules-list: Array of available modules with metadata
- rubberduck://git-status: Current repository status with staged/unstaged changes
- rubberduck://code-history/{moduleName}: Commit history for specific modules
- rubberduck://inspection-results/{moduleName}: Latest code analysis results
- rubberduck://refactoring-options: Available automated refactorings with descriptions
Example: Using rubberduck-mcp with Claude
Here are some examples of how you might use rubberduck-mcp with Claude:
- Export a VBA module:
I'd like to see the code from the "Module1" module in my VBA project.
Claude can use the exportVBAModule tool:
Let me get that code for you from Module1.
- Analyze code for issues:
Can you check my "ErrorHandler" module for any code quality issues?
Claude can use the analyzeCode tool:
I'll analyze your ErrorHandler module for potential issues.
- Commit changes to Git:
Please commit my recent changes to the repository with the message "Fix error handling in validation routines"
Claude can use the gitCommit tool:
I'll commit your changes to Git with that message.
Architecture
This project follows a layered architecture:
- Server Layer: Implements the Model Context Protocol server interface
- COM Interoperability Layer: Manages interactions with Rubberduck and VBE through COM
- Git Integration Layer: Provides Git operation capabilities
- Types: Strongly typed interfaces for all components
Project Structure
The project has the following structure:
- src/server/: MCP server implementation
- src/com/: COM interoperability layer
- src/git/: Git integration
- src/types/: TypeScript type definitions
Implementation Guidelines
The project adheres to strict implementation rules, ensuring:
- Proper COM resource management
- Robust error handling
- Strong type safety
- Comprehensive documentation
Development
Building
npm run build
Testing
npm test
ESLint
npm run lint
Formatting
npm run format
License
MIT
Acknowledgements
- Rubberduck VBA for their amazing VBA tooling
- Model Context Protocol for the protocol specification
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.