@andrebuzeli/git-mcp 7.2.0 → 7.2.1

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.
@@ -42,6 +42,7 @@ const errors_1 = require("../utils/errors");
42
42
  const axios_1 = __importDefault(require("axios"));
43
43
  const fs = __importStar(require("fs/promises"));
44
44
  const path = __importStar(require("path"));
45
+ const repoHelpers_1 = require("../utils/repoHelpers");
45
46
  /**
46
47
  * Git History Tool - Mantém histórico detalhado de TODAS alterações
47
48
  * Modo DUAL automático - cria issues de histórico em GitHub e Gitea
@@ -125,7 +126,7 @@ class GitHistoryTool {
125
126
  // 3. Criar issue de histórico em ambos providers
126
127
  const githubOwner = params.owner || process.env.GITHUB_USERNAME;
127
128
  const giteaOwner = params.owner || process.env.GITEA_USERNAME;
128
- const repo = params.repo || path.basename(projectPath);
129
+ const repo = params.repo || (0, repoHelpers_1.getRepoNameFromPath)(projectPath);
129
130
  const historyTitle = params.title || `[${results.traceability.changeDetails.category}] ${results.traceability.changeDetails.description}`;
130
131
  const historyBody = this.formatHistoryBody(results.traceability.changeDetails, params);
131
132
  // GITHUB
@@ -235,7 +236,7 @@ class GitHistoryTool {
235
236
  const localHistory = await this.listLocalHistory(projectPath);
236
237
  const githubOwner = params.owner || process.env.GITHUB_USERNAME;
237
238
  const giteaOwner = params.owner || process.env.GITEA_USERNAME;
238
- const repo = params.repo || path.basename(projectPath);
239
+ const repo = params.repo || (0, repoHelpers_1.getRepoNameFromPath)(projectPath);
239
240
  for (const historyEntry of localHistory.history) {
240
241
  if (!historyEntry.synced) {
241
242
  try {
@@ -42,6 +42,7 @@ const errors_1 = require("../utils/errors");
42
42
  const axios_1 = __importDefault(require("axios"));
43
43
  const fs = __importStar(require("fs/promises"));
44
44
  const path = __importStar(require("path"));
45
+ const repoHelpers_1 = require("../utils/repoHelpers");
45
46
  /**
46
47
  * Git Update Tool - Atualiza projeto completo em GitHub e Gitea automaticamente
47
48
  * Modo DUAL automático com rastreabilidade completa
@@ -150,7 +151,7 @@ class GitUpdateTool {
150
151
  let githubRemote = remotes.find(r => r.name === 'github' || r.name === 'origin');
151
152
  let giteaRemote = remotes.find(r => r.name === 'gitea');
152
153
  // Auto-create repos if they don't exist
153
- const repoName = params.repoName || path.basename(projectPath);
154
+ const repoName = params.repoName || (0, repoHelpers_1.getRepoNameFromPath)(projectPath);
154
155
  const description = params.description || `Project updated via git-update at ${new Date().toISOString()}`;
155
156
  const isPrivate = params.private !== undefined ? params.private : true;
156
157
  const githubOwner = params.owner || process.env.GITHUB_USERNAME;
@@ -267,7 +268,7 @@ class GitUpdateTool {
267
268
  try {
268
269
  if (results.traceability.commit?.hash) {
269
270
  const githubOwner = params.owner || process.env.GITHUB_USERNAME;
270
- const repo = path.basename(projectPath);
271
+ const repo = (0, repoHelpers_1.getRepoNameFromPath)(projectPath);
271
272
  const commitInfo = await ctx.providerManager.github.rest.repos.getCommit({
272
273
  owner: githubOwner,
273
274
  repo,
@@ -319,7 +320,7 @@ class GitUpdateTool {
319
320
  try {
320
321
  if (results.traceability.commit?.hash) {
321
322
  const giteaOwner = params.owner || process.env.GITEA_USERNAME;
322
- const repo = path.basename(projectPath);
323
+ const repo = (0, repoHelpers_1.getRepoNameFromPath)(projectPath);
323
324
  const commitInfo = await axios_1.default.get(`${ctx.providerManager.giteaBaseUrl}/api/v1/repos/${giteaOwner}/${repo}/git/commits/${results.traceability.commit.hash}`, { headers: { Authorization: `token ${ctx.providerManager.giteaToken}` } });
324
325
  results.providers.gitea.commitVerified = true;
325
326
  results.providers.gitea.commitUrl = commitInfo.data.html_url;
@@ -395,7 +396,7 @@ class GitUpdateTool {
395
396
  // Pegar nome do repo dos remotes do Git ao invés do nome da pasta
396
397
  const git = (0, simple_git_1.default)(projectPath);
397
398
  const remotes = await git.getRemotes(true);
398
- let repoName = path.basename(projectPath).replace(/\s+/g, '-'); // fallback
399
+ let repoName = (0, repoHelpers_1.getRepoNameFromPath)(projectPath); // fallback
399
400
  if (remotes.length > 0) {
400
401
  const githubRemote = remotes.find(r => r.name === 'github') || remotes.find(r => r.name === 'origin') || remotes[0];
401
402
  const match = githubRemote.refs.push?.match(/\/([^\/]+?)(\.git)?$/);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrebuzeli/git-mcp",
3
- "version": "7.2.0",
3
+ "version": "7.2.1",
4
4
  "description": "Professional MCP server for Git operations - STDIO UNIVERSAL: works in ANY IDE (Cursor, VSCode, Claude Desktop). Fully autonomous DUAL execution (GitHub + Gitea APIs) with automatic username detection. All tools execute on BOTH providers simultaneously. No manual parameters needed.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -51,29 +51,28 @@
51
51
  },
52
52
  "homepage": "https://github.com/andrebuzeli/git-mcp#readme",
53
53
  "dependencies": {
54
- "@modelcontextprotocol/sdk": "^0.4.0",
55
54
  "@octokit/rest": "^20.0.0",
55
+ "ajv": "^8.12.0",
56
56
  "axios": "^1.6.0",
57
- "simple-git": "^3.20.0",
58
- "express": "^4.18.2",
59
57
  "body-parser": "^1.20.2",
60
- "ajv": "^8.12.0"
58
+ "express": "^4.18.2",
59
+ "simple-git": "^3.20.0"
61
60
  },
62
61
  "devDependencies": {
63
- "semantic-release": "^20.1.0",
64
- "@semantic-release/npm": "^10.0.0",
65
- "@semantic-release/github": "^9.0.0",
66
62
  "@semantic-release/commit-analyzer": "^10.0.0",
63
+ "@semantic-release/github": "^9.0.0",
64
+ "@semantic-release/npm": "^10.0.0",
67
65
  "@semantic-release/release-notes-generator": "^10.0.0",
68
- "@types/node": "^20.0.0",
69
- "@types/express": "^4.17.17",
70
66
  "@types/body-parser": "^1.19.2",
67
+ "@types/express": "^4.17.17",
71
68
  "@types/jest": "^29.0.0",
72
- "typescript": "^5.0.0",
69
+ "@types/node": "^20.0.0",
73
70
  "jest": "^29.0.0",
74
- "ts-node": "^10.0.0",
71
+ "rimraf": "^5.0.0",
72
+ "semantic-release": "^20.1.0",
75
73
  "ts-jest": "^29.0.0",
76
- "rimraf": "^5.0.0"
74
+ "ts-node": "^10.0.0",
75
+ "typescript": "^5.0.0"
77
76
  },
78
77
  "engines": {
79
78
  "node": ">=18.0.0"