Skip to content

Commit 2e19711

Browse files
committed
feat: initial release of git-metrics MCP server
- Add get_commit_stats tool for repository statistics - Add get_author_metrics tool for per-developer metrics - Add get_file_churn tool for code quality analysis - Add get_team_summary tool for comprehensive reports - Support date range and author filtering - Include Kiro CLI configuration examples
0 parents  commit 2e19711

File tree

9 files changed

+2280
-0
lines changed

9 files changed

+2280
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
id: release
18+
with:
19+
release-type: node
20+
21+
- uses: actions/checkout@v4
22+
if: ${{ steps.release.outputs.release_created }}
23+
24+
- uses: actions/setup-node@v4
25+
if: ${{ steps.release.outputs.release_created }}
26+
with:
27+
node-version: '18'
28+
registry-url: 'https://registry.npmjs.org'
29+
30+
- name: Install dependencies
31+
if: ${{ steps.release.outputs.release_created }}
32+
run: npm ci
33+
34+
- name: Build
35+
if: ${{ steps.release.outputs.release_created }}
36+
run: npm run build
37+
38+
- name: Publish to npm
39+
if: ${{ steps.release.outputs.release_created }}
40+
run: npm publish --access public
41+
env:
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
build/
3+
*.log
4+
.DS_Store
5+
.env

.npmignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
src/
2+
node_modules/
3+
.git/
4+
.gitignore
5+
tsconfig.json
6+
*.log
7+
.DS_Store
8+
.env

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Jonatan Mata
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
# Git Metrics MCP Server
2+
3+
MCP server for analyzing git repository metrics and tracking team performance KPIs. Built for Kiro CLI (Amazon Q CLI) and other MCP clients.
4+
5+
## Overview
6+
7+
This server provides tools to extract meaningful metrics from git repositories, helping teams track productivity, code quality, and collaboration patterns.
8+
9+
## Features
10+
11+
- **Commit Statistics**: Track commits, additions, deletions, and files changed
12+
- **Author Metrics**: Per-developer performance breakdown
13+
- **File Churn Analysis**: Identify frequently modified files (quality indicators)
14+
- **Team Summaries**: Comprehensive team performance reports
15+
16+
## Installation
17+
18+
### From npm (Recommended)
19+
20+
```bash
21+
npm install -g @jonmatum/git-metrics-mcp-server
22+
```
23+
24+
### From Source
25+
26+
```bash
27+
git clone https://github.com/jonmatum/git-metrics-mcp-server.git
28+
cd git-metrics-mcp-server
29+
npm install
30+
npm run build
31+
```
32+
33+
## Kiro CLI Configuration
34+
35+
Add to `~/.kiro/settings/mcp.json`:
36+
37+
**If installed globally:**
38+
```json
39+
{
40+
"mcpServers": {
41+
"git-metrics": {
42+
"command": "git-metrics-mcp-server",
43+
"args": []
44+
}
45+
}
46+
}
47+
```
48+
49+
**If using npx:**
50+
```json
51+
{
52+
"mcpServers": {
53+
"git-metrics": {
54+
"command": "npx",
55+
"args": ["@jonmatum/git-metrics-mcp-server"]
56+
}
57+
}
58+
}
59+
```
60+
61+
**If running from source:**
62+
```json
63+
{
64+
"mcpServers": {
65+
"git-metrics": {
66+
"command": "npx",
67+
"args": ["tsx", "/path/to/git-metrics-mcp-server/src/git-metrics.ts"]
68+
}
69+
}
70+
}
71+
```
72+
73+
## Available Tools
74+
75+
### get_commit_stats
76+
77+
Get overall commit statistics for a time period.
78+
79+
**Parameters:**
80+
- `repo_path` (required): Path to git repository
81+
- `since` (required): Start date (YYYY-MM-DD)
82+
- `until` (optional): End date (YYYY-MM-DD)
83+
- `author` (optional): Filter by author
84+
85+
**Example:**
86+
```
87+
Get commit stats for /home/user/myproject since 2025-11-01
88+
```
89+
90+
**Returns:**
91+
```json
92+
{
93+
"commits": 45,
94+
"additions": 1250,
95+
"deletions": 380,
96+
"filesChanged": 67,
97+
"netChange": 870
98+
}
99+
```
100+
101+
### get_author_metrics
102+
103+
Detailed metrics per contributor.
104+
105+
**Parameters:**
106+
- `repo_path` (required): Path to git repository
107+
- `since` (required): Start date (YYYY-MM-DD)
108+
- `until` (optional): End date (YYYY-MM-DD)
109+
110+
**Returns:**
111+
```json
112+
{
113+
"John Doe <john@example.com>": {
114+
"commits": 23,
115+
"additions": 650,
116+
"deletions": 120,
117+
"files": 34
118+
}
119+
}
120+
```
121+
122+
### get_file_churn
123+
124+
Files with most changes (indicates complexity or issues).
125+
126+
**Parameters:**
127+
- `repo_path` (required): Path to git repository
128+
- `since` (required): Start date (YYYY-MM-DD)
129+
- `limit` (optional): Number of files, default 10
130+
131+
**Returns:**
132+
```json
133+
[
134+
{ "file": "src/main.ts", "changes": 15 },
135+
{ "file": "src/utils.ts", "changes": 12 }
136+
]
137+
```
138+
139+
### get_team_summary
140+
141+
Comprehensive team performance report.
142+
143+
**Parameters:**
144+
- `repo_path` (required): Path to git repository
145+
- `since` (required): Start date (YYYY-MM-DD)
146+
- `until` (optional): End date (YYYY-MM-DD)
147+
148+
**Returns:**
149+
```json
150+
{
151+
"period": { "since": "2025-11-01", "until": "now" },
152+
"team": {
153+
"totalCommits": 45,
154+
"totalAdditions": 1250,
155+
"totalDeletions": 380,
156+
"contributors": 3
157+
},
158+
"contributors": { ... }
159+
}
160+
```
161+
162+
## Example Queries
163+
164+
**Sprint Review:**
165+
```
166+
Generate a team summary for /home/user/project since 2025-11-01
167+
```
168+
169+
**Individual Performance:**
170+
```
171+
Get commit stats for /home/user/project since 2025-11-01 for author john@example.com
172+
```
173+
174+
**Code Quality Check:**
175+
```
176+
Show me file churn for /home/user/project since 2025-10-01 limit 20
177+
```
178+
179+
**Weekly Standup:**
180+
```
181+
Get author metrics for /home/user/project since 2025-11-15
182+
```
183+
184+
## Use Cases
185+
186+
- **Sprint Retrospectives**: Review team velocity and contribution patterns
187+
- **Performance Reviews**: Data-driven developer assessments
188+
- **Code Quality**: Identify problematic files with high churn
189+
- **Team Balance**: Ensure even workload distribution
190+
- **Onboarding**: Track new developer ramp-up
191+
192+
## KPIs You Can Track
193+
194+
- Commits per developer per week/sprint
195+
- Code volume (lines added/deleted)
196+
- File change frequency
197+
- Code churn (quality indicator)
198+
- Contribution balance across team
199+
- Commit patterns and consistency
200+
201+
## Development
202+
203+
```bash
204+
npm run dev # Run in development mode
205+
npm run build # Build for production
206+
npm start # Run built version
207+
```
208+
209+
## License
210+
211+
MIT - See [LICENSE](LICENSE) file
212+
213+
## Author
214+
215+
Jonatan Mata ([@jonmatum](https://github.com/jonmatum))
216+
217+
## Contributing
218+
219+
Issues and PRs welcome at https://github.com/jonmatum/git-metrics-mcp-server
220+
221+
## Support
222+
223+
- GitHub Issues: https://github.com/jonmatum/git-metrics-mcp-server/issues
224+
- MCP Documentation: https://modelcontextprotocol.io/

0 commit comments

Comments
 (0)