🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

mcp-server-dig

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mcp-server-dig

MCP server for AI-powered code archaeology — git blame, file history, contributor patterns, and related change analysis

latest
Source
npmnpm
Version
0.40.0
Version published
Weekly downloads
111
63.24%
Maintainers
1
Weekly downloads
 
Created
Source

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

Workflow Integration

ToolDescription
git_review_prepPR review briefing with risk flags, reviewer suggestions, and missing file detection
git_whyCode archaeology narrative — explains why code exists by combining blame, commits, contributors, and co-changes

Composite Analysis

ToolDescription
git_file_risk_profileMulti-dimensional risk assessment for a single file
git_repo_healthRepository-wide health summary
git_code_ownership_changesCompare code ownership before/after a date boundary — detects owner handoffs, bus factor changes, knowledge transfer patterns
git_impact_analysisBlast radius analysis for a file or directory — combines co-change networks, contributor overlap, and directory coupling
git_knowledge_loss_riskAssess knowledge loss risk per contributor — identifies directories where a single person owns most of the code (bus factor = 1) and estimates recovery cost
git_trend_analysisAnalyze trends over time by comparing metrics across multiple time periods — tracks whether hotspot count, code churn, contributor count, or commit activity is improving, stable, or worsening
git_refactor_candidatesIdentify and rank refactoring candidates across the repository using 5-dimension risk assessment (change frequency, code churn, knowledge concentration, coupling, staleness)
git_release_comparisonCompare repository metrics between two git refs (tags, branches, commits) — shows how hotspots, churn, contributor count, and bus factor changed between releases
git_complexity_hotspotsIdentify and rank maintenance complexity hotspots using 6-dimension assessment (change frequency, code churn, knowledge concentration, coupling, staleness, conflict frequency)
git_contributor_growthAnalyze contributor growth and retention over time — tracks new/departed contributors per period (monthly/quarterly), computes retention rates, bus factor trends, and classifies trajectory as growing/stable/shrinking
git_offboarding_simulationSimulate the impact of a contributor leaving — recomputes bus factor per directory after removing the author's contributions, identifies new single-points-of-failure and knowledge gaps
git_coordination_bottleneckDetect directories with high coordination cost — ranks by composite score of change frequency, unique authors, and ownership distribution to identify merge conflict hotspots
git_expertise_decayTrack expertise freshness — detect directories where dominant code owners have become inactive or are fading
git_stability_predictionPredict file stability by combining 4 signals: revert ratio, churn trend, code age, and conflict frequency — scores each file 0-100

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
detect_movesbooleannoDetect code moved from other files using git blame -M (default: false)

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)
word_diffbooleannoShow word-level diffs using git diff --word-diff=plain (default: false)

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_knowledge_map

Show who owns knowledge of each directory, including bus factor analysis. Helps identify knowledge concentration risks and areas where team cross-training is needed.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
path_patternstringnoLimit analysis to a specific directory, e.g. "src/"
depthnumbernoDirectory depth for aggregation (default: 2)
sincestringnoDate filter, e.g. "2024-01-01" or "1 year ago"
max_commitsnumbernoMaximum commits to analyze (default: 500)

git_dependency_map

Visualize implicit dependency networks between directories based on co-change patterns. Directories that frequently change together may have hidden coupling.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
depthnumbernoDirectory depth for aggregation (default: 2)
sincestringnoDate filter, e.g. "2024-01-01" or "1 year ago"
max_commitsnumbernoMaximum commits to analyze (default: 500)
min_couplingnumbernoMinimum co-change count to include (default: 3)

git_bisect_guide

Pre-bisect analysis for identifying bug-introducing commits. Shows commit count in range, estimated bisect steps, hotspots, and relevant commits. Does NOT run git bisect itself.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
good_refstringyesKnown good reference where the bug did not exist
bad_refstringnoKnown bad reference where the bug exists (default: HEAD)
file_pathstringnoOptional file path to focus on

git_rename_history

Track the rename history of a file. Reconstructs the full rename chain showing how a file was renamed over time.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
file_pathstringyesRelative path to the file within the repo
max_entriesnumbernoMaximum number of commits to scan (default: 50)

