Skip to main content
Glama
Jaz-spec

MCP Git Analysis Server

by Jaz-spec

MCP Git Analysis Server

An MCP (Model Context Protocol) server that analyzes local git repositories and provides insights about commits, contributors, and file changes.

Features

Tools

  1. analyze_commits - Get commit statistics with optional filters

    • Filter by count, author, or date range

    • Returns detailed commit information including changes

  2. find_hot_spots - Find most frequently changed files

    • Shows files with most commits

    • Includes number of unique authors per file

  3. get_contributors - List all contributors with statistics

    • Shows commit counts, insertions, deletions

    • Includes first and last commit dates

Resources

  1. git://recent-activity - Last 10 commits as structured data

  2. git://file-history/{filepath} - Change history for a specific file

Related MCP server: Git Analytics MCP Server

Installation

# Install dependencies
pip install -r requirements.txt

Usage

With MCP Inspector

# Run the server with MCP Inspector
mcp dev server.py

As MCP Server

Configure in your MCP client settings:

{
  "mcpServers": {
    "git-analysis": {
      "command": "python3",
      "args": ["/path/to/server.py"]
    }
  }
}

Example Tool Calls

Analyze Recent Commits

{
  "name": "analyze_commits",
  "arguments": {
    "count": 5
  }
}

Find Hot Spots

{
  "name": "find_hot_spots",
  "arguments": {
    "limit": 10
  }
}

Get Contributors

{
  "name": "get_contributors",
  "arguments": {}
}

Example Resource Access

  • git://recent-activity - Get recent activity

  • git://file-history/src/main.py - Get history for specific file

Requirements

  • Python 3.8+

  • Git repository

  • GitPython library

  • MCP SDK

Testing

Test with MCP Inspector:

npx @modelcontextprotocol/inspector python3 server.py

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Analyzes git repository metrics to understand team health, development patterns, code quality, and collaboration through natural language queries. Provides insights on commit statistics, bus factor, velocity trends, technical debt, and burnout detection.
    12
    39 npm
    1
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables analysis of local Git repositories via standard git commands, providing insights like line authorship, commit frequency, code churn, and co-changed files.
    -