@cyanheads/git-mcp-server 2.1.5 → 2.1.7

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
@@ -1,8 +1,8 @@
1
1
  # Git MCP Server
2
2
 
3
3
  [![TypeScript](https://img.shields.io/badge/TypeScript-^5.8.3-blue.svg)](https://www.typescriptlang.org/)
4
- [![Model Context Protocol](https://img.shields.io/badge/MCP%20SDK-^1.13.0-green.svg)](https://modelcontextprotocol.io/)
5
- [![Version](https://img.shields.io/badge/Version-2.1.4-blue.svg)](./CHANGELOG.md)
4
+ [![Model Context Protocol](https://img.shields.io/badge/MCP%20SDK-^1.13.2-green.svg)](https://modelcontextprotocol.io/)
5
+ [![Version](https://img.shields.io/badge/Version-2.1.6-blue.svg)](./CHANGELOG.md)
6
6
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7
7
  [![Status](https://img.shields.io/badge/Status-Stable-green.svg)](https://github.com/cyanheads/git-mcp-server/issues)
8
8
  [![GitHub](https://img.shields.io/github/stars/cyanheads/git-mcp-server?style=social)](https://github.com/cyanheads/git-mcp-server)
@@ -3,13 +3,14 @@ import { readFileSync } from "fs";
3
3
  import { dirname, join } from "path";
4
4
  import { fileURLToPath } from "url";
5
5
  // Removed logger import to break circular dependency
6
- dotenv.config(); // Load environment variables from .env file
6
+ // Suppress dotenv debug output which can interfere with stdio transport
7
+ dotenv.config({ debug: false }); // Load environment variables from .env file
7
8
  // Determine the directory name of the current module
8
9
  const __dirname = dirname(fileURLToPath(import.meta.url));
9
10
  // Construct the path to package.json relative to the current file
10
11
  const pkgPath = join(__dirname, "../../package.json");
11
12
  // Default package information in case package.json is unreadable
12
- let pkg = { name: "obsidian-mcp-server", version: "0.0.0" };
13
+ let pkg = { name: "git-mcp-server-SOMETHINGBROKE", version: "0.0.0" };
13
14
  try {
14
15
  // Read and parse package.json to get server name and version
15
16
  pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
@@ -76,9 +76,7 @@ export async function addGitFiles(input, context) {
76
76
  }
77
77
  throw new McpError(BaseErrorCode.VALIDATION_ERROR, `Invalid path: ${error instanceof Error ? error.message : String(error)}`, { context, operation, originalError: error });
78
78
  }
79
- const filesToStage = Array.isArray(input.files)
80
- ? input.files
81
- : [input.files];
79
+ const filesToStage = Array.isArray(input.files) ? input.files : [input.files];
82
80
  if (filesToStage.length === 0) {
83
81
  filesToStage.push("."); // Default to staging all if array is empty
84
82
  }
@@ -88,7 +88,9 @@ export async function gitShowLogic(input, context) {
88
88
  }
89
89
  try {
90
90
  // Construct the refspec, combining ref and filePath if needed
91
- const refSpec = input.filePath ? `${input.ref}:${input.filePath}` : input.ref;
91
+ const refSpec = input.filePath
92
+ ? `${input.ref}:${input.filePath}`
93
+ : input.ref;
92
94
  // Construct the command
93
95
  const args = ["-C", targetPath, "show", refSpec];
94
96
  logger.debug(`Executing command: git ${args.join(" ")}`, {
@@ -218,7 +218,13 @@ export async function getGitStatus(input, context) {
218
218
  // This handles the case of an empty repo after init but before first commit
219
219
  if (structuredResult.is_clean && !structuredResult.current_branch) {
220
220
  try {
221
- const branchArgs = ["-C", targetPath, "rev-parse", "--abbrev-ref", "HEAD"];
221
+ const branchArgs = [
222
+ "-C",
223
+ targetPath,
224
+ "rev-parse",
225
+ "--abbrev-ref",
226
+ "HEAD",
227
+ ];
222
228
  const { stdout: branchStdout } = await execFileAsync("git", branchArgs);
223
229
  const currentBranchName = branchStdout.trim(); // Renamed variable for clarity
224
230
  if (currentBranchName && currentBranchName !== "HEAD") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyanheads/git-mcp-server",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "description": "An MCP (Model Context Protocol) server enabling LLMs and AI agents to interact with Git repositories. Provides tools for comprehensive Git operations including clone, commit, branch, diff, log, status, push, pull, merge, rebase, worktree, tag management, and more, via the MCP standard. STDIO & HTTP.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -36,15 +36,15 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@hono/node-server": "^1.14.4",
39
- "@modelcontextprotocol/sdk": "^1.13.0",
40
- "@types/node": "^24.0.3",
39
+ "@modelcontextprotocol/sdk": "^1.13.2",
40
+ "@types/node": "^24.0.7",
41
41
  "@types/sanitize-html": "^2.16.0",
42
42
  "@types/validator": "^13.15.2",
43
43
  "chrono-node": "2.8.0",
44
- "dotenv": "^16.5.0",
45
- "hono": "^4.8.2",
44
+ "dotenv": "^17.0.0",
45
+ "hono": "^4.8.3",
46
46
  "jose": "^6.0.11",
47
- "openai": "^5.6.0",
47
+ "openai": "^5.8.2",
48
48
  "partial-json": "^0.1.7",
49
49
  "sanitize-html": "^2.17.0",
50
50
  "tiktoken": "^1.0.21",
@@ -52,7 +52,7 @@
52
52
  "typescript": "^5.8.3",
53
53
  "validator": "^13.15.15",
54
54
  "winston": "^3.17.0",
55
- "winston-transport": "^4.7.0",
55
+ "winston-transport": "^4.9.0",
56
56
  "zod": "^3.25.67"
57
57
  },
58
58
  "keywords": [
@@ -105,8 +105,8 @@
105
105
  "node": ">=20.0.0"
106
106
  },
107
107
  "devDependencies": {
108
- "prettier": "^3.5.3",
109
- "typedoc": "^0.28.5"
108
+ "prettier": "^3.6.2",
109
+ "typedoc": "^0.28.6"
110
110
  },
111
111
  "publishConfig": {
112
112
  "access": "public"