Thank you for your interest in contributing to MCpeg! This guide will help you get started with contributing to the Model Context Protocol Enablement Gateway.
- Code of Conduct
- Getting Started
- Development Setup
- Contribution Guidelines
- Pull Request Process
- Issue Reporting
- Development Workflow
- Testing
- Documentation
- Community
MCpeg follows the XVC (Extreme Vibe Coding) methodology, which emphasizes:
- Single Source of Truth: Every piece of information exists in exactly one place
- No Redundancy: Eliminate duplication across all systems
- Surgical Precision: Every change is intentional and well-documented
- Bar-Raising Solutions: Only implement patterns that improve the overall system
- Forward Progress Only: No regression, always building on solid foundations
- Always Solve Never Mask: Address root causes, not symptoms
We expect all contributors to follow these principles and maintain a respectful, collaborative environment.
- Go 1.21 or later
- Git
- Basic understanding of the Model Context Protocol (MCP)
- Familiarity with JSON-RPC 2.0
-
Fork the Repository
# Fork on GitHub, then clone your fork git clone https://github.com/your-username/mcpeg.git cd mcpeg
-
Add Upstream Remote
git remote add upstream https://github.com/osakka/mcpeg.git
-
Build and Test
./scripts/build.sh build ./scripts/build.sh test -
Run Development Server
./build/mcpeg gateway --dev
-
Install Dependencies
go mod download
-
Set Up Pre-commit Hooks
cp scripts/pre-commit .git/hooks/pre-commit chmod +x .git/hooks/pre-commit
-
Configure Development Environment
export MCPEG_LOG_LEVEL=debug export MCPEG_DEVELOPMENT_MODE=true
mcpeg/
├── cmd/mcpeg/ # Main application entry point
├── internal/ # Private application code
│ ├── router/ # HTTP routing and handlers
│ ├── server/ # Gateway server implementation
│ └── registry/ # Service registry
├── pkg/ # Public reusable packages
│ ├── config/ # Configuration management
│ ├── logging/ # Structured logging
│ ├── plugins/ # Plugin system
│ └── validation/ # Validation framework
├── api/openapi/ # OpenAPI specifications
├── config/ # Configuration templates
├── docs/ # Documentation
├── scripts/ # Build and utility scripts
└── tests/ # Test files
- Bug Fixes - Fix issues in existing functionality
- Feature Enhancements - Improve existing features
- New Features - Add new functionality
- Documentation - Improve or add documentation
- Tests - Add or improve test coverage
- Performance - Optimize performance
- Plugins - Create new plugins or improve existing ones
- Check Existing Issues - Look for existing issues or discussions
- Create an Issue - For new features or significant changes
- Discuss Approach - Get feedback before starting major work
- Follow XVC Principles - Ensure changes align with project methodology
- Follow standard Go conventions (
gofmt,golint) - Use meaningful variable and function names
- Add package-level documentation for all packages
- Include function-level documentation for exported functions
- Handle errors explicitly, never ignore them
- Use structured logging with contextual information
// Package example demonstrates proper code documentation and structure.
//
// This package follows MCpeg's coding standards and implements the XVC
// methodology for single source of truth and surgical precision.
package example
import (
"context"
"fmt"
"github.com/osakka/mcpeg/pkg/logging"
)
// Service represents an example service implementation.
type Service struct {
logger *logging.Logger
config *Config
}
// NewService creates a new example service with the provided configuration.
//
// The service is initialized with structured logging and validates the
// configuration before returning.
func NewService(config *Config, logger *logging.Logger) (*Service, error) {
if config == nil {
return nil, fmt.Errorf("config cannot be nil")
}
if logger == nil {
return nil, fmt.Errorf("logger cannot be nil")
}
logger.Info("service_initialized", "service", "example")
return &Service{
logger: logger,
config: config,
}, nil
}
// ProcessData processes the provided data according to the service configuration.
//
// Returns processed data or an error if processing fails. All operations are
// logged with structured context for debugging.
func (s *Service) ProcessData(ctx context.Context, data []byte) ([]byte, error) {
s.logger.Debug("data_processing_started", "data_size", len(data))
// Implementation here...
s.logger.Info("data_processing_completed", "data_size", len(data))
return processedData, nil
}Follow the conventional commit format:
type(scope): brief description
Detailed explanation of the changes made and why they were necessary.
Changes:
- Specific change 1
- Specific change 2
- Specific change 3
Benefits:
- Benefit 1
- Benefit 2
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Types:
feat- New featurefix- Bug fixdocs- Documentation changesrefactor- Code refactoringtest- Adding testsperf- Performance improvementschore- Maintenance tasks
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-number-description- Follow code standards and XVC principles
- Add tests for new functionality
- Update documentation as needed
- Run tests locally before committing
# Run all tests
./scripts/build.sh test
# Run specific tests
go test ./pkg/plugins/...
# Run integration tests
go test -tags=integration ./tests/...
# Validate configuration
./build/mcpeg validate --config config/development.yamlgit add .
git commit -m "feat(plugins): add memory plugin hot reload capability
Implement hot reload functionality for memory plugin to support
runtime configuration changes without service restart.
Changes:
- Add reload method to memory plugin interface
- Implement configuration change detection
- Add reload endpoint to admin API
- Update plugin lifecycle management
Benefits:
- Zero downtime plugin updates
- Improved development experience
- Better configuration management
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>"git push origin feature/your-feature-nameCreate a pull request on GitHub with:
- Clear title and description
- Reference to related issues
- List of changes made
- Test instructions
- Screenshots (if applicable)
- Automated Checks - CI/CD pipeline runs tests
- Code Review - Maintainers review code
- Discussion - Address feedback and questions
- Approval - Get approval from maintainers
- Merge - Changes merged to main branch
## Description
Brief description of changes made.
## Related Issues
Closes #123
Related to #456
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
- [ ] Performance improvement
## Changes Made
- Change 1
- Change 2
- Change 3
## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed
- [ ] Documentation updated
## Screenshots (if applicable)
Add screenshots or GIFs for UI changes.
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Code is properly documented
- [ ] Tests added for new functionality
- [ ] All tests pass
- [ ] Documentation updatedUse the bug report template:
## Bug Description
Clear description of the bug.
## Steps to Reproduce
1. Step 1
2. Step 2
3. Step 3
## Expected Behavior
What you expected to happen.
## Actual Behavior
What actually happened.
## Environment
- OS: [e.g., Linux, macOS, Windows]
- Go Version: [e.g., 1.21.0]
- MCpeg Version: [e.g., 1.0.0]
- Configuration: [relevant config snippets]
## LogsPaste relevant log output here
## Additional Context
Any other context about the problem.
Use the feature request template:
## Feature Description
Clear description of the requested feature.
## Use Case
Describe the problem this feature would solve.
## Proposed Solution
Describe your proposed solution.
## Alternatives Considered
Other solutions you've considered.
## Additional Context
Any other context or examples.main- Stable release branchdevelop- Development integration branchfeature/*- Feature development branchesfix/*- Bug fix brancheshotfix/*- Critical bug fixes
- Create Issue - Describe the work to be done
- Create Branch - From main or develop
- Develop - Make changes following guidelines
- Test - Ensure all tests pass
- Document - Update relevant documentation
- Submit PR - Create pull request for review
- Review - Address feedback and iterate
- Merge - Changes merged after approval
# Start development server
./scripts/build.sh dev
# Run tests in watch mode
go test -watch ./...
# Validate changes
./scripts/build.sh validate
# Build for testing
./scripts/build.sh build- Unit Tests - Test individual functions/methods
- Integration Tests - Test component interactions
- End-to-End Tests - Test complete workflows
- Performance Tests - Test performance characteristics
package example
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestServiceProcessData(t *testing.T) {
tests := []struct {
name string
input []byte
expected []byte
wantErr bool
}{
{
name: "valid data",
input: []byte("test data"),
expected: []byte("processed test data"),
wantErr: false,
},
{
name: "empty data",
input: []byte{},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
service := NewTestService(t)
result, err := service.ProcessData(context.Background(), tt.input)
if tt.wantErr {
require.Error(t, err)
return
}
require.NoError(t, err)
assert.Equal(t, tt.expected, result)
})
}
}
func NewTestService(t *testing.T) *Service {
config := &Config{
// Test configuration
}
logger := logging.NewTestLogger(t)
service, err := NewService(config, logger)
require.NoError(t, err)
return service
}# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run tests with race detection
go test -race ./...
# Run specific package tests
go test ./pkg/plugins/...
# Run integration tests
go test -tags=integration ./tests/...- Package Documentation - Every package needs package-level docs
- Function Documentation - All exported functions need documentation
- API Documentation - OpenAPI specifications must be up-to-date
- User Guides - User-facing documentation for features
- ADRs - Architectural Decision Records for significant changes
- Use clear, concise language
- Include examples where helpful
- Follow the existing documentation structure
- Update relevant documentation with changes
- Cross-reference related documentation
docs/
├── guides/ # User guides
├── reference/ # API and CLI reference
├── architecture/ # Architecture documentation
├── processes/ # Development processes
└── examples/ # Usage examples
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - General questions and discussions
- Pull Requests - Code review and collaboration
- Check Documentation - Look for existing answers
- Search Issues - Look for similar problems
- Create Discussion - Ask questions in GitHub Discussions
- Create Issue - Report bugs or request features
We are committed to providing a welcoming and inclusive environment for all contributors. Please:
- Be respectful and considerate
- Focus on constructive feedback
- Help others learn and grow
- Follow the XVC methodology principles
- Maintain professional communication
MCpeg follows semantic versioning (SemVer):
MAJOR.MINOR.PATCH(e.g., 1.0.0)- Major: Breaking changes
- Minor: New features (backward compatible)
- Patch: Bug fixes (backward compatible)
- Update CHANGELOG.md
- Update version in code
- Run full test suite
- Update documentation
- Create release PR
- Tag release
- Build and publish artifacts
Contributors will be recognized in:
- CONTRIBUTORS.md file
- Release notes
- GitHub contributors page
- Commit co-author attribution
If you have questions about contributing:
- Check this guide and other documentation
- Search existing issues and discussions
- Create a new discussion on GitHub
- Reach out to maintainers
Thank you for contributing to MCpeg! Your contributions help make the Model Context Protocol ecosystem better for everyone.