git_commit_graph

Analyze merge patterns and branch integration topology. Calculates merge ratio, merge frequency, merge sources, and classifies the integration style.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
sincestringnoAnalysis period (default: "6 months ago")
max_commitsnumbernoMaximum commits to analyze (default: 1000)

git_branch_activity

Analyze branch activity levels, classifying branches as active, stale, or abandoned based on recent commit activity.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
include_remotebooleannoInclude remote branches (default: false)
stale_daysnumbernoDays without commits to consider stale (default: 30)
abandoned_daysnumbernoDays without commits to consider abandoned (default: 90)

git_author_timeline

Analyze author activity periods and team composition changes over time.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
sincestringnoDate filter, e.g. "2024-01-01" or "1 year ago"
path_patternstringnoLimit analysis to a specific path, e.g. "src/"
max_commitsnumbernoMaximum commits to analyze (default: 1000)

git_commit_frequency

Analyze commit frequency over time periods. Groups commits into daily, weekly, or monthly buckets to identify development patterns.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
granularitystringnoTime granularity: "daily", "weekly" (default), or "monthly"
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
max_commitsnumbernoMaximum commits to analyze (default: 1000)
path_patternstringnoLimit analysis to a specific path, e.g. "src/"

git_release_notes

Generate release notes between two refs by aggregating commits using Conventional Commits format. Groups by type/scope, detects breaking changes, and lists contributors.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
from_refstringyesStart ref (tag, branch, or commit)
to_refstringnoEnd ref (default: HEAD)
group_bystringnoGrouping: "type" (default), "scope", or "none"
include_breakingbooleannoInclude breaking changes section (default: true)
max_commitsnumbernoMaximum commits to analyze (default: 500)

git_contributor_network

Analyze contributor collaboration network. Shows which developers work on the same files, revealing team collaboration patterns and knowledge silos.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
max_commitsnumbernoMaximum commits to analyze (default: 500)
path_patternstringnoLimit analysis to a specific path, e.g. "src/"
min_shared_filesnumbernoMinimum shared files to show a collaboration link (default: 1)

git_conflict_history

Detect files that frequently appear in merge commits. High-frequency merge files indicate conflict-prone areas that may need refactoring.

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

git_survival_analysis

Analyze code churn trends over time. Shows additions, deletions, net change, and churn rate per period. Useful for identifying refactoring phases and code instability.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
granularitystringnoTime granularity: "daily", "weekly" (default), or "monthly"
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
max_commitsnumbernoMaximum commits to analyze (default: 1000)
path_patternstringnoLimit analysis to a specific path, e.g. "src/"

git_code_age

Analyze the age distribution of code lines in a file using blame data. Groups lines into age brackets (< 1 month, 1-3 months, 3-6 months, 6-12 months, > 1 year) to visualize how old different parts of a file are.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
file_pathstringyesRelative path to the file within the repo

git_commit_message_quality

Analyze commit message quality metrics including Conventional Commits compliance rate, average subject length, long subject violations (>72 chars), issue reference rate, and type distribution.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
max_commitsnumbernoMaximum commits to analyze (default: 200)
path_patternstringnoLimit analysis to commits touching this path
authorstringnoFilter by author name or email

git_reflog_analysis

Analyze git reflog entries to understand HEAD movement history. Shows branch switches, resets, rebases, and other ref updates. Useful for recovering lost commits and understanding local workflow patterns.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
refstringnoThe ref to show reflog for (default: HEAD)
max_entriesnumbernoMaximum number of reflog entries (default: 50, max: 500)
action_filterstringnoFilter by action type (e.g. 'commit', 'checkout', 'reset', 'rebase')

git_cherry_pick_detect

Detect cherry-picked or equivalent commits between branches using git cherry. Shows which commits have already been applied to upstream and which are unique. Useful for identifying duplicate work across branches.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
upstreamstringyesThe upstream branch to compare against (e.g. 'main')
headstringnoThe branch to check (default: current HEAD)

git_line_history

