MCP Hub
Back to servers

dig

MCP server for code archaeology: git blame, file history, contributors, and co-change analysis

Registry
Updated
Mar 11, 2026

Quick Install

npx -y mcp-server-dig

mcp-server-dig

English | 日本語

MCP server for AI-powered code archaeology — explore git blame, file history, contributor patterns, and co-change analysis through the Model Context Protocol.

Tools

Composite Analysis

ToolDescription
git_file_risk_profileMulti-dimensional risk assessment for a single file
git_repo_healthRepository-wide health summary

Data Retrieval

git_file_history

Get the commit history for a specific file with diff stats.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
file_pathstringyesRelative path to the file within the repo
max_commitsnumbernoMaximum commits to return (default: 20)
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"

git_blame_context

Semantic blame that groups consecutive lines by the same commit into blocks.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
file_pathstringyesRelative path to the file within the repo
start_linenumbernoStart of line range
end_linenumbernoEnd of line range

git_related_changes

Find files that frequently change together with a given file (co-change analysis).

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
file_pathstringyesRelative path to the file within the repo
max_commitsnumbernoHow many commits to analyze (default: 100)
min_couplingnumbernoMinimum co-change count to include (default: 2)

git_contributor_patterns

Analyze contributor patterns — who has expertise in what areas.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
path_patternstringnoDirectory or path to scope analysis, e.g. "src/api/"
sincestringnoDate filter, e.g. "2024-01-01" or "1 year ago"
max_commitsnumbernoMaximum commits to analyze (default: 500)

git_search_commits

Search commit messages by keyword. Useful for finding when a feature was introduced, a bug was fixed, or locating commits related to a ticket number.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
querystringyesSearch string to match against commit messages
max_commitsnumbernoMaximum number of commits to return (default: 20)
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
authorstringnoFilter by author name or email
path_patternstringnoLimit search to commits touching this path

git_commit_show

Show detailed information about a specific commit: full message, changed files, and optionally the diff. Useful for drilling into a commit found via git_search_commits.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
commitstringyesCommit hash (short or full), branch name, or tag
show_diffbooleannoInclude the full diff output (default: false, shows stat only)

git_diff_context

Show the diff between two commits, branches, or tags. Useful for understanding what changed between releases, branches, or any two points in history.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
commitstringyesTarget commit, branch, or tag
compare_tostringnoBase to compare against (default: parent commit)
file_pathstringnoLimit diff to a specific file
stat_onlybooleannoShow only file change statistics (default: false)
context_linesnumbernoNumber of context lines in unified diff (default: 3)

git_hotspots

Identify the most frequently changed files in the repository. Files with high change frequency often indicate areas of technical debt, active development, or bug-prone code.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
path_patternstringnoLimit analysis to a specific directory, e.g. "src/"
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
max_commitsnumbernoNumber of commits to analyze (default: 500)
top_nnumbernoNumber of top files to return (default: 20)

git_pickaxe

Search for commits that introduced or removed a specific string or regex pattern in the codebase (git's pickaxe feature). Essential for finding when a function, variable, or pattern first appeared or was removed.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
search_termstringyesString or regex pattern to search for in code changes
is_regexbooleannoTreat search_term as regex -G instead of literal -S (default: false)
max_commitsnumbernoMaximum number of commits to return (default: 20)
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
authorstringnoFilter by author name or email
path_patternstringnoLimit search to commits touching this path

git_code_churn

Analyze code churn (lines added + deleted) per file. High churn files may indicate unstable code, frequent refactoring, or areas needing architectural attention. Complements git_hotspots by measuring change volume, not just frequency.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
path_patternstringnoLimit analysis to a specific directory, e.g. "src/"
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
max_commitsnumbernoNumber of commits to analyze (default: 500)
top_nnumbernoNumber of top files to return (default: 20)

git_stale_files

Find files that have not been modified for a long time. Stale files may indicate dead code, forgotten configuration, or areas of technical debt that need review or removal.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
threshold_daysnumbernoMinimum days since last change to consider stale (default: 180)
path_patternstringnoLimit analysis to a specific directory, e.g. "src/"
top_nnumbernoMaximum number of stale files to return (default: 30)

git_merge_base

Find the common ancestor (merge base) of two branches or refs and show commits on each side since divergence. Useful for understanding branch relationships and reviewing what will be merged.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
ref1stringyesFirst branch or ref (e.g. "main")
ref2stringyesSecond branch or ref (e.g. "feature-branch")
max_commitsnumbernoMaximum commits to show per side (default: 50)

git_tag_list

List tags sorted by creation date with associated messages. Useful for understanding release history and versioning patterns.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
patternstringnoGlob pattern to filter tags, e.g. "v1.*"
max_tagsnumbernoMaximum number of tags to return (default: 50)
sortstringnoSort order: "newest" or "oldest" (default: "newest")

git_file_risk_profile

Comprehensive risk assessment for a single file combining change frequency, code churn, knowledge concentration, implicit coupling, and staleness into a multi-dimensional profile.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
file_pathstringyesRelative path to the file within the repo
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
max_commitsnumbernoNumber of commits to analyze (default: 500)

Example output:

Risk profile for: src/core/engine.ts
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Change frequency:  HIGH (47 changes, top 3%)
Code churn:        HIGH (1,230 lines churned)
Knowledge risk:    MEDIUM (2 contributors, top owns 78%)
Coupling:          HIGH (12 co-changed files)
Staleness:         LOW (last changed 3 days ago)

Overall: HIGH RISK
Concerns: frequently changing, high code churn, highly coupled

git_repo_health

Repository-wide health summary combining file count, commit activity, top hotspots, highest churn files, contributor distribution, and stale file count into a single overview.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
sincestringnoDate filter for activity analysis
max_commitsnumbernoNumber of commits to analyze (default: 500)
stale_threshold_daysnumbernoDays without change to consider stale (default: 180)

Setup

Prerequisites

  • Node.js >= 18
  • Git

Install

npm install -g mcp-server-dig

Or build from source:

git clone https://github.com/nakishiyaman/mcp-server-dig.git
cd mcp-server-dig
npm install
npm run build

Configure

Add to your MCP client configuration (e.g. Claude Desktop claude_desktop_config.json):

{
  "mcpServers": {
    "dig": {
      "command": "mcp-server-dig"
    }
  }
}

Or if running from source:

{
  "mcpServers": {
    "dig": {
      "command": "node",
      "args": ["./build/index.js"]
    }
  }
}

Zed

Add to your Zed settings.json:

{
  "context_servers": {
    "dig": {
      "command": {
        "path": "mcp-server-dig",
        "args": []
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "dig": {
      "command": "mcp-server-dig"
    }
  }
}

Windsurf

Add to your Windsurf MCP configuration:

{
  "mcpServers": {
    "dig": {
      "command": "mcp-server-dig"
    }
  }
}

Development

npm install
npm run build        # Compile TypeScript
npm run typecheck    # Type check without emitting
npm run lint         # ESLint
npm test             # Run tests (vitest)
npm run test:watch   # Watch mode

License

MIT

Reviews

No reviews yet

Sign in to write a review