Thank you for your interest in contributing to Sbroenne.ExcelMcp! This project is designed to be extended by the community, especially to support coding agents like GitHub Copilot.
ExcelMcp aims to be the go-to command-line tool for coding agents to interact with Microsoft Excel files. We prioritize:
git clone https://github.com/sbroenne/mcp-server-excel.git
cd ExcelMcp
dotnet restore
dotnet build
All changes must be made through Pull Requests (PRs). Direct commits to main are prohibited.
git checkout -b feature/your-featuregit push origin feature/your-featureπ Detailed workflow: See DEVELOPMENT.md for complete instructions.
dotnet run -- pq-list "path/to/test.xlsx"
All commands follow this structure:
// Interface
public interface IMyCommands
{
int MyOperation(string[] args);
}
// Implementation
public class MyCommands : IMyCommands
{
public int MyOperation(string[] args)
{
// Validation
if (!ValidateArgs(args, expectedCount, "usage string"))
return 1;
// Excel automation using batch API
var task = Task.Run(async () =>
{
await using var batch = await ExcelSession.BeginBatchAsync(filePath);
return batch.Execute((ctx, ct) =>
{
// Use ctx.Book for workbook access
// Your implementation
return 0; // Success
});
});
return task.GetAwaiter().GetResult();
}
}
collection.Item(1) is the first elementQueryTables.Add() not ListObjects.Add() - For loading Power Query data.EscapeMarkup() with Spectre.ConsoleType.GetTypeFromProgID("Excel.Application")COMException and provide helpful messagesBefore submitting:
excel.exe should remain after 5 seconds// Commands/INewCommands.cs
namespace ExcelMcp.Commands;
public interface INewCommands
{
int NewOperation(string[] args);
}
// Commands/NewCommands.cs
using Spectre.Console;
namespace ExcelMcp.Commands;
public class NewCommands : INewCommands
{
public int NewOperation(string[] args)
{
// Implementation following established patterns
}
}
Add to the switch expression in Main():
return args[0] switch
{
"new-operation" => newCommands.NewOperation(args),
// ... existing commands
_ => ShowHelp()
};
Add your command to the help output in ShowHelp().
## Summary
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tested manually with Excel files
- [ ] Verified Excel process cleanup
- [ ] Tested error conditions
- [ ] VBA script execution tested (if applicable)
- [ ] No build warnings
## Checklist
- [ ] Code follows project conventions
- [ ] Self-review completed
- [ ] Updated documentation as needed
// Success (green checkmark)
AnsiConsole.MarkupLine($"[green]β[/] Operation succeeded");
// Error (red)
AnsiConsole.MarkupLine($"[red]Error:[/] {message.EscapeMarkup()}");
// Warning (yellow)
AnsiConsole.MarkupLine($"[yellow]Note:[/] {message}");
// Info/debug (dim)
AnsiConsole.MarkupLine($"[dim]{message}[/]");
// Headers (cyan)
AnsiConsole.MarkupLine($"[cyan]{title}[/]");
When reporting bugs, please include:
Great feature requests include:
bug - Something isnβt workingenhancement - New feature or improvementdocumentation - Documentation improvementsgood first issue - Good for newcomershelp wanted - Extra attention neededexcel-com - Excel COM automation issuespower-query - Power Query specificcoding-agent - Coding agent relatedThank you for contributing to Sbroenne.ExcelMcp! Together weβre making Excel automation more accessible to coding agents and developers worldwide. π