Contributing to PptMcp
August 20, 2026 ยท View on GitHub
Thank you for your interest in contributing to PptMcp! This project is designed to be extended by the community, especially to support coding agents like GitHub Copilot.
๐ฏ Project Vision
PptMcp aims to be the go-to command-line tool for coding agents to interact with Microsoft PowerPoint files. We prioritize:
- Simplicity - Clear, predictable commands
- Reliability - Robust COM automation
- Extensibility - Easy to add new features
- Agent-Friendly - Designed for AI coding assistants
๐ Getting Started
Development Environment
-
Prerequisites:
- Windows OS (required for PowerPoint COM)
- Visual Studio 2022 or VS Code
- .NET 10 SDK
- Microsoft PowerPoint installed
-
Setup:
git clone https://github.com/trsdn/mcp-server-ppt.git cd PptMcp dotnet restore dotnet build
๐จ CRITICAL: Pull Request Workflow Required
All changes must be made through Pull Requests (PRs). Direct commits to main are prohibited.
Quick PR Process
- Create feature branch:
git checkout -b feature/your-feature - Make changes: Code, tests, documentation
- Push branch:
git push origin feature/your-feature - Create PR: Use GitHub's PR template
- Address review: Make requested changes
- Merge: After approval and CI checks pass
๐ Detailed workflow: See DEVELOPMENT.md for complete instructions.
- Test Your Setup:
dotnet run -- pq-list "path/to/test.pptx"
๐ Development Guidelines
Code Style
- C# 12 features encouraged (file-scoped namespaces, records, pattern matching)
- Nullable reference types enabled - handle nulls properly
- No warnings - project must build with zero warnings
- XML documentation for public APIs
- Consistent naming - follow established patterns
Architecture Patterns
Command Pattern
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;
// PowerPoint automation using batch API
var task = Task.Run(async () =>
{
await using var batch = await PptSession.BeginBatchAsync(filePath);
return batch.Execute((ctx, ct) =>
{
// Use ctx.Presentation for presentation access
// Your implementation
return 0; // Success
});
});
return task.GetAwaiter().GetResult();
}
}
Critical Rules
- Always use batch API - Never manage PowerPoint lifecycle manually
- PowerPoint uses 1-based indexing -
collection.Item(1)is the first element - Release COM objects in
finally- EverydynamicCOM object needsComUtilities.Release(ref obj!) - Escape user input - Always use
.EscapeMarkup()with Spectre.Console - Return 0 for success, 1+ for errors - Consistent exit codes
PowerPoint COM Best Practices
- Late binding with dynamic types - Use
Type.GetTypeFromProgID("PowerPoint.Application") - Proper error handling - Catch
COMExceptionand provide helpful messages - Resource cleanup - Batch API handles COM object lifecycle automatically
- Input validation - Check file existence and argument counts early
Testing
Before submitting:
- Manual testing with various PowerPoint files
- Verify PowerPoint process cleanup - No
powerpnt.exeshould remain after 5 seconds - Test error conditions - Missing files, invalid arguments, etc.
- VBA script testing - For script-related commands, test with real VBA macros
- Cross-version compatibility - Test with different PowerPoint versions if possible
๐ง Adding New Commands
1. Create Interface
// Commands/INewCommands.cs
namespace PptMcp.Commands;
public interface INewCommands
{
int NewOperation(string[] args);
}
2. Implement Command Class
// Commands/NewCommands.cs
using Spectre.Console;
namespace PptMcp.Commands;
public class NewCommands : INewCommands
{
public int NewOperation(string[] args)
{
// Implementation following established patterns
}
}
3. Register in Program.cs
Add to the switch expression in Main():
return args[0] switch
{
"new-operation" => newCommands.NewOperation(args),
// ... existing commands
_ => ShowHelp()
};
4. Update Help Text
Add your command to the help output in ShowHelp().
๐ Pull Request Process
Before Submitting
- Code builds with zero warnings
- All existing commands still work
- PowerPoint processes clean up properly
- Added appropriate error handling
- Updated help text if needed
- Tested with various PowerPoint files
PR Description Template
## Summary
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tested manually with PowerPoint files
- [ ] Verified PowerPoint 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
๐จ UI Guidelines
Spectre.Console Usage
// 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}[/]");
Output Consistency
- Tables for structured data (query lists, sheet lists)
- Panels for code blocks (M code display)
- Progress indicators for long operations
- Clear error messages with actionable guidance
๐ Bug Reports
When reporting bugs, please include:
- PowerPoint version and Windows version
- Command used and arguments
- Expected behavior vs actual behavior
- Sample PowerPoint file (if possible)
- Error messages (full text)
๐ก Feature Requests
Great feature requests include:
- Use case description - Why is this needed?
- Proposed command syntax - How should it work?
- PowerPoint operations involved - What APIs would be used?
- Target users - Coding agents? Direct users?
๐ Learning Resources
๐ฆ For Maintainers
- NuGet Publishing Guide - Complete guide for publishing all packages with OIDC trusted publishing
๐ท๏ธ Issue Labels
bug- Something isn't workingenhancement- New feature or improvementdocumentation- Documentation improvementsgood first issue- Good for newcomershelp wanted- Extra attention neededppt-com- PowerPoint COM automation issuesvba- VBA automation specificcoding-agent- Coding agent related
Thank you for contributing to PptMcp! Together we're making PowerPoint automation more accessible to coding agents and developers worldwide. ๐