@andrebuzeli/git-mcp 15.8.1 → 15.8.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/README.md CHANGED
@@ -49,12 +49,14 @@ Test Suites: 2 passed, 2 total
49
49
  Tests: 13 passed, 13 total
50
50
  ```
51
51
 
52
+ ### Configuração Padrão (npx)
53
+
52
54
  ```json
53
55
  {
54
56
  "mcpServers": {
55
57
  "git-mcp": {
56
58
  "command": "npx",
57
- "args": ["@andrebuzeli/git-mcp@latest"],
59
+ "args": ["-y", "@andrebuzeli/git-mcp@latest"],
58
60
  "env": {
59
61
  "GITEA_URL": "https://seu-gitea",
60
62
  "GITEA_TOKEN": "...",
@@ -65,6 +67,45 @@ Tests: 13 passed, 13 total
65
67
  }
66
68
  ```
67
69
 
70
+ ## 🐧 SSH Remote / Linux Server
71
+
72
+ Se você usa **VS Code Remote SSH**, **Cursor SSH** ou similar, o `npx` pode dar timeout em redes lentas.
73
+
74
+ ### Solução: Instalação Global
75
+
76
+ **1. No servidor Linux, execute:**
77
+ ```bash
78
+ # Instalação rápida
79
+ curl -fsSL https://raw.githubusercontent.com/andrebuzeli/git-mcp/main/install.sh | bash
80
+
81
+ # Ou manualmente:
82
+ npm install -g @andrebuzeli/git-mcp@latest
83
+ ```
84
+
85
+ **2. Configure a IDE para usar o comando local:**
86
+ ```json
87
+ {
88
+ "mcpServers": {
89
+ "git-mcp": {
90
+ "command": "git-mcp",
91
+ "env": {
92
+ "GITHUB_TOKEN": "...",
93
+ "GITEA_URL": "https://seu-gitea",
94
+ "GITEA_TOKEN": "..."
95
+ }
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
101
+ ### Troubleshooting
102
+
103
+ | Erro | Solução |
104
+ |------|---------|
105
+ | `ETIMEDOUT` / `Request timed out` | Use instalação global ao invés de npx |
106
+ | `command not found: git-mcp` | Verifique se npm global está no PATH |
107
+ | Permissão negada | Use `sudo npm install -g @andrebuzeli/git-mcp` |
108
+
68
109
  ## Tools
69
110
 
70
111
  - git-workflow: init, status, add, remove, commit, ensure-remotes, push
package/install.sh ADDED
@@ -0,0 +1,68 @@
1
+ #!/bin/bash
2
+ # =============================================================================
3
+ # git-mcp Install Script
4
+ # =============================================================================
5
+ # Quick install for Linux servers (especially SSH remote environments)
6
+ # This avoids the npx timeout issues on slow/unstable networks
7
+ # =============================================================================
8
+
9
+ set -e
10
+
11
+ GREEN='\033[0;32m'
12
+ YELLOW='\033[1;33m'
13
+ RED='\033[0;31m'
14
+ NC='\033[0m' # No Color
15
+
16
+ echo -e "${GREEN}🚀 Installing @andrebuzeli/git-mcp...${NC}"
17
+
18
+ # Check for Node.js
19
+ if ! command -v node &> /dev/null; then
20
+ echo -e "${RED}❌ Node.js not found!${NC}"
21
+ echo "Please install Node.js first: https://nodejs.org/"
22
+ exit 1
23
+ fi
24
+
25
+ # Check Node version (need 18+)
26
+ NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
27
+ if [ "$NODE_VERSION" -lt 18 ]; then
28
+ echo -e "${YELLOW}⚠️ Node.js version 18+ recommended (found: $(node -v))${NC}"
29
+ fi
30
+
31
+ # Check for npm
32
+ if ! command -v npm &> /dev/null; then
33
+ echo -e "${RED}❌ npm not found!${NC}"
34
+ exit 1
35
+ fi
36
+
37
+ echo "📦 Installing globally..."
38
+ npm install -g @andrebuzeli/git-mcp@latest
39
+
40
+ # Verify installation
41
+ if command -v git-mcp &> /dev/null; then
42
+ echo -e "${GREEN}✅ git-mcp installed successfully!${NC}"
43
+ echo ""
44
+ echo -e "${YELLOW}📝 Next steps:${NC}"
45
+ echo "1. Configure your IDE to use 'git-mcp' as the command"
46
+ echo ""
47
+ echo " For Cursor/VS Code (settings.json or mcp.json):"
48
+ echo ' {'
49
+ echo ' "mcpServers": {'
50
+ echo ' "git-mcp": {'
51
+ echo ' "command": "git-mcp",'
52
+ echo ' "env": {'
53
+ echo ' "GITHUB_TOKEN": "your-token",'
54
+ echo ' "GITEA_URL": "https://your-gitea",'
55
+ echo ' "GITEA_TOKEN": "your-token"'
56
+ echo ' }'
57
+ echo ' }'
58
+ echo ' }'
59
+ echo ' }'
60
+ echo ""
61
+ echo "2. Restart your IDE or reconnect SSH"
62
+ echo ""
63
+ echo -e "${GREEN}Done! 🎉${NC}"
64
+ else
65
+ echo -e "${RED}❌ Installation failed. Check npm permissions.${NC}"
66
+ echo "Try: sudo npm install -g @andrebuzeli/git-mcp@latest"
67
+ exit 1
68
+ fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrebuzeli/git-mcp",
3
- "version": "15.8.1",
3
+ "version": "15.8.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",
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "files": [
13
13
  "src",
14
- "README.md"
14
+ "README.md",
15
+ "install.sh"
15
16
  ],
16
17
  "main": "src/index.js",
17
18
  "bin": {
@@ -41,4 +42,4 @@
41
42
  "devDependencies": {
42
43
  "jest": "^30.2.0"
43
44
  }
44
- }
45
+ }
package/src/index.js CHANGED
@@ -91,17 +91,10 @@ server.setRequestHandler(
91
91
  async (req) => {
92
92
  const name = req.params?.name || "";
93
93
  const args = req.params?.arguments || {};
94
- const progressToken = req.params?._meta?.progressToken;
95
94
  const tool = tools.find(t => t.name === name);
96
95
  if (!tool) return { content: [{ type: "text", text: `Tool não encontrada: ${name}` }], isError: true };
97
96
  try {
98
- if (progressToken) {
99
- await server.notification({ method: "notifications/progress", params: { progressToken, progress: 0 } });
100
- }
101
97
  const result = await tool.handle(args);
102
- if (progressToken) {
103
- await server.notification({ method: "notifications/progress", params: { progressToken, progress: 100 } });
104
- }
105
98
  return result;
106
99
  } catch (e) {
107
100
  return asToolError(e.code || "ERROR", e.message || String(e));