Track the evolution of specific lines or a function using git log -L. Shows how a code block changed across commits — unlike blame (snapshot) or file_history (file-level), this reveals line-level change history.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
file_pathstringyesFile path relative to the repository root
start_linenumbernoStart line of the range (requires end_line)
end_linenumbernoEnd line of the range (requires start_line)
funcnamestringnoFunction name to track (alternative to line range)
max_commitsnumbernoMaximum commits to show (default: 20)

git_commit_cluster

Detect clusters of related commits by time proximity and shared files. Reveals logical changeset boundaries — groups of commits that form a coherent change.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
sincestringnoOnly include commits after this date
authorstringnoFilter commits by author name or email
max_commitsnumbernoMaximum commits to analyze (default: 200)
time_window_minutesnumbernoTime window for clustering in minutes (default: 120)
min_shared_filesnumbernoMinimum shared files to link commits (default: 1)
path_patternstringnoFilter commits by file path pattern

git_merge_timeline

Analyze merge frequency over time. Shows merge counts, branch activity, and trend direction per period.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
granularitystringnoTime period granularity: "weekly", "monthly", "quarterly" (default: "monthly")
num_periodsnumbernoNumber of periods to analyze (default: 6, max: 24)
path_patternstringnoFilter to a specific path
sincestringnoOverride start date

git_complexity_hotspots

Identify and rank maintenance complexity hotspots using 6-dimension risk assessment (change frequency, code churn, knowledge concentration, coupling, staleness, conflict frequency).

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
sincestringnoDate filter
max_commitsnumbernoNumber of commits to analyze (default: 500)
top_nnumbernoNumber of top hotspots to return (default: 10, max: 100)
path_patternstringnoFilter files by path pattern

git_contributor_growth

Analyze contributor growth and retention over time. Tracks new/departed contributors per period (monthly or quarterly), computes retention rates, bus factor trends, and classifies overall trajectory as growing/stable/shrinking.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
periodstringnoAggregation period: "monthly", "quarterly" (default: "monthly")
sincestringnoDate filter (e.g. "2024-01-01", "1 year ago")
path_patternstringnoFilter commits affecting paths matching pattern
max_commitsnumbernoMaximum number of commits to analyze (default: 10000)

git_code_ownership_changes

Compare code ownership before and after a date boundary. Detects owner handoffs, bus factor changes, new/departed contributors, and knowledge transfer patterns.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
period_boundarystringyesDate boundary for before/after comparison (e.g. "2024-06-01", "3 months ago")
depthnumbernoDirectory depth for aggregation (1-5, default: 1)
path_patternstringnoLimit analysis to a specific directory
max_commitsnumbernoMaximum commits to analyze (default: 500)

git_impact_analysis

Analyze the blast radius of changes to a file or directory. Combines co-change networks, contributor overlap, and directory coupling to assess how far changes might ripple.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
target_pathstringyesFile or directory path to analyze impact for
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
max_commitsnumbernoMaximum commits to analyze (default: 500)
min_couplingnumbernoMinimum co-change count to include (default: 2)

git_review_prep

Generate a PR review briefing by analyzing the diff between two refs. Combines diff stats, commit history, hotspot/churn analysis, contributor patterns, and co-change detection to surface risk flags, suggest reviewers, and warn about potentially missing files.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
base_refstringyesBase ref for comparison, e.g. "main"
head_refstringnoHead ref for comparison (default: "HEAD")
max_commitsnumbernoNumber of commits to analyze (default: 500)

Example output:

PR Review Briefing: main...HEAD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Commits (2):
  abc1234 feat: add new feature
  def5678 fix: handle edge case

Changed files (3, +35 -10):
  src/foo.ts | +25 -5
  src/bar.ts | +10 -5

Risk flags:
  src/foo.ts — HOTSPOT (15 changes), HIGH CHURN (450 lines)

Suggested reviewers:
  Alice <alice@example.com> — 12 commits to src/foo.ts

Potentially missing files:
  src/foo.test.ts — co-changes with src/foo.ts 85% of the time

git_why

Explain why code exists by combining blame, commit context, contributor patterns, and co-change analysis into a narrative. Answers the question "Why does this code look this way?" for a file or line range.

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
max_commitsnumbernoMaximum number of commits to show in detail (default: 10)

