@andre.buzeli/git-mcp 16.1.2 → 16.1.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andre.buzeli/git-mcp",
3
- "version": "16.1.2",
3
+ "version": "16.1.3",
4
4
  "private": false,
5
5
  "description": "MCP server para Git com operações locais e sincronização paralela GitHub/Gitea",
6
6
  "license": "MIT",
package/src/index.js CHANGED
@@ -49,13 +49,59 @@ if (!hasGitHub && !hasGitea) {
49
49
 
50
50
  const transport = new StdioServerTransport();
51
51
  const server = new Server(
52
- { name: "git-mcp", version: "16.0.8" },
53
- { capabilities: {
54
- tools: { listChanged: true },
55
- resources: { subscribe: true, listChanged: true },
56
- prompts: {},
57
- logging: {}
58
- } }
52
+ { name: "git-mcp", version: "16.1.3" },
53
+ {
54
+ capabilities: {
55
+ tools: { listChanged: true },
56
+ resources: { subscribe: true, listChanged: true },
57
+ prompts: {},
58
+ logging: {}
59
+ },
60
+ instructions: `# git-mcp — Instruções para AI Agents
61
+
62
+ ## REGRA #1: projectPath é OBRIGATÓRIO
63
+ Toda tool (exceto git-help) exige "projectPath" com o caminho absoluto do projeto aberto no IDE.
64
+ O servidor NÃO consegue detectar o projeto automaticamente.
65
+ Exemplo: "projectPath": "C:/Users/user/meu-projeto" ou "/home/user/meu-projeto"
66
+
67
+ ## REGRA #2: action é OBRIGATÓRIO
68
+ Toda tool usa o padrão { "projectPath": "...", "action": "nome-da-action", ...params }.
69
+ Consulte o enum de cada tool para saber as actions disponíveis.
70
+
71
+ ## Guia Rápido de Tools
72
+
73
+ | Necessidade | Tool | Action | Params obrigatórios |
74
+ |-------------|------|--------|---------------------|
75
+ | Atualizar projeto completo | git-workflow | update | message |
76
+ | Ver status do repo | git-workflow | status | - |
77
+ | Inicializar repo novo | git-workflow | init | - |
78
+ | Ver diferenças locais | git-diff | show | - |
79
+ | Comparar branches/commits | git-diff | compare | target |
80
+ | Criar branch | git-branches | create | branch |
81
+ | Trocar branch | git-branches | checkout | branch |
82
+ | Listar branches | git-branches | list | - |
83
+ | Merge de branch | git-merge | merge | sourceBranch |
84
+ | Criar tag | git-tags | create | tag |
85
+ | Clonar repo | git-clone | clone | url |
86
+ | Criar issue | git-issues | create | title |
87
+ | Criar PR | git-pulls | create | head, title |
88
+ | Salvar stash | git-stash | save | - |
89
+ | Reset commits | git-reset | soft/mixed/hard | - |
90
+ | Configurar git | git-config | get/set | key |
91
+ | Gerenciar .gitignore | git-ignore | add/list | patterns |
92
+ | Ler arquivo do git | git-files | read | filepath |
93
+ | Ver histórico | git-history | log | - |
94
+ | Fetch/Pull remoto | git-sync | fetch/pull | - |
95
+ | Gerenciar remotes | git-remote | list/ensure | - |
96
+
97
+ ## Exemplo Completo (ação mais comum)
98
+ \`\`\`json
99
+ { "projectPath": "/caminho/do/projeto", "action": "update", "message": "feat: descrição das mudanças" }
100
+ \`\`\`
101
+
102
+ ## Dica
103
+ Use git-help action="listTools" para ver todas as tools e actions disponíveis em tempo real.`
104
+ }
59
105
  );
60
106
  server.connect(transport);
61
107
 
@@ -69,9 +69,9 @@ Visualizar diferenças.
69
69
 
70
70
  | Action | Descrição | Parâmetros |
71
71
  |--------|-----------|------------|
72
- | show | Ver mudanças locais | filepath="src/file.js" (opcional) |
73
- | compare | Comparar commits | fromRef="HEAD~1", toRef="HEAD" |
74
- | stat | Estatísticas | fromRef="HEAD~1", toRef="HEAD" |
72
+ | show | Ver mudanças locais (working vs HEAD) | staged=true (opcional, para staged vs HEAD) |
73
+ | compare | Comparar branches/commits | target="main" (obrigatório), source="HEAD" (opcional) |
74
+ | stat | Estatísticas resumidas | target="HEAD~1" (opcional), source (opcional) |
75
75
 
76
76
  ---
77
77
 
@@ -30,6 +30,7 @@ export function createGitDiffTool(git) {
30
30
  },
31
31
  staged: {
32
32
  type: "boolean",
33
+ default: false,
33
34
  description: "Para action='show': comparar staged vs HEAD (em vez de working vs index). Default: false"
34
35
  }
35
36
  },
@@ -19,10 +19,12 @@ export function createGitHistoryTool(git) {
19
19
  },
20
20
  ref: {
21
21
  type: "string",
22
+ default: "HEAD",
22
23
  description: "Referência inicial para o log (branch, tag, SHA). Default: HEAD"
23
24
  },
24
25
  maxCount: {
25
26
  type: "number",
27
+ default: 50,
26
28
  description: "Número máximo de commits a retornar. Default: 50"
27
29
  }
28
30
  },
@@ -34,6 +34,7 @@ export function createGitStashTool(git) {
34
34
  },
35
35
  includeUntracked: {
36
36
  type: "boolean",
37
+ default: false,
37
38
  description: "Incluir arquivos não rastreados no stash (action='save'). Default: false"
38
39
  }
39
40
  },
@@ -40,7 +40,8 @@ export function createGitWorkflowTool(pm, git, server) {
40
40
  files: {
41
41
  type: "array",
42
42
  items: { type: "string" },
43
- description: "Lista de arquivos para add/remove. Use ['.'] para todos os arquivos. Ex: ['src/index.js', 'package.json']"
43
+ default: ["."],
44
+ description: "Lista de arquivos para add/remove. Default: ['.'] (todos). Ex: ['src/index.js', 'package.json']"
44
45
  },
45
46
  message: {
46
47
  type: "string",
@@ -61,22 +62,27 @@ export function createGitWorkflowTool(pm, git, server) {
61
62
  },
62
63
  force: {
63
64
  type: "boolean",
65
+ default: false,
64
66
  description: "Force push (use apenas se push normal falhar com erro de histórico divergente). Default: false"
65
67
  },
66
68
  createGitignore: {
67
69
  type: "boolean",
70
+ default: true,
68
71
  description: "Se true, cria .gitignore padrão baseado no tipo de projeto (action='init'). Default: true"
69
72
  },
70
73
  isPublic: {
71
74
  type: "boolean",
75
+ default: false,
72
76
  description: "Se true, repositório será PÚBLICO. Default: false (privado). Aplica-se a action='init' e 'ensure-remotes'"
73
77
  },
74
78
  dryRun: {
75
79
  type: "boolean",
80
+ default: false,
76
81
  description: "Se true, simula a operação sem executar (útil para testes). Default: false"
77
82
  },
78
83
  skipIfClean: {
79
84
  type: "boolean",
85
+ default: false,
80
86
  description: "Para action='update': se true, pula silenciosamente se não houver mudanças. Default: false"
81
87
  },
82
88
  gitignore: {