Skip to content

Commit f12304b

Browse files
Prepare for npm and MCP Registry publication
- Add mcpName to package.json for MCP Registry validation - Add server.json for MCP Registry submission - Add comprehensive test suite (43 tests, 98% coverage) - Add ESLint and Prettier configuration - Update README with installation and usage instructions
1 parent 6dc5e12 commit f12304b

11 files changed

Lines changed: 6932 additions & 1043 deletions

File tree

.eslintrc.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"env": {
3+
"es2022": true,
4+
"node": true
5+
},
6+
"extends": [
7+
"eslint:recommended"
8+
],
9+
"parser": "@typescript-eslint/parser",
10+
"parserOptions": {
11+
"ecmaVersion": "latest",
12+
"sourceType": "module"
13+
},
14+
"plugins": [
15+
"@typescript-eslint"
16+
],
17+
"rules": {
18+
"indent": ["error", 2],
19+
"linebreak-style": ["error", "unix"],
20+
"quotes": ["error", "double"],
21+
"semi": ["error", "always"],
22+
"no-unused-vars": "off",
23+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
24+
"no-console": "off"
25+
},
26+
"overrides": [
27+
{
28+
"files": ["**/__tests__/**/*.ts", "**/*.test.ts"],
29+
"env": {
30+
"jest": true
31+
}
32+
}
33+
]
34+
}

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": false,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false
8+
}

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 🦞 MCP Git Enhanced
22

3+
[![Tests](https://img.shields.io/badge/tests-43%20passing-brightgreen)](src/__tests__/)
4+
[![Coverage](https://img.shields.io/badge/coverage-98%25-brightgreen)](coverage/)
5+
[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
6+
37
An enhanced Git MCP (Model Context Protocol) server that provides AI assistants with powerful code review, commit analysis, and branch management capabilities.
48

59
## Features
@@ -151,6 +155,52 @@ npm run dev
151155
node dist/index.js
152156
```
153157

158+
## Testing
159+
160+
This project uses Jest for testing with comprehensive coverage for all Git tool handlers.
161+
162+
```bash
163+
# Run all tests
164+
npm test
165+
166+
# Run tests with coverage report
167+
npm run test:coverage
168+
169+
# Run tests in watch mode
170+
npm run test:watch
171+
```
172+
173+
### Coverage Report
174+
175+
| File | Statements | Branches | Functions | Lines |
176+
|-----------|------------|----------|-----------|--------|
177+
| tools.ts | 98%+ | 95%+ | 100% | 98%+ |
178+
179+
### Test Structure
180+
181+
- `src/__tests__/tools.test.ts` - Unit tests for all 5 Git tool handlers
182+
- `git_diff` - 7 test cases
183+
- `git_log` - 13 test cases
184+
- `git_branch` - 10 test cases (list, compare, suggest_cleanup)
185+
- `git_status` - 5 test cases
186+
- `git_commit_analyze` - 4 test cases
187+
188+
## Code Quality
189+
190+
```bash
191+
# Run ESLint
192+
npm run lint
193+
194+
# Fix ESLint issues
195+
npm run lint:fix
196+
197+
# Format with Prettier
198+
npm run format
199+
200+
# Check formatting
201+
npm run format:check
202+
```
203+
154204
## Requirements
155205

156206
- Node.js >= 18.0.0

jest.config.cjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/** @type {import('jest').Config} */
2+
module.exports = {
3+
preset: 'ts-jest/presets/default-esm',
4+
testEnvironment: 'node',
5+
extensionsToTreatAsEsm: ['.ts'],
6+
moduleNameMapper: {
7+
'^(\\.{1,2}/.*)\\.js$': '$1',
8+
},
9+
transform: {
10+
'^.+\\.tsx?$': [
11+
'ts-jest',
12+
{
13+
useESM: true,
14+
},
15+
],
16+
},
17+
coverageDirectory: 'coverage',
18+
coverageReporters: ['text', 'text-summary', 'lcov', 'html'],
19+
collectCoverageFrom: [
20+
'src/**/*.ts',
21+
'!src/**/*.d.ts',
22+
'!src/__tests__/**',
23+
],
24+
testMatch: ['**/__tests__/**/*.test.ts'],
25+
verbose: true,
26+
};

0 commit comments

Comments
 (0)