Example output:

Why does this code exist? — src/foo.ts L10-25
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Blame summary (3 commits, 2 authors):

[L10-15] abc1234 | 2024-06-15 | Alice
  Commit: feat: add validation logic
  Files in commit: src/foo.ts, src/foo.test.ts

[L16-25] def5678 | 2024-08-20 | Bob
  Commit: fix: handle null input (Fixes #42)
  Files in commit: src/foo.ts, src/bar.ts

File context:
  Contributors: Alice (80%), Bob (20%)
  Co-changed with: src/foo.test.ts (85%), src/types.ts (60%)

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)

git_repo_statistics

Analyze repository physical structure and size metrics — object counts, pack statistics, total commits, branch/tag counts, repository age, and largest tracked files.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
top_n_filesnumbernoNumber of largest tracked files to include (default: 10, max: 100)

git_commit_patterns

Analyze commit distribution by day-of-week and hour-of-day — heatmap-style patterns including peak activity windows, weekday/weekend ratios, and timezone distribution.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
authorstringnoFilter by author name or email (substring match)
sincestringnoDate filter (e.g. "2024-01-01", "6 months ago")
max_commitsnumbernoMaximum number of commits to analyze (default: 1000)
path_patternstringnoFilter commits affecting paths matching pattern

git_revert_analysis

Analyze revert patterns in the repository — detects commits created by git revert, links them to their original commits, calculates time-to-revert statistics, and identifies files that are frequently reverted (revert hotspots).

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
sincestringnoDate filter (e.g. "2024-01-01", "6 months ago")
path_patternstringnoFilter reverts affecting paths matching pattern
top_nnumbernoNumber of hotspot entries to return (default: 10)

git_velocity_anomalies

Detect statistical anomalies (spikes and drops) in commit frequency using mean +/- N sigma threshold.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
granularitystringnoTime granularity: "daily", "weekly" (default), or "monthly"
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
max_commitsnumbernoMaximum commits to analyze (default: 1000)
threshold_sigmanumbernoNumber of standard deviations for anomaly detection (default: 2)
path_patternstringnoLimit analysis to a specific path, e.g. "src/"

git_tag_analysis

Analyze tag-based release patterns — semver distribution, annotated vs lightweight tags, release interval statistics, frequency trend, and naming prefix distribution.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
patternstringnoGlob pattern to filter tags, e.g. "v1.*" or "release-*"

git_activity_drought

Detect files with prolonged periods of no development activity (droughts). Identifies stagnant code by finding consecutive time periods with zero commits.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
path_patternstringnoLimit analysis to a specific path
sincestringnoStart of analysis window (default: "1 year ago")
granularitystringnoTime granularity: "weekly" or "monthly" (default)
min_drought_periodsnumbernoMinimum consecutive zero-activity periods to report (default: 2)
top_nnumbernoMaximum number of files to return (default: 20)

git_stability_prediction

Predict file stability by combining 4 signals: revert ratio, churn trend, code age, and conflict frequency. Returns a stability score (0-100) for each file.

ParameterTypeRequiredDescription
repo_pathstringyesAbsolute path to the git repository
path_patternstringnoLimit analysis to a specific path
sincestringnoDate filter, e.g. "2024-01-01" or "6 months ago"
top_nnumbernoMaximum number of files to return (default: 20)

Prompts

MCP Prompts provide guided workflows that chain multiple tools together for common use cases.

