Git Analytics

by singhashish4000

Not rated
GitHub

About

Provides detailed analytics and insights for Git repositories.

Details

Author
singhashish4000
Categories
Developer Tools, Other

Setup

Install Git Analytics in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/singhashish4000/MCP-Server

Follow the installation instructions in the repository README, then restart your MCP client.

Provides detailed analytics and insights for Git repositories.

πŸš€ A comprehensive Model Context Protocol (MCP) server that provides detailed Git repository analytics and insights. Perfect for developers who want to understand their codebase better through data-driven insights.

- Comprehensive Stats: Total commits, authors, branches, and code changes
- Author Analysis: Contributor rankings, commit patterns, and activity periods
- Branch Intelligence: Branch health, ahead/behind status, and activity metrics
- File Insights: Most modified files, author contributions per file
- Temporal Analysis: Commit frequency, code churn over time
- Visual Reports: Beautifully formatted terminal output with colors and emojis
- get_repository_overview- Executive summary with key metrics and top contributors
- get_repository_stats- Detailed repository statistics
- get_author_stats- Complete contributor analysis
- get_branch_stats- Branch health and comparison metrics
- get_file_stats- File modification patterns and hotspots
- get_commit_history- Detailed commit timeline with filters
- get_commit_frequency- Daily commit patterns over time
- get_code_churn- Lines added/removed analysis

- Node.js 18+
- npm or yarn
- Git repository to analyze

# Clone or create the project cd ~/git-analytics-mcp-server # Install dependencies npm install # Build the project npm run build # Test the server (optional) npm test
# Run in development with auto-reload npm run dev
{ "mcpServers": { "git-analytics": { "command": "node", "args": ["/path/to/git-analytics-mcp-server/dist/index.js"] } } }
# Install globally npm install -g . # Use anywhere git-analytics-mcp
πŸ“Š REPOSITORY SUMMARY REPORT ────────────────────────────────────────────────── Repository Statistics: β€’ Total Commits: 1,247 β€’ Total Authors: 12 β€’ Active Branches: 8 β€’ Code Changes: +45,678 -12,345 β€’ Repository Age: 2023-01-15 to 2024-06-15 Top Contributors: πŸ₯‡ John Doe - 456 commits πŸ₯ˆ Jane Smith - 234 commits πŸ₯‰ Bob Wilson - 189 commits πŸ… Alice Brown - 145 commits πŸ… Mike Johnson - 123 commits Recent Activity: β€’ a1b2c3d4 Add new authentication module (John Doe) β€’ e5f6g7h8 Fix critical security vulnerability (Jane Smith) β€’ i9j0k1l2 Update documentation and examples (Bob Wilson)
[ { "name": "John Doe", "email": "john@example.com", "commits": 456, "insertions": 12340, "deletions": 3456, "firstCommit": "2023-01-15T10:30:00Z", "lastCommit": "2024-06-15T14:22:00Z" } ]
[ { "date": "2024-06-01", "insertions": 234, "deletions": 45, "net": 189 }, { "date": "2024-06-02", "insertions": 156, "deletions": 89, "net": 67 } ]

Most tools accept these common parameters:

- path(string): Repository path (default: current directory)
- days(number): Time range for analysis (default: 30)
- limit(number): Maximum results to return (default: 50)

# Set default repository path export GIT_ANALYTICS_DEFAULT_PATH="/path/to/repo" # Enable debug logging export GIT_ANALYTICS_DEBUG=true
# Run all tests npm test # Run with coverage npm run test:coverage # Test specific functionality npm run test -- --grep "author stats"
# Create test repository mkdir test-repo && cd test-repo git init echo "# Test" > README.md git add . && git commit -m "Initial commit" # Test the server node dist/index.js

- Code Review Insights: Identify files that need more attention
- Team Productivity: Track commit patterns and contribution metrics
- Technical Debt: Find files with high churn rates
- Onboarding: Understand codebase structure and key contributors

- Release Planning: Analyze recent development velocity
- Resource Allocation: Identify knowledge silos and areas needing support
- Quality Metrics: Track code stability through churn analysis
- Timeline Analysis: Understand development patterns and cycles

- Branch Management: Identify stale or problematic branches
- File Hotspots: Find files that may need refactoring
- Contributor Onboarding: Welcome new team members with context
- Historical Analysis: Learn from past development patterns

Extend the server with custom analytics:

// Add to git-analytics.ts async getCustomMetric(): Promise<CustomMetric> { // Your custom analysis logic }
# Use with GitHub CLI gh repo list | xargs -I {} git-analytics-mcp --path {} # Batch analysis find ~/projects -name ".git" -type d | \ xargs -I {} dirname {} | \ xargs -I {} git-analytics-mcp --path {}

- Ensure you're in a Git repository or provide correct path
- Check Git installation:git --version

- Verify read access to repository
- Check file permissions on .git directory

- Repository may be empty or newly initialized
- Try with a repository that has commits

# Enable verbose logging DEBUG=git-analytics:* npm start # Check server connectivity echo '{}' | node dist/index.js

- Fork the repository
- Create feature branch:git checkout -b feature/amazing-feature
- Commit changes:git commit -m 'Add amazing feature'
- Push to branch:git push origin feature/amazing-feature
- Open Pull Request

# Install dev dependencies npm install # Run in watch mode npm run dev # Lint code npm run lint # Format code npm run format

MIT License - seeLICENSEfile for details.

- Model Context Protocolfor the excellent framework
-
simple-gitfor Git operations
-
chalkfor beautiful terminal output
-
date-fnsfor date manipulation

For questions, issues, or feature requests, please open an issue on GitHub.

Performs deep, file-level forensics on Git repositories to analyze file histories, changes, and patterns.

Gitee API integration, repository, issue, and pull request management, and more.

A CLI for interacting with GitKraken APIs. Includes an MCP server via gk mcp that not only wraps GitKraken APIs, but also Jira, GitHub, GitLab, and more.

A Claude Kubernetes MCP server, built in Go. The server integrates with ArgoCD, GitLab, Claude AI, and Kubernetes to enable advanced control and automation of Kubernetes environments.

Creates commit messages from staged files in a local git repository.

Perform Git operations on Azure DevOps repositories using a Personal Access Token (PAT).

Interact with Atlassian Bitbucket Cloud to manage repositories, pull requests, workspaces, and code.

An MCP server for interacting with the AtomGit API for version control and code hosting.

Access the Bitbucket Cloud API for automation, CI/CD pipelines, and integrations.

Manage Bitbucket repositories, pull requests, and pipelines via the Bitbucket API for both Cloud and Server.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.