rubberduck-mcp

rubberduck-mcp

Bridges AI assistants with Rubberduck VBA to enable code analysis, module management, and Git operations on VBA projects.

Category
访问服务器

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 var RUBBERDUCK_API_KEY)
  • --debug - Enable debug logging (can also use env var RUBBERDUCK_DEBUG=true)
  • --com-timeout <ms> - Timeout for COM operations in ms (can also use env var RUBBERDUCK_COM_TIMEOUT)
  • --max-retries <num> - Maximum retries for COM operations (can also use env var RUBBERDUCK_MAX_RETRIES)
  • -h, --help - Show help information
  • -v, --version - Show version information

With Claude Desktop:

  1. Add to your Claude Desktop configuration file (typically ~/.claude/config.json on macOS/Linux or %APPDATA%\Claude\config.json on Windows):
{
  "mcpServers": {
    "rubberduck": {
      "command": "rubberduck-mcp",
      "args": [],
      "env": {
        "RUBBERDUCK_API_KEY": "your-api-key-here",
        "RUBBERDUCK_DEBUG": "true"
      }
    }
  }
}
  1. 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)
  1. 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:

  1. 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.
  1. 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.
  1. 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选