PromptDescriptionParameters
investigate-codeCode investigation — traces why code exists using blame, pickaxe, and file historyrepo_path, file_path, line_range?
review-prPR review workflow — generates a review briefing with risk assessmentrepo_path, base_ref, head_ref?
assess-healthRepository health assessment — evaluates overall repo qualityrepo_path
trace-changeChange tracing — tracks when and why a specific string was added or removedrepo_path, search_term
onboard-codebaseNew contributor onboarding — guided tour of repo structure, key contributors, and active areasrepo_path
find-bug-originBug origin hunting — uses bisect analysis to identify bug-introducing commitsrepo_path, good_ref, bad_ref?, file_path?, symptom?
technical-debtTechnical debt analysis — identifies high-risk files, knowledge concentration, and stale areasrepo_path
onboard-areaArea-specific onboarding — knowledge owners, contributors, and change history for a directoryrepo_path, directory
ai-agent-safetyPre-flight risk check for AI agents before modifying files — chains file_risk_profile, impact_analysis, related_changes, and conflict_historyrepo_path, file_path
plan-refactoringRefactoring planning — ranks candidates by 5-dimension risk, then drills into top files with risk profile, code archaeology, and impact analysisrepo_path, path_pattern?, top_n?
assess-change-riskPre-change risk assessment — evaluates file risk, blast radius, knowledge distribution, and code history before making changesrepo_path, file_path, change_description?
identify-tech-debtMulti-tool technical debt analysis — chains refactor candidates, complexity hotspots, risk profiles, code age, and knowledge loss risk for a comprehensive debt reportrepo_path, path_pattern?, top_n?
diagnose-performanceRepository performance diagnosis — chains repo statistics, hotspots, stale files, trend analysis, and dependency mapping for a comprehensive performance reportrepo_path, path_pattern?, top_n?
post-incident-reviewPost-incident review — chains commit search, diff context, revert analysis, file risk profile, and impact analysis to identify root cause and recommend prevention measuresrepo_path, incident_date, suspected_files?
plan-releaseRelease planning review — chains release comparison, revert analysis, file risk profile, coordination bottleneck, and trend analysis to support release decisionsrepo_path, base_ref, head_ref?, release_date?
find-expertsFind domain experts — discovers knowledge owners for a specific area using knowledge map, author timeline, blame, and contributor networkrepo_path, path_pattern, since?
analyze-release-cadenceRelease cadence analysis — chains tag analysis, commit frequency, and trend analysis to evaluate release healthrepo_path, since?
prepare-knowledge-transferKnowledge transfer planning — chains offboarding simulation, knowledge map, loss risk, author timeline, and contributor network for departing developer preparationrepo_path, departing_author, timeline?

Resources

URIDescription
dig://tool-guideTool selection guide — maps common questions to the right tool
dig://repo-summary/{path}Dynamic repository summary — generates overview with branch, file count, contributors, and recent commits

Setup

Prerequisites

  • Node.js >= 22
  • 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"
    }
  }
}

Configuration

Timeout

All 54 tools accept an optional timeout_ms parameter (default: 30000ms, max: 300000ms) for large repositories.

Output Format

All 54 tools accept an optional output_format parameter:

  • "text" (default) — human-readable formatted output
  • "json" — structured JSON for programmatic consumption

Tool Annotations

All 54 tools declare MCP Tool Annotations (readOnlyHint: true, openWorldHint: false), enabling clients to understand that dig tools are read-only git analysis operations.

Streamable HTTP Transport

By default, dig runs on stdio. To use Streamable HTTP transport:

# Via CLI flag
mcp-server-dig --http

# Via environment variable
DIG_TRANSPORT=http mcp-server-dig

HTTP mode listens on http://127.0.0.1:3000/mcp. Change the port with DIG_PORT:

{
  "mcpServers": {
    "dig": {
      "command": "mcp-server-dig",
      "args": ["--http"],
      "env": {
        "DIG_PORT": "8080"
      }
    }
  }
}

Auto-completion

Prompt arguments and resource URI paths support MCP completion protocol for interactive clients.

Structured Logging

Logging uses the MCP Logging Protocol when connected to a client, with stderr fallback.

Set DIG_LOG_LEVEL environment variable to control log verbosity:

{
  "mcpServers": {
    "dig": {
      "command": "mcp-server-dig",
      "env": {
        "DIG_LOG_LEVEL": "debug"
      }
    }
  }
}

Available levels: debug, info (default), warn, error.

When DIG_LOG_LEVEL=debug, every git command execution logs its duration, and the analysis cache logs hit/miss events. This enables performance profiling and bottleneck identification.

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

Keywords

mcp

FAQs

Package last updated on 17 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts