@andrebuzeli/git-mcp 10.0.2 → 10.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -56
- package/dist/index.js +1 -4
- package/dist/tools/gitAnalytics.d.ts +1 -0
- package/dist/tools/gitAnalytics.js +6 -5
- package/dist/tools/gitArchive.d.ts +0 -8
- package/dist/tools/gitArchive.js +4 -12
- package/dist/tools/gitBackup.js +7 -7
- package/dist/tools/gitFix.js +7 -7
- package/dist/tools/gitFix.tool.js +4 -4
- package/dist/tools/gitHistory.d.ts +2 -25
- package/dist/tools/gitHistory.js +4 -25
- package/dist/tools/gitIgnore.d.ts +2 -14
- package/dist/tools/gitIgnore.js +5 -17
- package/dist/tools/gitIssues.d.ts +0 -4
- package/dist/tools/gitIssues.js +12 -18
- package/dist/tools/gitMonitor.js +1 -1
- package/dist/tools/gitPackages.d.ts +28 -0
- package/dist/tools/gitPackages.js +29 -1
- package/dist/tools/gitPulls.d.ts +60 -0
- package/dist/tools/gitPulls.js +68 -4
- package/dist/tools/gitRelease.d.ts +43 -0
- package/dist/tools/gitRelease.js +48 -4
- package/dist/tools/gitRemote.d.ts +23 -0
- package/dist/tools/gitRemote.js +23 -0
- package/dist/tools/gitReset.d.ts +23 -0
- package/dist/tools/gitReset.js +23 -0
- package/dist/tools/gitStash.d.ts +31 -0
- package/dist/tools/gitStash.js +31 -0
- package/dist/tools/gitSync.d.ts +6 -2
- package/dist/tools/gitSync.js +10 -6
- package/dist/tools/gitTags.d.ts +31 -0
- package/dist/tools/gitTags.js +31 -0
- package/dist/tools/gitUpdate.d.ts +0 -27
- package/dist/tools/gitUpdate.js +1 -26
- package/dist/tools/gitUpload.d.ts +1 -9
- package/dist/tools/gitUpload.js +5 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,26 +102,47 @@ npx @andrebuzeli/git-mcp@latest
|
|
|
102
102
|
|
|
103
103
|
### Configuration
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
Configure the git-mcp server in your MCP client's configuration file (e.g., Cursor's mcp.json, Claude Desktop's config, etc.):
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"mcpServers": {
|
|
110
|
+
"git-mcp": {
|
|
111
|
+
"command": "npx",
|
|
112
|
+
"args": ["@andrebuzeli/git-mcp@latest"],
|
|
113
|
+
"env": {
|
|
114
|
+
"GITHUB_USERNAME": "your-github-username",
|
|
115
|
+
"GITHUB_TOKEN": "ghp_your_github_token_here",
|
|
116
|
+
"GITEA_USERNAME": "your-gitea-username",
|
|
117
|
+
"GITEA_TOKEN": "your_gitea_token_here",
|
|
118
|
+
"GITEA_URL": "https://your-gitea-instance.com/",
|
|
119
|
+
"DEBUG": "false"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
111
124
|
```
|
|
112
125
|
|
|
113
|
-
|
|
126
|
+
**The MCP client automatically passes these environment variables to the git-mcp server - no additional configuration files needed!**
|
|
127
|
+
|
|
128
|
+
#### Alternative: Direct Environment Variables
|
|
129
|
+
If running the server directly (not through MCP client):
|
|
130
|
+
|
|
114
131
|
```bash
|
|
132
|
+
export GITHUB_TOKEN="your_github_token"
|
|
133
|
+
export GITHUB_USERNAME="your_username"
|
|
115
134
|
export GITEA_URL="https://your-gitea-instance.com"
|
|
116
135
|
export GITEA_TOKEN="your_gitea_token"
|
|
117
136
|
export GITEA_USERNAME="your_username"
|
|
118
137
|
```
|
|
119
138
|
|
|
120
|
-
PowerShell (Windows)
|
|
139
|
+
#### PowerShell (Windows)
|
|
121
140
|
```powershell
|
|
122
141
|
$env:GITEA_URL = 'https://your-gitea-instance.com'
|
|
123
142
|
$env:GITEA_TOKEN = 'your_gitea_token'
|
|
124
143
|
$env:GITEA_USERNAME = 'your_username'
|
|
144
|
+
$env:GITHUB_TOKEN = 'your_github_token'
|
|
145
|
+
$env:GITHUB_USERNAME = 'your_username'
|
|
125
146
|
```
|
|
126
147
|
|
|
127
148
|
#### Multi-Provider Support
|
|
@@ -332,63 +353,23 @@ All tools provide detailed error messages with actionable solutions:
|
|
|
332
353
|
| `DETACHED_HEAD` | Repository in detached HEAD state | Create branch or checkout existing |
|
|
333
354
|
| `REF_LOCK_ERROR` | Cannot lock Git reference | Wait for other operations to complete |
|
|
334
355
|
|
|
335
|
-
##
|
|
336
|
-
|
|
337
|
-
### Environment Variables
|
|
338
|
-
|
|
339
|
-
**Required for GitHub:**
|
|
340
|
-
- `GITHUB_TOKEN` - Personal access token with repo permissions
|
|
341
|
-
- `GITHUB_USERNAME` - Your GitHub username
|
|
356
|
+
## Setup Instructions
|
|
342
357
|
|
|
343
|
-
**
|
|
344
|
-
- `GITEA_URL` - Your Gitea instance URL (e.g., `https://git.example.com`)
|
|
345
|
-
- `GITEA_TOKEN` - Personal access token
|
|
346
|
-
- `GITEA_USERNAME` - Your Gitea username
|
|
358
|
+
1. **Configure your MCP client** with the git-mcp server and your credentials (see Configuration section above)
|
|
347
359
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
The server automatically validates credentials on startup:
|
|
351
|
-
|
|
352
|
-
- ✅ **Valid credentials** - API connectivity confirmed
|
|
353
|
-
- ❌ **Invalid token** - Authentication failed
|
|
354
|
-
- 🌐 **Network error** - Cannot reach provider API
|
|
355
|
-
- ⚠️ **Partial failure** - Some providers failed validation
|
|
356
|
-
|
|
357
|
-
### Setup Instructions
|
|
358
|
-
|
|
359
|
-
1. **Generate GitHub Token:**
|
|
360
|
+
2. **Generate GitHub Token:**
|
|
360
361
|
- Go to GitHub Settings → Developer settings → Personal access tokens
|
|
361
362
|
- Create token with `repo` scope
|
|
362
|
-
-
|
|
363
|
+
- Add to your MCP client configuration
|
|
363
364
|
|
|
364
|
-
|
|
365
|
+
3. **Generate Gitea Token:**
|
|
365
366
|
- Go to your Gitea instance → Settings → Applications
|
|
366
367
|
- Generate new token with appropriate permissions
|
|
367
|
-
-
|
|
368
|
-
|
|
369
|
-
3. **Test Configuration:**
|
|
370
|
-
```bash
|
|
371
|
-
# Start the server to see validation results
|
|
372
|
-
npx @andrebuzeli/git-mcp@latest
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
Optional: use a local `mcp.json` (NOT committed) to keep credentials for local testing.
|
|
376
|
-
|
|
377
|
-
1. Create `mcp.json` next to package.json with this shape (use the `.example` as a starting point):
|
|
378
|
-
|
|
379
|
-
```json
|
|
380
|
-
{
|
|
381
|
-
"env": {
|
|
382
|
-
"GITEA_URL": "http://nas-ubuntu:3000",
|
|
383
|
-
"GITEA_TOKEN": "<GITEA_TOKEN>",
|
|
384
|
-
"GITEA_USERNAME": "<GITEA_USERNAME>",
|
|
385
|
-
"GITHUB_TOKEN": "<GITHUB_TOKEN>",
|
|
386
|
-
"GITHUB_USERNAME": "<GITHUB_USERNAME>"
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
```
|
|
368
|
+
- Add to your MCP client configuration
|
|
390
369
|
|
|
391
|
-
|
|
370
|
+
4. **Test Configuration:**
|
|
371
|
+
- Restart your MCP client
|
|
372
|
+
- Try using git-mcp tools in your IDE
|
|
392
373
|
|
|
393
374
|
## Troubleshooting
|
|
394
375
|
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
5
|
import { ProviderManager } from './providers/providerManager.js';
|
|
6
|
-
import { loadMCPConfig } from './config.js';
|
|
7
6
|
import { IsomorphicGitAdapter } from './utils/gitAdapter.js';
|
|
8
7
|
import { GitFilesTool } from './tools/gitFiles.js';
|
|
9
8
|
import { GitWorkflowTool } from './tools/gitWorkflow.js';
|
|
@@ -30,8 +29,6 @@ import { GitIgnoreTool } from './tools/gitIgnore.js';
|
|
|
30
29
|
import { GIT_PROMPTS } from './prompts/gitPrompts.js';
|
|
31
30
|
import TOOLS_GUIDE from './resources/toolsGuide.js';
|
|
32
31
|
async function main() {
|
|
33
|
-
// Load optional mcp.json configuration (will populate process.env if values present)
|
|
34
|
-
loadMCPConfig();
|
|
35
32
|
const providerManager = new ProviderManager();
|
|
36
33
|
const gitAdapter = new IsomorphicGitAdapter(providerManager);
|
|
37
34
|
// Skip validation on startup to prevent hanging (validation happens on first use)
|
|
@@ -82,7 +79,7 @@ async function main() {
|
|
|
82
79
|
tools: tools.map(tool => ({
|
|
83
80
|
name: tool.name,
|
|
84
81
|
description: tool.description,
|
|
85
|
-
inputSchema: {
|
|
82
|
+
inputSchema: tool.inputSchema || {
|
|
86
83
|
type: 'object',
|
|
87
84
|
properties: {},
|
|
88
85
|
additionalProperties: true,
|
|
@@ -10,24 +10,25 @@ export class GitAnalyticsTool {
|
|
|
10
10
|
properties: {
|
|
11
11
|
projectPath: {
|
|
12
12
|
type: "string",
|
|
13
|
-
description: "
|
|
13
|
+
description: "The absolute path to the Git repository directory on the local filesystem. This should be the root directory containing the .git folder. For example: '/home/user/my-project' on Linux/Mac or 'C:\\Users\\user\\my-project' on Windows.",
|
|
14
|
+
examples: ["/home/user/my-repo", "C:\\Users\\user\\my-repo"]
|
|
14
15
|
},
|
|
15
16
|
action: {
|
|
16
17
|
type: "string",
|
|
17
18
|
enum: ["stats", "commits", "contributors"],
|
|
18
|
-
description: "
|
|
19
|
+
description: "The analytics operation to perform: 'stats' for repository statistics, 'commits' for commit history analysis, 'contributors' for contributor statistics."
|
|
19
20
|
},
|
|
20
21
|
limit: {
|
|
21
22
|
type: "number",
|
|
22
|
-
description: "Maximum number of commits to return (optional for commits action
|
|
23
|
+
description: "Maximum number of commits to return (optional, default: 100, only used for 'commits' action)"
|
|
23
24
|
},
|
|
24
25
|
since: {
|
|
25
26
|
type: "string",
|
|
26
|
-
description: "Start date for commits/contributors
|
|
27
|
+
description: "Start date for filtering commits/contributors in ISO 8601 format (optional, e.g., '2023-01-01T00:00:00Z')"
|
|
27
28
|
},
|
|
28
29
|
until: {
|
|
29
30
|
type: "string",
|
|
30
|
-
description: "End date for commits/contributors
|
|
31
|
+
description: "End date for filtering commits/contributors in ISO 8601 format (optional, e.g., '2024-01-01T00:00:00Z')"
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
required: ["projectPath", "action"],
|
|
@@ -14,10 +14,6 @@ export declare class GitArchiveTool implements Tool {
|
|
|
14
14
|
enum: string[];
|
|
15
15
|
description: string;
|
|
16
16
|
};
|
|
17
|
-
archiveName: {
|
|
18
|
-
type: string;
|
|
19
|
-
description: string;
|
|
20
|
-
};
|
|
21
17
|
outputPath: {
|
|
22
18
|
type: string;
|
|
23
19
|
description: string;
|
|
@@ -31,10 +27,6 @@ export declare class GitArchiveTool implements Tool {
|
|
|
31
27
|
type: string;
|
|
32
28
|
description: string;
|
|
33
29
|
};
|
|
34
|
-
archivePath: {
|
|
35
|
-
type: string;
|
|
36
|
-
description: string;
|
|
37
|
-
};
|
|
38
30
|
};
|
|
39
31
|
required: string[];
|
|
40
32
|
additionalProperties: boolean;
|
package/dist/tools/gitArchive.js
CHANGED
|
@@ -10,20 +10,16 @@ export class GitArchiveTool {
|
|
|
10
10
|
properties: {
|
|
11
11
|
projectPath: {
|
|
12
12
|
type: "string",
|
|
13
|
-
description: "
|
|
13
|
+
description: "The absolute path to the Git repository directory on the local filesystem. This should be the root directory containing the .git folder. For example: '/home/user/my-project' on Linux/Mac or 'C:\\Users\\user\\my-project' on Windows."
|
|
14
14
|
},
|
|
15
15
|
action: {
|
|
16
16
|
type: "string",
|
|
17
|
-
enum: ["create", "
|
|
18
|
-
description: "
|
|
19
|
-
},
|
|
20
|
-
archiveName: {
|
|
21
|
-
type: "string",
|
|
22
|
-
description: "Name for the archive file (optional for create, default: timestamp-based)"
|
|
17
|
+
enum: ["create", "extract"],
|
|
18
|
+
description: "Archive operation to perform: create (create archive), extract (extract archive)"
|
|
23
19
|
},
|
|
24
20
|
outputPath: {
|
|
25
21
|
type: "string",
|
|
26
|
-
description: "Output
|
|
22
|
+
description: "Output archive file path (required for create)"
|
|
27
23
|
},
|
|
28
24
|
format: {
|
|
29
25
|
type: "string",
|
|
@@ -33,10 +29,6 @@ export class GitArchiveTool {
|
|
|
33
29
|
ref: {
|
|
34
30
|
type: "string",
|
|
35
31
|
description: "Git reference to archive (optional for create, default: HEAD)"
|
|
36
|
-
},
|
|
37
|
-
archivePath: {
|
|
38
|
-
type: "string",
|
|
39
|
-
description: "Path to archive file (required for verify/extract)"
|
|
40
32
|
}
|
|
41
33
|
},
|
|
42
34
|
required: ["projectPath", "action"],
|
package/dist/tools/gitBackup.js
CHANGED
|
@@ -11,28 +11,28 @@ export class GitBackupTool {
|
|
|
11
11
|
properties: {
|
|
12
12
|
projectPath: {
|
|
13
13
|
type: "string",
|
|
14
|
-
description: "
|
|
14
|
+
description: "The absolute path to the Git repository directory on the local filesystem. This should be the root directory containing the .git folder. For example: '/home/user/my-project' on Linux/Mac or 'C:\\Users\\user\\my-project' on Windows."
|
|
15
15
|
},
|
|
16
16
|
action: {
|
|
17
17
|
type: "string",
|
|
18
|
-
enum: ["
|
|
19
|
-
description: "
|
|
18
|
+
enum: ["create", "restore", "list", "delete"],
|
|
19
|
+
description: "Backup operation to perform: create (create backup), restore (restore from backup), list (list backups), delete (delete backup)"
|
|
20
20
|
},
|
|
21
21
|
backupPath: {
|
|
22
22
|
type: "string",
|
|
23
|
-
description: "Path to backup file (required for restore/
|
|
23
|
+
description: "Path to backup file (required for create/restore/delete)"
|
|
24
24
|
},
|
|
25
25
|
compress: {
|
|
26
26
|
type: "boolean",
|
|
27
|
-
description: "Compress backup (optional for
|
|
27
|
+
description: "Compress backup (optional for create, default: true)"
|
|
28
28
|
},
|
|
29
29
|
confirm: {
|
|
30
30
|
type: "boolean",
|
|
31
|
-
description: "Confirm destructive operations (optional for restore)"
|
|
31
|
+
description: "Confirm destructive operations (optional for restore/delete)"
|
|
32
32
|
},
|
|
33
33
|
name: {
|
|
34
34
|
type: "string",
|
|
35
|
-
description: "Backup name (optional for
|
|
35
|
+
description: "Backup name (optional for create)"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
required: ["projectPath", "action"],
|
package/dist/tools/gitFix.js
CHANGED
|
@@ -2,6 +2,7 @@ import simpleGit from 'simple-git';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import fs from 'fs/promises';
|
|
4
4
|
import { existsSync } from 'fs';
|
|
5
|
+
import { buildGitHubUrl, buildGiteaUrl } from '../utils/repoHelpers.js';
|
|
5
6
|
export async function handleGitFix(args) {
|
|
6
7
|
try {
|
|
7
8
|
const { projectPath, githubRepo, giteaRepo, autoDetect = true } = args;
|
|
@@ -106,16 +107,15 @@ export async function handleGitFix(args) {
|
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
// Adicionar novos remotes no padrão dual
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
const giteaRepoUrl = `${giteaUrl}/${finalGiteaRepo}.git`;
|
|
110
|
+
const githubUrl = buildGitHubUrl(finalGithubRepo.split('/')[0], finalGithubRepo.split('/')[1]);
|
|
111
|
+
const giteaUrlFull = buildGiteaUrl(finalGiteaRepo.split('/')[0], finalGiteaRepo.split('/')[1]);
|
|
112
112
|
await git.addRemote('github', githubUrl);
|
|
113
|
-
result.fixed.push(`✅ Adicionado remote GitHub: ${githubUrl}`);
|
|
114
|
-
await git.addRemote('gitea',
|
|
115
|
-
result.fixed.push(`✅ Adicionado remote Gitea: ${
|
|
113
|
+
result.fixed.push(`✅ Adicionado remote GitHub: ${githubUrl.replace(/oauth2:[^@]+@/, 'oauth2:***@')}`);
|
|
114
|
+
await git.addRemote('gitea', giteaUrlFull);
|
|
115
|
+
result.fixed.push(`✅ Adicionado remote Gitea: ${giteaUrlFull.replace(/:[^:]+@/, ':***@')}`);
|
|
116
116
|
// Configurar origin como push múltiplo
|
|
117
117
|
await git.addRemote('origin', githubUrl);
|
|
118
|
-
await git.addConfig('remote.origin.pushurl',
|
|
118
|
+
await git.addConfig('remote.origin.pushurl', giteaUrlFull, false, 'local');
|
|
119
119
|
result.fixed.push(`✅ Configurado origin para push dual (GitHub + Gitea)`);
|
|
120
120
|
// Capturar remotes depois
|
|
121
121
|
const remotesAfter = await git.getRemotes(true);
|
|
@@ -67,19 +67,19 @@ export class GitFixTool {
|
|
|
67
67
|
properties: {
|
|
68
68
|
projectPath: {
|
|
69
69
|
type: "string",
|
|
70
|
-
description: "
|
|
70
|
+
description: "The absolute path to the Git repository directory on the local filesystem. This should be the root directory containing the .git folder. For example: '/home/user/my-project' on Linux/Mac or 'C:\\Users\\user\\my-project' on Windows."
|
|
71
71
|
},
|
|
72
72
|
githubRepo: {
|
|
73
73
|
type: "string",
|
|
74
|
-
description: "GitHub repo in format
|
|
74
|
+
description: "GitHub repo in format \"owner/repo\" (auto-detected if not provided)"
|
|
75
75
|
},
|
|
76
76
|
giteaRepo: {
|
|
77
77
|
type: "string",
|
|
78
|
-
description: "Gitea repo in format
|
|
78
|
+
description: "Gitea repo in format \"owner/repo\" (auto-detected if not provided)"
|
|
79
79
|
},
|
|
80
80
|
autoDetect: {
|
|
81
81
|
type: "boolean",
|
|
82
|
-
description: "Auto-detect repos from existing remotes (
|
|
82
|
+
description: "Auto-detect repos from existing remotes (default: true)"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
required: ["projectPath"],
|
|
@@ -10,36 +10,13 @@ export declare class GitHistoryTool implements Tool {
|
|
|
10
10
|
inputSchema: {
|
|
11
11
|
type: "object";
|
|
12
12
|
properties: {
|
|
13
|
-
action: {
|
|
14
|
-
type: string;
|
|
15
|
-
enum: string[];
|
|
16
|
-
description: string;
|
|
17
|
-
};
|
|
18
13
|
projectPath: {
|
|
19
14
|
type: string;
|
|
20
15
|
description: string;
|
|
21
16
|
};
|
|
22
|
-
|
|
23
|
-
type: string;
|
|
24
|
-
description: string;
|
|
25
|
-
};
|
|
26
|
-
message: {
|
|
27
|
-
type: string;
|
|
28
|
-
description: string;
|
|
29
|
-
};
|
|
30
|
-
title: {
|
|
31
|
-
type: string;
|
|
32
|
-
description: string;
|
|
33
|
-
};
|
|
34
|
-
tags: {
|
|
35
|
-
type: string;
|
|
36
|
-
items: {
|
|
37
|
-
type: string;
|
|
38
|
-
};
|
|
39
|
-
description: string;
|
|
40
|
-
};
|
|
41
|
-
category: {
|
|
17
|
+
action: {
|
|
42
18
|
type: string;
|
|
19
|
+
enum: string[];
|
|
43
20
|
description: string;
|
|
44
21
|
};
|
|
45
22
|
owner: {
|
package/dist/tools/gitHistory.js
CHANGED
|
@@ -16,35 +16,14 @@ export class GitHistoryTool {
|
|
|
16
16
|
this.inputSchema = {
|
|
17
17
|
type: "object",
|
|
18
18
|
properties: {
|
|
19
|
-
action: {
|
|
20
|
-
type: "string",
|
|
21
|
-
enum: ["track", "list", "sync", "report"],
|
|
22
|
-
description: "History operation to perform"
|
|
23
|
-
},
|
|
24
19
|
projectPath: {
|
|
25
20
|
type: "string",
|
|
26
|
-
description: "
|
|
21
|
+
description: "The absolute path to the Git repository directory on the local filesystem. This should be the root directory containing the .git folder. For example: '/home/user/my-project' on Linux/Mac or 'C:\\Users\\user\\my-project' on Windows."
|
|
27
22
|
},
|
|
28
|
-
|
|
29
|
-
type: "string",
|
|
30
|
-
description: "Description of the change being tracked - optional for track action"
|
|
31
|
-
},
|
|
32
|
-
message: {
|
|
33
|
-
type: "string",
|
|
34
|
-
description: "Alternative name for description - optional for track action"
|
|
35
|
-
},
|
|
36
|
-
title: {
|
|
37
|
-
type: "string",
|
|
38
|
-
description: "Custom title for the history issue - optional for track action"
|
|
39
|
-
},
|
|
40
|
-
tags: {
|
|
41
|
-
type: "array",
|
|
42
|
-
items: { type: "string" },
|
|
43
|
-
description: "Tags to categorize the change - optional for track action"
|
|
44
|
-
},
|
|
45
|
-
category: {
|
|
23
|
+
action: {
|
|
46
24
|
type: "string",
|
|
47
|
-
|
|
25
|
+
enum: ["track", "list", "sync", "report"],
|
|
26
|
+
description: "History operation to perform: track (track changes), list (list history), sync (sync to remote), report (generate report)"
|
|
48
27
|
},
|
|
49
28
|
owner: {
|
|
50
29
|
type: "string",
|
|
@@ -9,17 +9,13 @@ export declare class GitIgnoreTool implements Tool {
|
|
|
9
9
|
inputSchema: {
|
|
10
10
|
type: "object";
|
|
11
11
|
properties: {
|
|
12
|
-
action: {
|
|
13
|
-
type: string;
|
|
14
|
-
enum: string[];
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
12
|
projectPath: {
|
|
18
13
|
type: string;
|
|
19
14
|
description: string;
|
|
20
15
|
};
|
|
21
|
-
|
|
16
|
+
action: {
|
|
22
17
|
type: string;
|
|
18
|
+
enum: string[];
|
|
23
19
|
description: string;
|
|
24
20
|
};
|
|
25
21
|
patterns: {
|
|
@@ -29,14 +25,6 @@ export declare class GitIgnoreTool implements Tool {
|
|
|
29
25
|
};
|
|
30
26
|
description: string;
|
|
31
27
|
};
|
|
32
|
-
comment: {
|
|
33
|
-
type: string;
|
|
34
|
-
description: string;
|
|
35
|
-
};
|
|
36
|
-
content: {
|
|
37
|
-
type: string;
|
|
38
|
-
description: string;
|
|
39
|
-
};
|
|
40
28
|
};
|
|
41
29
|
required: string[];
|
|
42
30
|
additionalProperties: boolean;
|
package/dist/tools/gitIgnore.js
CHANGED
|
@@ -12,31 +12,19 @@ export class GitIgnoreTool {
|
|
|
12
12
|
this.inputSchema = {
|
|
13
13
|
type: "object",
|
|
14
14
|
properties: {
|
|
15
|
-
action: {
|
|
16
|
-
type: "string",
|
|
17
|
-
enum: ["read", "create", "ensure", "add", "remove", "update", "clear"],
|
|
18
|
-
description: "Git ignore operation to perform"
|
|
19
|
-
},
|
|
20
15
|
projectPath: {
|
|
21
16
|
type: "string",
|
|
22
|
-
description: "
|
|
17
|
+
description: "The absolute path to the Git repository directory on the local filesystem. This should be the root directory containing the .git folder. For example: '/home/user/my-project' on Linux/Mac or 'C:\\Users\\user\\my-project' on Windows."
|
|
23
18
|
},
|
|
24
|
-
|
|
19
|
+
action: {
|
|
25
20
|
type: "string",
|
|
26
|
-
|
|
21
|
+
enum: ["create", "add", "remove", "read"],
|
|
22
|
+
description: "Action: create, add, remove, read"
|
|
27
23
|
},
|
|
28
24
|
patterns: {
|
|
29
25
|
type: "array",
|
|
30
26
|
items: { type: "string" },
|
|
31
|
-
description: "
|
|
32
|
-
},
|
|
33
|
-
comment: {
|
|
34
|
-
type: "string",
|
|
35
|
-
description: "Comment to add before patterns - optional for add action"
|
|
36
|
-
},
|
|
37
|
-
content: {
|
|
38
|
-
type: "string",
|
|
39
|
-
description: "Complete .gitignore content to write - required for update action"
|
|
27
|
+
description: "Patterns to add/remove"
|
|
40
28
|
}
|
|
41
29
|
},
|
|
42
30
|
required: ["projectPath", "action"],
|
package/dist/tools/gitIssues.js
CHANGED
|
@@ -9,20 +9,16 @@ export class GitIssuesTool {
|
|
|
9
9
|
properties: {
|
|
10
10
|
projectPath: {
|
|
11
11
|
type: "string",
|
|
12
|
-
description: "
|
|
12
|
+
description: "The absolute path to the Git repository directory on the local filesystem. This should be the root directory containing the .git folder. For example: '/home/user/my-project' on Linux/Mac or 'C:\\Users\\user\\my-project' on Windows."
|
|
13
13
|
},
|
|
14
14
|
action: {
|
|
15
15
|
type: "string",
|
|
16
16
|
enum: ["create", "list", "get", "update", "close", "comment", "search"],
|
|
17
|
-
description: "
|
|
18
|
-
},
|
|
19
|
-
repo: {
|
|
20
|
-
type: "string",
|
|
21
|
-
description: "Repository name (required if projectPath not provided)"
|
|
17
|
+
description: "Issue operation to perform: create (create issue), list (list issues), get (get issue details), update (update issue), close (close issue), comment (add comment), search (search issues)"
|
|
22
18
|
},
|
|
23
19
|
title: {
|
|
24
20
|
type: "string",
|
|
25
|
-
description: "Issue title (required for create)"
|
|
21
|
+
description: "Issue title (required for create action)"
|
|
26
22
|
},
|
|
27
23
|
body: {
|
|
28
24
|
type: "string",
|
|
@@ -49,7 +45,7 @@ export class GitIssuesTool {
|
|
|
49
45
|
state: {
|
|
50
46
|
type: "string",
|
|
51
47
|
enum: ["open", "closed"],
|
|
52
|
-
description: "Issue state (optional for update)"
|
|
48
|
+
description: "Issue state: open, closed (optional for update)"
|
|
53
49
|
},
|
|
54
50
|
state_filter: {
|
|
55
51
|
type: "string",
|
|
@@ -75,24 +71,22 @@ export class GitIssuesTool {
|
|
|
75
71
|
description: "Search query (required for search action)"
|
|
76
72
|
}
|
|
77
73
|
},
|
|
78
|
-
required: ["action"],
|
|
74
|
+
required: ["projectPath", "action"],
|
|
79
75
|
additionalProperties: true
|
|
80
76
|
};
|
|
81
77
|
}
|
|
82
78
|
async handle(params, ctx) {
|
|
83
79
|
params = normalizeToolParams(params);
|
|
84
80
|
const action = params.action;
|
|
81
|
+
const projectPath = params.projectPath;
|
|
85
82
|
if (!action)
|
|
86
83
|
throw new MCPError('VALIDATION_ERROR', 'action is required');
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
// Each provider uses its own username from env
|
|
94
|
-
const githubOwner = process.env.GITHUB_USERNAME;
|
|
95
|
-
const giteaOwner = process.env.GITEA_USERNAME;
|
|
84
|
+
if (!projectPath)
|
|
85
|
+
throw new MCPError('VALIDATION_ERROR', 'projectPath is required');
|
|
86
|
+
const repoInfo = getRepoInfo(projectPath);
|
|
87
|
+
const repo = repoInfo.repoName;
|
|
88
|
+
const githubOwner = repoInfo.githubOwner || process.env.GITHUB_USERNAME;
|
|
89
|
+
const giteaOwner = repoInfo.giteaOwner || process.env.GITEA_USERNAME;
|
|
96
90
|
switch (action) {
|
|
97
91
|
case 'create': {
|
|
98
92
|
if (!params.title)
|
package/dist/tools/gitMonitor.js
CHANGED
|
@@ -11,7 +11,7 @@ export class GitMonitorTool {
|
|
|
11
11
|
properties: {
|
|
12
12
|
projectPath: {
|
|
13
13
|
type: "string",
|
|
14
|
-
description: "
|
|
14
|
+
description: "The absolute path to the Git repository directory on the local filesystem. This should be the root directory containing the .git folder. For example: '/home/user/my-project' on Linux/Mac or 'C:\\Users\\user\\my-project' on Windows."
|
|
15
15
|
},
|
|
16
16
|
action: {
|
|
17
17
|
type: "string",
|
|
@@ -2,6 +2,34 @@ import { Tool, MCPContext } from '../types.js';
|
|
|
2
2
|
export declare class GitPackagesTool implements Tool {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
projectPath: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
action: {
|
|
13
|
+
type: string;
|
|
14
|
+
enum: string[];
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
confirm: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
packageName: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
packageType: {
|
|
26
|
+
type: string;
|
|
27
|
+
enum: string[];
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
required: string[];
|
|
32
|
+
};
|
|
5
33
|
handle(params: Record<string, any>, ctx: MCPContext): Promise<{
|
|
6
34
|
success: boolean;
|
|
7
35
|
name: any;
|