Contributing to AvaloniaUI MCP Server
Thank you for your interest in contributing to the AvaloniaUI MCP Server! This document provides guidelines and information for contributors.
π€ How to Contribute
Reporting Issues
- Check existing issues first to avoid duplicates
- Use the issue templates when available
- Provide detailed information:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Environment details (.NET version, OS, MCP client)
- Relevant logs or error messages
Suggesting Enhancements
- Open an issue with the enhancement request
- Describe the use case and why it would be valuable
- Provide examples of how it would work
- Consider backward compatibility implications
Pull Requests
- Fork the repository and create a feature branch
- Follow the coding standards outlined below
- Write tests for new functionality
- Update documentation as needed
- Ensure all CI checks pass before requesting review
ποΈ Development Setup
Prerequisites
- .NET 9.0 SDK (version 9.0.300 or later)
- Git for version control
- IDE (Visual Studio, VS Code, or JetBrains Rider)
Local Development
- Clone the repository:
1 2
git clone https://github.com/your-username/AvaloniaUI.MCP.git cd AvaloniaUI.MCP
- Restore dependencies:
1
dotnet restore
- Build the project:
1
dotnet build
- Run tests:
1
dotnet test
- Run the MCP server:
1
dotnet run --project src/AvaloniaUI.MCP/AvaloniaUI.MCP.csproj
π Coding Standards
Code Style
- Follow the existing code style in the project
- Use the EditorConfig settings provided
- Run
dotnet format
before committing - Follow C# naming conventions
- Use XML documentation for public APIs
Project Structure
1
2
3
4
5
src/AvaloniaUI.MCP/
βββ Tools/ # MCP tools (actions that can be performed)
βββ Resources/ # MCP resources (knowledge base providers)
βββ Prompts/ # MCP prompts (template generators)
βββ Data/ # JSON knowledge base files
Adding New Features
Adding a New Tool
- Create a new class in
src/AvaloniaUI.MCP/Tools/
- Use the
[McpServerToolType]
attribute on the class - Use the
[McpServerTool]
attribute on methods - Add
[Description]
attributes for documentation - Write unit tests in
tests/AvaloniaUI.MCP.Tests/
Example:
1
2
3
4
5
6
7
8
9
10
11
[McpServerToolType]
public static class MyNewTool
{
[McpServerTool, Description("Description of what this tool does")]
public static string MyToolMethod(
[Description("Parameter description")] string parameter)
{
// Implementation
return "Result";
}
}
Adding a New Resource
- Create a new class in
src/AvaloniaUI.MCP/Resources/
- Use the
[McpServerResourceType]
attribute on the class - Use the
[McpServerResource]
attribute on methods - Return
Task<string>
for async resource loading - Add corresponding JSON data files if needed
Adding a New Prompt
- Create or extend a class in
src/AvaloniaUI.MCP/Prompts/
- Use the
[McpServerPromptType]
attribute on the class - Use the
[McpServerPrompt]
attribute on methods - Return
Task<string>
with the generated prompt
Testing Guidelines
- Write unit tests for all new functionality
- Use descriptive test names that explain what is being tested
- Follow the AAA pattern (Arrange, Act, Assert)
- Test both success and failure scenarios
- Maintain high code coverage
Example test:
1
2
3
4
5
6
7
8
9
10
11
12
[Fact]
public void MyTool_WithValidInput_ReturnsExpectedResult()
{
// Arrange
var input = "test input";
// Act
var result = MyNewTool.MyToolMethod(input);
// Assert
Assert.Contains("expected content", result);
}
Documentation
- Update README.md for major feature additions
- Update CLAUDE.md for development-related changes
- Add XML documentation for public APIs
- Update capability tables in documentation
π Pull Request Process
Before Submitting
- Ensure all tests pass:
1
dotnet test
- Check code formatting:
1
dotnet format --verify-no-changes
- Build in release mode:
1
dotnet build --configuration Release
- Update documentation if needed
PR Requirements
- Clear title describing the change
- Detailed description explaining:
- What was changed and why
- How to test the changes
- Any breaking changes
- Related issues (use βFixes #123β syntax)
- Small, focused changes (prefer multiple small PRs over large ones)
- All CI checks passing
Review Process
- Automated checks must pass (CI, tests, formatting)
- Code review by maintainers
- Testing of the functionality
- Documentation review if applicable
- Merge after approval
π Areas for Contribution
High Priority
- Additional AvaloniaUI controls in the knowledge base
- More XAML patterns and examples
- Enhanced WPF migration tools
- Cross-platform specific guidance
- Performance optimizations
Medium Priority
- Additional MCP transport support (HTTP, WebSockets)
- More comprehensive test coverage
- Better error handling and validation
- Documentation improvements
- Sample applications and demos
Ideas for New Features
- Interactive XAML designer assistance
- Automated code generation tools
- AvaloniaUI project analysis tools
- Integration with AvaloniaUI designer
- Custom control templates generator
π Bug Reports
When reporting bugs, please include:
- Clear title summarizing the issue
- Steps to reproduce the problem
- Expected behavior vs actual behavior
- Environment information:
- Operating system and version
- .NET version
- MCP client being used
- AvaloniaUI MCP Server version
- Logs or error messages (if applicable)
- Minimal reproduction case (if possible)
π Knowledge Base Contributions
The AvaloniaUI MCP Serverβs knowledge base is stored in JSON files in src/AvaloniaUI.MCP/Data/
. Contributions to improve or expand this knowledge base are highly valued:
Controls Reference (controls.json
)
- Add new controls with examples
- Improve existing control descriptions
- Add more usage scenarios and properties
XAML Patterns (xaml-patterns.json
)
- Add new common patterns
- Improve existing pattern examples
- Add platform-specific patterns
Migration Guide (migration-guide.json
)
- Expand WPF to AvaloniaUI mappings
- Add more migration scenarios
- Include troubleshooting guidance
π·οΈ Issue Labels
bug
- Something isnβt workingenhancement
- New feature or requestdocumentation
- Improvements to documentationgood first issue
- Good for newcomershelp wanted
- Extra attention is neededquestion
- Further information is requestedtools
- Related to MCP toolsresources
- Related to MCP resourcesprompts
- Related to MCP promptsknowledge-base
- Related to JSON data files
π License
By contributing to this project, you agree that your contributions will be licensed under the same license as the project (MIT License).
π Getting Help
- GitHub Discussions for general questions
- GitHub Issues for bugs and feature requests
- Code review comments for implementation questions
- Documentation in README.md and CLAUDE.md
Thank you for contributing to make AvaloniaUI development better for everyone! π