@andrebuzeli/git-mcp 5.8.3 → 5.8.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/dist/index.js +22 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -117,11 +117,18 @@ async function main() {
|
|
|
117
117
|
});
|
|
118
118
|
rl.on('line', async (line) => {
|
|
119
119
|
let request;
|
|
120
|
-
let id =
|
|
120
|
+
let id = undefined;
|
|
121
121
|
try {
|
|
122
122
|
request = JSON.parse(line);
|
|
123
|
-
id = request.id
|
|
123
|
+
id = request.id;
|
|
124
124
|
const { jsonrpc, method, params } = request;
|
|
125
|
+
// Only respond if there's an id (not a notification)
|
|
126
|
+
if (id === undefined) {
|
|
127
|
+
if (process.env.DEBUG) {
|
|
128
|
+
console.error('Received notification (no id), not responding');
|
|
129
|
+
}
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
125
132
|
let response = { jsonrpc: '2.0', id };
|
|
126
133
|
switch (method) {
|
|
127
134
|
case 'initialize':
|
|
@@ -133,7 +140,7 @@ async function main() {
|
|
|
133
140
|
},
|
|
134
141
|
serverInfo: {
|
|
135
142
|
name: 'git-mcp',
|
|
136
|
-
version: '5.8.
|
|
143
|
+
version: '5.8.3'
|
|
137
144
|
}
|
|
138
145
|
};
|
|
139
146
|
break;
|
|
@@ -219,16 +226,18 @@ async function main() {
|
|
|
219
226
|
console.log(JSON.stringify(response));
|
|
220
227
|
}
|
|
221
228
|
catch (err) {
|
|
222
|
-
//
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
// Only send error response if we have a valid id
|
|
230
|
+
if (id !== undefined) {
|
|
231
|
+
const errorResponse = {
|
|
232
|
+
jsonrpc: '2.0',
|
|
233
|
+
id: id,
|
|
234
|
+
error: {
|
|
235
|
+
code: -32700,
|
|
236
|
+
message: `Parse error: ${err.message || String(err)}`
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
console.log(JSON.stringify(errorResponse));
|
|
240
|
+
}
|
|
232
241
|
if (process.env.DEBUG) {
|
|
233
242
|
console.error('Error processing request:', err);
|
|
234
243
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrebuzeli/git-mcp",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.4",
|
|
4
4
|
"description": "Professional MCP server for Git operations - automatic dual-provider execution (GitHub + Gitea), no provider parameter needed, organized responses by provider, enhanced security and safety features",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|