Contributing
How to Contribute
Section titled “How to Contribute”We welcome contributions to the GitHub MCP Server. Bug fixes, new features, documentation, and tests are all valuable.
Ways to Contribute
Section titled “Ways to Contribute”- Report bugs: open an issue on GitHub.
- Suggest features: start a discussion with context and expected behavior.
- Improve docs: fix typos, add examples, clarify steps.
- Add tests: increase coverage for existing modules.
- Submit code: fixes or new capabilities aligned with project goals.
Development Setup
Section titled “Development Setup”-
Fork and clone the repository:
Terminal window git clone https://github.com/YOUR-USERNAME/github-go-server-mcp.gitcd github-go-server-mcp -
Install dependencies: Go 1.25.0+ and
go mod tidy. -
Run tests:
Terminal window go test ./... -
Build the server:
Terminal window go build -o github-mcp-server-v3 ./cmd/github-mcp-server/
Contribution Guidelines
Section titled “Contribution Guidelines”- Follow standard Go conventions (
gofmt,go vet). - Use conventional commits (
feat:,fix:,docs:…). - Add tests for new features; keep existing tests green.
- Describe pull requests clearly and link related issues.
- Update documentation when behavior or APIs change.
Project Architecture
Section titled “Project Architecture”Modular Structure (Updated 2026-02-11)
Section titled “Modular Structure (Updated 2026-02-11)”The project follows Go 1.25 best practices with a highly modular architecture:
Core Directories
Section titled “Core Directories”cmd/github-mcp-server/- Main entry point and application bootstrapinternal/server/- MCP server implementation and handlerspkg/- Reusable packages and librariesgit/- Git operations (split into 5 focused modules)github/- GitHub API client wrapperadmin/- Administrative operationssafety/- 4-tier safety systemtypes/- Shared type definitions
Tool Definitions (Modular Organization)
Section titled “Tool Definitions (Modular Organization)”All tool definitions are organized by category in internal/server/:
internal/server/├── server.go # Main MCP handler (728 lines)├── tool_definitions_git_info.go # 8 Git info tools├── tool_definitions_git_basic.go # 5 basic Git tools├── tool_definitions_git_advanced.go # 21 advanced Git tools├── tool_definitions_hybrid.go # 3 hybrid tools├── tool_definitions_github.go # 4 GitHub API tools├── tool_definitions_dashboard.go # 7 dashboard tools├── tool_definitions_response.go # 3 response tools├── tool_definitions_repair.go # 7 repair tools├── admin_tools.go # 22 admin tools└── tool_annotations.go # Annotation helpersBenefits: Easy navigation, minimal merge conflicts, clear responsibility separation
Git Operations (4 Focused Modules)
Section titled “Git Operations (4 Focused Modules)”Git operations in pkg/git/ are split by functionality:
pkg/git/├── operations.go # Base infrastructure (176 lines)├── operations_basic.go # 12 basic operations (219 lines)├── operations_files.go # 8 file operations (245 lines)├── operations_branch.go # 9 branch/merge operations (535 lines)└── operations_advanced.go # 19 advanced operations (967 lines)Benefits: High cohesion, better parallel compilation, easier testing
Adding New Tools
Section titled “Adding New Tools”-
Choose the appropriate category file in
internal/server/:- Git info →
tool_definitions_git_info.go - Basic Git →
tool_definitions_git_basic.go - GitHub API →
tool_definitions_github.go - Admin →
admin_tools.go
- Git info →
-
Add tool definition using the
types.Toolstruct:{Name: "tool_name",Title: "Human-Readable Title",Description: "Clear description",InputSchema: types.ToolInputSchema{Type: "object",Properties: map[string]types.Property{"param": {Type: "string", Description: "Parameter description"},},Required: []string{"param"},},Annotations: ReadOnlyAnnotation(), // or DestructiveAnnotation(), etc.} -
Add handler in the
CallTool()switch inserver.go. -
Implement the operation in the relevant package (
pkg/git/,pkg/github/, etc.). -
Run tests:
go test ./....
Release Notes
Section titled “Release Notes”Release notes and version history are now in a separate page: Release Notes →
- v2.1.0 (2024-10-20): Advanced Git operations + conflict management
- v2.0.0 (2024-10-15): Complete rewrite in Go with JSON-RPC 2.0
- v1.0.0 (2024-10-01): Initial release
Changelog Format
Section titled “Changelog Format”This project follows Keep a Changelog and Semantic Versioning.
Change Types
Section titled “Change Types”- 🚀 Added: New features
- 🔧 Changed: Changes to existing functionality
- 🗑️ Deprecated: Features that will be removed
- ❌ Removed: Removed features
- 🐛 Fixed: Bug fixes
- 🛡️ Security: Security improvements
- 🔄 Updated: Dependency updates
- 🧪 Testing: Test-related changes
- 🎨 Code Quality: Code quality improvements
- 📚 Documentation: Documentation changes
License
Section titled “License”This project is licensed under the MIT License. By contributing, you agree that your contributions will be licensed under the same license.