@andre.buzeli/git-mcp 16.0.8 → 16.1.2
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/package.json +32 -29
- package/src/index.js +159 -147
- package/src/tools/git-branches.js +13 -3
- package/src/tools/git-clone.js +48 -85
- package/src/tools/git-config.js +13 -3
- package/src/tools/git-diff.js +121 -137
- package/src/tools/git-files.js +13 -3
- package/src/tools/git-help.js +322 -284
- package/src/tools/git-history.js +13 -3
- package/src/tools/git-ignore.js +13 -3
- package/src/tools/git-issues.js +13 -3
- package/src/tools/git-merge.js +13 -3
- package/src/tools/git-pulls.js +14 -4
- package/src/tools/git-remote.js +503 -492
- package/src/tools/git-reset.js +23 -4
- package/src/tools/git-stash.js +13 -3
- package/src/tools/git-sync.js +13 -3
- package/src/tools/git-tags.js +13 -3
- package/src/tools/git-workflow.js +599 -456
- package/src/tools/git-worktree.js +180 -0
- package/src/utils/errors.js +434 -433
- package/src/utils/gitAdapter.js +118 -6
- package/src/utils/mcpNotify.js +45 -0
- package/src/utils/repoHelpers.js +5 -31
- package/src/utils/hooks.js +0 -255
- package/src/utils/metrics.js +0 -198
package/src/tools/git-history.js
CHANGED
|
@@ -10,7 +10,7 @@ export function createGitHistoryTool(git) {
|
|
|
10
10
|
properties: {
|
|
11
11
|
projectPath: {
|
|
12
12
|
type: "string",
|
|
13
|
-
description: "Caminho absoluto do diretório do projeto"
|
|
13
|
+
description: "Caminho absoluto do diretório do projeto no IDE (ex: '/home/user/meu-projeto' ou 'C:/Users/user/meu-projeto'). IMPORTANTE: este valor não pode ser inferido automaticamente pelo servidor — o agente deve fornecer o path real do projeto sendo trabalhado, não o diretório home do usuário."
|
|
14
14
|
},
|
|
15
15
|
action: {
|
|
16
16
|
type: "string",
|
|
@@ -30,7 +30,11 @@ export function createGitHistoryTool(git) {
|
|
|
30
30
|
additionalProperties: false
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const description = `
|
|
33
|
+
const description = `IMPORTANTE — projectPath:
|
|
34
|
+
Informe o caminho absoluto do projeto aberto no IDE. O servidor MCP não tem acesso ao
|
|
35
|
+
contexto do IDE e não consegue detectar automaticamente qual projeto está sendo trabalhado.
|
|
36
|
+
|
|
37
|
+
Histórico de commits do repositório Git.
|
|
34
38
|
|
|
35
39
|
QUANDO USAR:
|
|
36
40
|
- Ver commits recentes
|
|
@@ -86,5 +90,11 @@ EXEMPLOS:
|
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
92
|
|
|
89
|
-
return {
|
|
93
|
+
return {
|
|
94
|
+
name: "git-history",
|
|
95
|
+
description,
|
|
96
|
+
inputSchema,
|
|
97
|
+
handle,
|
|
98
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
|
|
99
|
+
};
|
|
90
100
|
}
|
package/src/tools/git-ignore.js
CHANGED
|
@@ -11,7 +11,7 @@ export function createGitIgnoreTool(git) {
|
|
|
11
11
|
properties: {
|
|
12
12
|
projectPath: {
|
|
13
13
|
type: "string",
|
|
14
|
-
description: "Caminho absoluto do diretório do projeto"
|
|
14
|
+
description: "Caminho absoluto do diretório do projeto no IDE (ex: '/home/user/meu-projeto' ou 'C:/Users/user/meu-projeto'). IMPORTANTE: este valor não pode ser inferido automaticamente pelo servidor — o agente deve fornecer o path real do projeto sendo trabalhado, não o diretório home do usuário."
|
|
15
15
|
},
|
|
16
16
|
action: {
|
|
17
17
|
type: "string",
|
|
@@ -32,7 +32,11 @@ export function createGitIgnoreTool(git) {
|
|
|
32
32
|
additionalProperties: false
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
const description = `
|
|
35
|
+
const description = `IMPORTANTE — projectPath:
|
|
36
|
+
Informe o caminho absoluto do projeto aberto no IDE. O servidor MCP não tem acesso ao
|
|
37
|
+
contexto do IDE e não consegue detectar automaticamente qual projeto está sendo trabalhado.
|
|
38
|
+
|
|
39
|
+
Gerenciamento do arquivo .gitignore.
|
|
36
40
|
|
|
37
41
|
PADRÕES COMUNS:
|
|
38
42
|
- node_modules/: Dependências Node.js
|
|
@@ -95,5 +99,11 @@ EXEMPLOS:
|
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
|
|
98
|
-
return {
|
|
102
|
+
return {
|
|
103
|
+
name: "git-ignore",
|
|
104
|
+
description,
|
|
105
|
+
inputSchema,
|
|
106
|
+
handle,
|
|
107
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }
|
|
108
|
+
};
|
|
99
109
|
}
|
package/src/tools/git-issues.js
CHANGED
|
@@ -12,7 +12,7 @@ export function createGitIssuesTool(pm) {
|
|
|
12
12
|
properties: {
|
|
13
13
|
projectPath: {
|
|
14
14
|
type: "string",
|
|
15
|
-
description: "Caminho absoluto do diretório do projeto"
|
|
15
|
+
description: "Caminho absoluto do diretório do projeto no IDE (ex: '/home/user/meu-projeto' ou 'C:/Users/user/meu-projeto'). IMPORTANTE: este valor não pode ser inferido automaticamente pelo servidor — o agente deve fornecer o path real do projeto sendo trabalhado, não o diretório home do usuário."
|
|
16
16
|
},
|
|
17
17
|
action: {
|
|
18
18
|
type: "string",
|
|
@@ -43,7 +43,11 @@ export function createGitIssuesTool(pm) {
|
|
|
43
43
|
additionalProperties: false
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
const description = `
|
|
46
|
+
const description = `IMPORTANTE — projectPath:
|
|
47
|
+
Informe o caminho absoluto do projeto aberto no IDE. O servidor MCP não tem acesso ao
|
|
48
|
+
contexto do IDE e não consegue detectar automaticamente qual projeto está sendo trabalhado.
|
|
49
|
+
|
|
50
|
+
Gerenciamento de Issues no GitHub e Gitea.
|
|
47
51
|
|
|
48
52
|
QUANDO USAR:
|
|
49
53
|
- Reportar bugs encontrados
|
|
@@ -97,5 +101,11 @@ BOAS PRÁTICAS:
|
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
|
|
100
|
-
return {
|
|
104
|
+
return {
|
|
105
|
+
name: "git-issues",
|
|
106
|
+
description,
|
|
107
|
+
inputSchema,
|
|
108
|
+
handle,
|
|
109
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }
|
|
110
|
+
};
|
|
101
111
|
}
|
package/src/tools/git-merge.js
CHANGED
|
@@ -10,7 +10,7 @@ export function createGitMergeTool(git) {
|
|
|
10
10
|
properties: {
|
|
11
11
|
projectPath: {
|
|
12
12
|
type: "string",
|
|
13
|
-
description: "Caminho absoluto do diretório do projeto"
|
|
13
|
+
description: "Caminho absoluto do diretório do projeto no IDE (ex: '/home/user/meu-projeto' ou 'C:/Users/user/meu-projeto'). IMPORTANTE: este valor não pode ser inferido automaticamente pelo servidor — o agente deve fornecer o path real do projeto sendo trabalhado, não o diretório home do usuário."
|
|
14
14
|
},
|
|
15
15
|
action: {
|
|
16
16
|
type: "string",
|
|
@@ -41,7 +41,11 @@ export function createGitMergeTool(git) {
|
|
|
41
41
|
additionalProperties: false
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const description = `
|
|
44
|
+
const description = `IMPORTANTE — projectPath:
|
|
45
|
+
Informe o caminho absoluto do projeto aberto no IDE. O servidor MCP não tem acesso ao
|
|
46
|
+
contexto do IDE e não consegue detectar automaticamente qual projeto está sendo trabalhado.
|
|
47
|
+
|
|
48
|
+
Merge de branches Git.
|
|
45
49
|
|
|
46
50
|
QUANDO USAR:
|
|
47
51
|
- Integrar mudanças de uma feature branch na main
|
|
@@ -148,5 +152,11 @@ SQUASH:
|
|
|
148
152
|
}
|
|
149
153
|
}
|
|
150
154
|
|
|
151
|
-
return {
|
|
155
|
+
return {
|
|
156
|
+
name: "git-merge",
|
|
157
|
+
description,
|
|
158
|
+
inputSchema,
|
|
159
|
+
handle,
|
|
160
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }
|
|
161
|
+
};
|
|
152
162
|
}
|
package/src/tools/git-pulls.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Ajv from "ajv";
|
|
2
2
|
import axios from "axios";
|
|
3
3
|
import { asToolError, asToolResult, errorToResponse } from "../utils/errors.js";
|
|
4
|
-
import { getRepoNameFromPath, validateProjectPath } from "../utils/repoHelpers.js";
|
|
4
|
+
import { getRepoNameFromPath, validateProjectPath, withRetry } from "../utils/repoHelpers.js";
|
|
5
5
|
import { runBoth } from "../utils/providerExec.js";
|
|
6
6
|
|
|
7
7
|
const ajv = new Ajv({ allErrors: true });
|
|
@@ -12,7 +12,7 @@ export function createGitPullsTool(pm) {
|
|
|
12
12
|
properties: {
|
|
13
13
|
projectPath: {
|
|
14
14
|
type: "string",
|
|
15
|
-
description: "Caminho absoluto do diretório do projeto"
|
|
15
|
+
description: "Caminho absoluto do diretório do projeto no IDE (ex: '/home/user/meu-projeto' ou 'C:/Users/user/meu-projeto'). IMPORTANTE: este valor não pode ser inferido automaticamente pelo servidor — o agente deve fornecer o path real do projeto sendo trabalhado, não o diretório home do usuário."
|
|
16
16
|
},
|
|
17
17
|
action: {
|
|
18
18
|
type: "string",
|
|
@@ -51,7 +51,11 @@ export function createGitPullsTool(pm) {
|
|
|
51
51
|
additionalProperties: false
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
const description = `
|
|
54
|
+
const description = `IMPORTANTE — projectPath:
|
|
55
|
+
Informe o caminho absoluto do projeto aberto no IDE. O servidor MCP não tem acesso ao
|
|
56
|
+
contexto do IDE e não consegue detectar automaticamente qual projeto está sendo trabalhado.
|
|
57
|
+
|
|
58
|
+
Gerenciamento de Pull Requests no GitHub e Gitea.
|
|
55
59
|
|
|
56
60
|
QUANDO USAR:
|
|
57
61
|
- Propor mudanças de uma branch para outra
|
|
@@ -111,5 +115,11 @@ NOTA: O PR é criado em AMBOS os providers simultaneamente.`;
|
|
|
111
115
|
}
|
|
112
116
|
}
|
|
113
117
|
|
|
114
|
-
return {
|
|
118
|
+
return {
|
|
119
|
+
name: "git-pulls",
|
|
120
|
+
description,
|
|
121
|
+
inputSchema,
|
|
122
|
+
handle,
|
|
123
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }
|
|
124
|
+
};
|
|
115
125
|
}
|