feat: add git-explorer MCP server for read-only repository access
Implements a new MCP server that provides read-only access to git repositories using go-git. Designed for deployment verification by comparing deployed flake revisions against source repositories. 9 tools: resolve_ref, get_log, get_commit_info, get_diff_files, get_file_at_commit, is_ancestor, commits_between, list_branches, search_commits. Includes CLI commands, NixOS module, and comprehensive tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -118,6 +118,27 @@ This ensures option documentation matches the home-manager version the project a
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultGitExplorerConfig returns the default configuration for the git-explorer server.
|
||||
func DefaultGitExplorerConfig() ServerConfig {
|
||||
return ServerConfig{
|
||||
Name: "git-explorer",
|
||||
Version: "0.1.0",
|
||||
Mode: ModeCustom,
|
||||
Instructions: `Git Explorer MCP Server - Read-only access to git repository information.
|
||||
|
||||
Tools for exploring git repositories:
|
||||
- Resolve refs (branches, tags, commits) to commit hashes
|
||||
- View commit logs with filtering by author, path, or range
|
||||
- Get full commit details including file change statistics
|
||||
- Compare commits to see which files changed
|
||||
- Read file contents at any commit
|
||||
- Check ancestry relationships between commits
|
||||
- Search commit messages
|
||||
|
||||
All operations are read-only and will never modify the repository.`,
|
||||
}
|
||||
}
|
||||
|
||||
// Server is an MCP server that handles JSON-RPC requests.
|
||||
type Server struct {
|
||||
store database.Store
|
||||
|
||||
Reference in New Issue
Block a user