@cyanheads/git-mcp-server 2.8.3 → 2.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/README.md +1 -1
- package/dist/index.js +41 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [](https://modelcontextprotocol.io/) [](./LICENSE) [](https://github.com/cyanheads/git-mcp-server/issues) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
package/dist/index.js
CHANGED
|
@@ -15335,7 +15335,7 @@ var package_default;
|
|
|
15335
15335
|
var init_package = __esm(() => {
|
|
15336
15336
|
package_default = {
|
|
15337
15337
|
name: "@cyanheads/git-mcp-server",
|
|
15338
|
-
version: "2.8.
|
|
15338
|
+
version: "2.8.4",
|
|
15339
15339
|
mcpName: "io.github.cyanheads/git-mcp-server",
|
|
15340
15340
|
description: "A secure and scalable Git MCP server enabling AI agents to perform comprehensive Git version control operations via STDIO and Streamable HTTP.",
|
|
15341
15341
|
main: "dist/index.js",
|
|
@@ -169396,7 +169396,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
169396
169396
|
const schOrFunc = root.refs[ref];
|
|
169397
169397
|
if (schOrFunc)
|
|
169398
169398
|
return schOrFunc;
|
|
169399
|
-
let _sch =
|
|
169399
|
+
let _sch = resolve2.call(this, root, ref);
|
|
169400
169400
|
if (_sch === undefined) {
|
|
169401
169401
|
const schema2 = (_a4 = root.localRefs) === null || _a4 === undefined ? undefined : _a4[ref];
|
|
169402
169402
|
const { schemaId } = this.opts;
|
|
@@ -169423,7 +169423,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
169423
169423
|
function sameSchemaEnv(s1, s2) {
|
|
169424
169424
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
169425
169425
|
}
|
|
169426
|
-
function
|
|
169426
|
+
function resolve2(root, ref) {
|
|
169427
169427
|
let sch;
|
|
169428
169428
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
169429
169429
|
ref = sch;
|
|
@@ -169953,7 +169953,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
169953
169953
|
}
|
|
169954
169954
|
return uri;
|
|
169955
169955
|
}
|
|
169956
|
-
function
|
|
169956
|
+
function resolve2(baseURI, relativeURI, options) {
|
|
169957
169957
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
169958
169958
|
const resolved = resolveComponent(parse7(baseURI, schemelessOptions), parse7(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
169959
169959
|
schemelessOptions.skipEscape = true;
|
|
@@ -170181,7 +170181,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
170181
170181
|
var fastUri = {
|
|
170182
170182
|
SCHEMES,
|
|
170183
170183
|
normalize,
|
|
170184
|
-
resolve,
|
|
170184
|
+
resolve: resolve2,
|
|
170185
170185
|
resolveComponent,
|
|
170186
170186
|
equal,
|
|
170187
170187
|
serialize,
|
|
@@ -176024,9 +176024,12 @@ async function executeInit(options, context, execGit) {
|
|
|
176024
176024
|
}
|
|
176025
176025
|
}
|
|
176026
176026
|
// src/services/git/providers/cli/operations/core/clone.ts
|
|
176027
|
+
import { dirname, resolve } from "node:path";
|
|
176027
176028
|
async function executeClone(options, context, execGit) {
|
|
176028
176029
|
try {
|
|
176029
|
-
const
|
|
176030
|
+
const resolvedLocalPath = resolve(context.workingDirectory, options.localPath);
|
|
176031
|
+
const cloneCwd = dirname(resolvedLocalPath);
|
|
176032
|
+
const args = [options.remoteUrl, resolvedLocalPath];
|
|
176030
176033
|
if (options.branch) {
|
|
176031
176034
|
args.push("--branch", options.branch);
|
|
176032
176035
|
}
|
|
@@ -176043,7 +176046,7 @@ async function executeClone(options, context, execGit) {
|
|
|
176043
176046
|
args.push("--recurse-submodules");
|
|
176044
176047
|
}
|
|
176045
176048
|
const cmd = buildGitCommand({ command: "clone", args });
|
|
176046
|
-
await execGit(cmd,
|
|
176049
|
+
await execGit(cmd, cloneCwd, context.requestContext);
|
|
176047
176050
|
const result = {
|
|
176048
176051
|
success: true,
|
|
176049
176052
|
localPath: options.localPath,
|
|
@@ -177964,7 +177967,7 @@ var safeJSON = (text) => {
|
|
|
177964
177967
|
};
|
|
177965
177968
|
|
|
177966
177969
|
// node_modules/openai/internal/utils/sleep.mjs
|
|
177967
|
-
var sleep = (ms) => new Promise((
|
|
177970
|
+
var sleep = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
177968
177971
|
|
|
177969
177972
|
// node_modules/openai/version.mjs
|
|
177970
177973
|
var VERSION = "6.21.0";
|
|
@@ -178968,8 +178971,8 @@ var _APIPromise_client;
|
|
|
178968
178971
|
|
|
178969
178972
|
class APIPromise extends Promise {
|
|
178970
178973
|
constructor(client, responsePromise, parseResponse = defaultParseResponse) {
|
|
178971
|
-
super((
|
|
178972
|
-
|
|
178974
|
+
super((resolve2) => {
|
|
178975
|
+
resolve2(null);
|
|
178973
178976
|
});
|
|
178974
178977
|
this.responsePromise = responsePromise;
|
|
178975
178978
|
this.parseResponse = parseResponse;
|
|
@@ -179487,12 +179490,12 @@ class EventStream {
|
|
|
179487
179490
|
_EventStream_errored.set(this, false);
|
|
179488
179491
|
_EventStream_aborted.set(this, false);
|
|
179489
179492
|
_EventStream_catchingPromiseCreated.set(this, false);
|
|
179490
|
-
__classPrivateFieldSet(this, _EventStream_connectedPromise, new Promise((
|
|
179491
|
-
__classPrivateFieldSet(this, _EventStream_resolveConnectedPromise,
|
|
179493
|
+
__classPrivateFieldSet(this, _EventStream_connectedPromise, new Promise((resolve2, reject) => {
|
|
179494
|
+
__classPrivateFieldSet(this, _EventStream_resolveConnectedPromise, resolve2, "f");
|
|
179492
179495
|
__classPrivateFieldSet(this, _EventStream_rejectConnectedPromise, reject, "f");
|
|
179493
179496
|
}), "f");
|
|
179494
|
-
__classPrivateFieldSet(this, _EventStream_endPromise, new Promise((
|
|
179495
|
-
__classPrivateFieldSet(this, _EventStream_resolveEndPromise,
|
|
179497
|
+
__classPrivateFieldSet(this, _EventStream_endPromise, new Promise((resolve2, reject) => {
|
|
179498
|
+
__classPrivateFieldSet(this, _EventStream_resolveEndPromise, resolve2, "f");
|
|
179496
179499
|
__classPrivateFieldSet(this, _EventStream_rejectEndPromise, reject, "f");
|
|
179497
179500
|
}), "f");
|
|
179498
179501
|
__classPrivateFieldGet(this, _EventStream_connectedPromise, "f").catch(() => {});
|
|
@@ -179544,11 +179547,11 @@ class EventStream {
|
|
|
179544
179547
|
return this;
|
|
179545
179548
|
}
|
|
179546
179549
|
emitted(event) {
|
|
179547
|
-
return new Promise((
|
|
179550
|
+
return new Promise((resolve2, reject) => {
|
|
179548
179551
|
__classPrivateFieldSet(this, _EventStream_catchingPromiseCreated, true, "f");
|
|
179549
179552
|
if (event !== "error")
|
|
179550
179553
|
this.once("error", reject);
|
|
179551
|
-
this.once(event,
|
|
179554
|
+
this.once(event, resolve2);
|
|
179552
179555
|
});
|
|
179553
179556
|
}
|
|
179554
179557
|
async done() {
|
|
@@ -180466,7 +180469,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
180466
180469
|
if (done) {
|
|
180467
180470
|
return { value: undefined, done: true };
|
|
180468
180471
|
}
|
|
180469
|
-
return new Promise((
|
|
180472
|
+
return new Promise((resolve2, reject) => readQueue.push({ resolve: resolve2, reject })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: undefined, done: true });
|
|
180470
180473
|
}
|
|
180471
180474
|
const chunk = pushQueue.shift();
|
|
180472
180475
|
return { value: chunk, done: false };
|
|
@@ -181054,7 +181057,7 @@ class AssistantStream extends EventStream {
|
|
|
181054
181057
|
if (done) {
|
|
181055
181058
|
return { value: undefined, done: true };
|
|
181056
181059
|
}
|
|
181057
|
-
return new Promise((
|
|
181060
|
+
return new Promise((resolve2, reject) => readQueue.push({ resolve: resolve2, reject })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: undefined, done: true });
|
|
181058
181061
|
}
|
|
181059
181062
|
const chunk = pushQueue.shift();
|
|
181060
181063
|
return { value: chunk, done: false };
|
|
@@ -182485,7 +182488,7 @@ class ResponseStream extends EventStream {
|
|
|
182485
182488
|
if (done) {
|
|
182486
182489
|
return { value: undefined, done: true };
|
|
182487
182490
|
}
|
|
182488
|
-
return new Promise((
|
|
182491
|
+
return new Promise((resolve2, reject) => readQueue.push({ resolve: resolve2, reject })).then((event2) => event2 ? { value: event2, done: false } : { value: undefined, done: true });
|
|
182489
182492
|
}
|
|
182490
182493
|
const event = pushQueue.shift();
|
|
182491
182494
|
return { value: event, done: false };
|
|
@@ -191752,7 +191755,7 @@ class Protocol {
|
|
|
191752
191755
|
return;
|
|
191753
191756
|
}
|
|
191754
191757
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1000;
|
|
191755
|
-
await new Promise((
|
|
191758
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
|
|
191756
191759
|
options?.signal?.throwIfAborted();
|
|
191757
191760
|
}
|
|
191758
191761
|
} catch (error49) {
|
|
@@ -191764,7 +191767,7 @@ class Protocol {
|
|
|
191764
191767
|
}
|
|
191765
191768
|
request(request, resultSchema, options) {
|
|
191766
191769
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
191767
|
-
return new Promise((
|
|
191770
|
+
return new Promise((resolve2, reject) => {
|
|
191768
191771
|
const earlyReject = (error49) => {
|
|
191769
191772
|
reject(error49);
|
|
191770
191773
|
};
|
|
@@ -191842,7 +191845,7 @@ class Protocol {
|
|
|
191842
191845
|
if (!parseResult.success) {
|
|
191843
191846
|
reject(parseResult.error);
|
|
191844
191847
|
} else {
|
|
191845
|
-
|
|
191848
|
+
resolve2(parseResult.data);
|
|
191846
191849
|
}
|
|
191847
191850
|
} catch (error49) {
|
|
191848
191851
|
reject(error49);
|
|
@@ -192033,12 +192036,12 @@ class Protocol {
|
|
|
192033
192036
|
interval = task.pollInterval;
|
|
192034
192037
|
}
|
|
192035
192038
|
} catch {}
|
|
192036
|
-
return new Promise((
|
|
192039
|
+
return new Promise((resolve2, reject) => {
|
|
192037
192040
|
if (signal.aborted) {
|
|
192038
192041
|
reject(new McpError2(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
192039
192042
|
return;
|
|
192040
192043
|
}
|
|
192041
|
-
const timeoutId = setTimeout(
|
|
192044
|
+
const timeoutId = setTimeout(resolve2, interval);
|
|
192042
192045
|
signal.addEventListener("abort", () => {
|
|
192043
192046
|
clearTimeout(timeoutId);
|
|
192044
192047
|
reject(new McpError2(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -193056,7 +193059,7 @@ class McpServer {
|
|
|
193056
193059
|
let task = createTaskResult.task;
|
|
193057
193060
|
const pollInterval = task.pollInterval ?? 5000;
|
|
193058
193061
|
while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
|
|
193059
|
-
await new Promise((
|
|
193062
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
|
|
193060
193063
|
const updatedTask = await extra.taskStore.getTask(taskId);
|
|
193061
193064
|
if (!updatedTask) {
|
|
193062
193065
|
throw new McpError2(ErrorCode.InternalError, `Task ${taskId} not found during polling`);
|
|
@@ -194610,7 +194613,7 @@ async function gitCloneLogic(input, { provider, appContext }) {
|
|
|
194610
194613
|
cloneOptions.depth = input.depth;
|
|
194611
194614
|
}
|
|
194612
194615
|
const result = await provider.clone(cloneOptions, {
|
|
194613
|
-
workingDirectory:
|
|
194616
|
+
workingDirectory: process.cwd(),
|
|
194614
194617
|
requestContext: appContext,
|
|
194615
194618
|
tenantId: appContext.tenantId || "default-tenant"
|
|
194616
194619
|
});
|
|
@@ -199204,14 +199207,14 @@ var StreamableHTTPTransport = class {
|
|
|
199204
199207
|
if (!this.#enableJsonResponse && this.sessionId !== undefined)
|
|
199205
199208
|
ctx.header("mcp-session-id", this.sessionId);
|
|
199206
199209
|
if (this.#enableJsonResponse)
|
|
199207
|
-
return await new Promise((
|
|
199210
|
+
return await new Promise((resolve2) => {
|
|
199208
199211
|
for (const message of messages)
|
|
199209
199212
|
if (isJSONRPCRequest(message)) {
|
|
199210
199213
|
this.#streamMapping.set(streamId, {
|
|
199211
199214
|
ctx: {
|
|
199212
199215
|
header: ctx.header,
|
|
199213
199216
|
json: (data) => {
|
|
199214
|
-
|
|
199217
|
+
resolve2(ctx.json(data));
|
|
199215
199218
|
}
|
|
199216
199219
|
},
|
|
199217
199220
|
cleanup: () => {
|
|
@@ -199902,7 +199905,7 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
199902
199905
|
});
|
|
199903
199906
|
if (!chunk) {
|
|
199904
199907
|
if (i2 === 1) {
|
|
199905
|
-
await new Promise((
|
|
199908
|
+
await new Promise((resolve2) => setTimeout(resolve2));
|
|
199906
199909
|
maxReadCount = 3;
|
|
199907
199910
|
continue;
|
|
199908
199911
|
}
|
|
@@ -202329,9 +202332,9 @@ function createHttpApp(createMcpServer, parentContext) {
|
|
|
202329
202332
|
async function isPortInUse(port, host, parentContext) {
|
|
202330
202333
|
const context = { ...parentContext, operation: "isPortInUse", port, host };
|
|
202331
202334
|
logger.debug(`Checking if port ${port} is in use...`, context);
|
|
202332
|
-
return new Promise((
|
|
202335
|
+
return new Promise((resolve2) => {
|
|
202333
202336
|
const tempServer = http.createServer();
|
|
202334
|
-
tempServer.once("error", (err) =>
|
|
202337
|
+
tempServer.once("error", (err) => resolve2(err.code === "EADDRINUSE")).once("listening", () => tempServer.close(() => resolve2(false))).listen(port, host);
|
|
202335
202338
|
});
|
|
202336
202339
|
}
|
|
202337
202340
|
function startHttpServerWithRetry(app, initialPort, host, maxRetries, parentContext) {
|
|
@@ -202340,7 +202343,7 @@ function startHttpServerWithRetry(app, initialPort, host, maxRetries, parentCont
|
|
|
202340
202343
|
operation: "startHttpServerWithRetry"
|
|
202341
202344
|
};
|
|
202342
202345
|
logger.info(`Attempting to start HTTP server on port ${initialPort} with ${maxRetries} retries.`, startContext);
|
|
202343
|
-
return new Promise((
|
|
202346
|
+
return new Promise((resolve2, reject) => {
|
|
202344
202347
|
const tryBind = (port, attempt) => {
|
|
202345
202348
|
if (attempt > maxRetries + 1) {
|
|
202346
202349
|
const error49 = new Error(`Failed to bind to any port after ${maxRetries} retries.`);
|
|
@@ -202368,7 +202371,7 @@ function startHttpServerWithRetry(app, initialPort, host, maxRetries, parentCont
|
|
|
202368
202371
|
logStartupBanner(`
|
|
202369
202372
|
\uD83D\uDE80 MCP Server running at: ${serverAddress}`, "http");
|
|
202370
202373
|
});
|
|
202371
|
-
|
|
202374
|
+
resolve2(serverInstance);
|
|
202372
202375
|
} catch (err) {
|
|
202373
202376
|
logger.warning(`Binding attempt failed for port ${port}, retrying...`, { ...startContext, port, attempt, error: String(err) });
|
|
202374
202377
|
setTimeout(() => tryBind(port + 1, attempt + 1), config2.mcpHttpPortRetryDelayMs);
|
|
@@ -202399,14 +202402,14 @@ async function stopHttpTransport(server, parentContext) {
|
|
|
202399
202402
|
const sessionManager = SessionManager.getInstance();
|
|
202400
202403
|
sessionManager.stopCleanupInterval();
|
|
202401
202404
|
logger.info("Session cleanup interval stopped", operationContext);
|
|
202402
|
-
return new Promise((
|
|
202405
|
+
return new Promise((resolve2, reject) => {
|
|
202403
202406
|
server.close((err) => {
|
|
202404
202407
|
if (err) {
|
|
202405
202408
|
logger.error("Error closing HTTP server.", err, operationContext);
|
|
202406
202409
|
return reject(err);
|
|
202407
202410
|
}
|
|
202408
202411
|
logger.info("HTTP server closed successfully.", operationContext);
|
|
202409
|
-
|
|
202412
|
+
resolve2();
|
|
202410
202413
|
});
|
|
202411
202414
|
});
|
|
202412
202415
|
}
|
|
@@ -202491,12 +202494,12 @@ class StdioServerTransport {
|
|
|
202491
202494
|
this.onclose?.();
|
|
202492
202495
|
}
|
|
202493
202496
|
send(message2) {
|
|
202494
|
-
return new Promise((
|
|
202497
|
+
return new Promise((resolve2) => {
|
|
202495
202498
|
const json3 = serializeMessage(message2);
|
|
202496
202499
|
if (this._stdout.write(json3)) {
|
|
202497
|
-
|
|
202500
|
+
resolve2();
|
|
202498
202501
|
} else {
|
|
202499
|
-
this._stdout.once("drain",
|
|
202502
|
+
this._stdout.once("drain", resolve2);
|
|
202500
202503
|
}
|
|
202501
202504
|
});
|
|
202502
202505
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/git-mcp-server",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.4",
|
|
4
4
|
"mcpName": "io.github.cyanheads/git-mcp-server",
|
|
5
5
|
"description": "A secure and scalable Git MCP server enabling AI agents to perform comprehensive Git version control operations via STDIO and Streamable HTTP.",
|
|
6
6
|
"main": "dist/index.js",
|