@andrebuzeli/git-mcp 5.9.0 → 6.0.0

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.
@@ -13,16 +13,14 @@ class GitIssuesTool {
13
13
  if (!action)
14
14
  throw new errors_1.MCPError('VALIDATION_ERROR', 'action is required');
15
15
  // Auto-extract repo info if projectPath is provided
16
- let owner = params.owner;
17
16
  let repo = params.repo;
18
17
  if (!repo && params.projectPath) {
19
18
  const repoInfo = (0, repoHelpers_1.getRepoInfo)(params.projectPath);
20
19
  repo = repoInfo.repoName;
21
- owner = owner || repoInfo.githubOwner || repoInfo.giteaOwner;
22
20
  }
23
- // Use env vars as fallback
24
- const githubOwner = owner || process.env.GITHUB_USERNAME;
25
- const giteaOwner = owner || process.env.GITEA_USERNAME;
21
+ // Each provider uses its own username from env
22
+ const githubOwner = process.env.GITHUB_USERNAME;
23
+ const giteaOwner = process.env.GITEA_USERNAME;
26
24
  switch (action) {
27
25
  case 'create': {
28
26
  if (!params.title)
@@ -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 Upload Tool - Envia projeto completo para GitHub e Gitea automaticamente
47
48
  * Modo DUAL automático com rastreabilidade completa
@@ -56,7 +57,7 @@ class GitUploadTool {
56
57
  if (!projectPath) {
57
58
  throw new errors_1.MCPError('VALIDATION_ERROR', 'projectPath is required');
58
59
  }
59
- const repoName = params.repoName || path.basename(projectPath);
60
+ const repoName = params.repoName || (0, repoHelpers_1.getRepoNameFromPath)(projectPath);
60
61
  const description = params.description || `Project uploaded via git-upload at ${new Date().toISOString()}`;
61
62
  const isPrivate = params.private !== undefined ? params.private : true;
62
63
  const branch = params.branch || 'master';
@@ -130,8 +131,8 @@ class GitUploadTool {
130
131
  }
131
132
  // 4. Criar repositórios remotos em ambos providers
132
133
  // Nota: Cada provider precisa usar seu próprio username (Gitea é case-sensitive)
133
- const githubOwner = params.owner || process.env.GITHUB_USERNAME;
134
- const giteaOwner = params.owner || process.env.GITEA_USERNAME;
134
+ const githubOwner = process.env.GITHUB_USERNAME;
135
+ const giteaOwner = process.env.GITEA_USERNAME;
135
136
  // GITHUB
136
137
  if (ctx.providerManager.github) {
137
138
  results.traceability.uploadSteps.push({
@@ -3,6 +3,7 @@
3
3
  */
4
4
  /**
5
5
  * Extract repository name from project path
6
+ * Normalizes: spaces to hyphens, lowercase, removes special chars
6
7
  */
7
8
  export declare function getRepoNameFromPath(projectPath: string): string;
8
9
  /**
@@ -16,9 +16,13 @@ const path_1 = __importDefault(require("path"));
16
16
  */
17
17
  /**
18
18
  * Extract repository name from project path
19
+ * Normalizes: spaces to hyphens, lowercase, removes special chars
19
20
  */
20
21
  function getRepoNameFromPath(projectPath) {
21
- return path_1.default.basename(projectPath).replace(/\s+/g, '-');
22
+ return path_1.default.basename(projectPath)
23
+ .toLowerCase()
24
+ .replace(/\s+/g, '-')
25
+ .replace(/[^a-z0-9-]/g, '');
22
26
  }
23
27
  /**
24
28
  * Get GitHub owner from environment
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@andrebuzeli/git-mcp",
3
- "version": "5.9.0",
4
- "description": "Professional MCP server for Git operations - automatic dual-provider execution (GitHub + Gitea), intelligent parameter extraction from environment and projectPath, no redundant parameters needed, organized responses by provider, enhanced security and safety features",
3
+ "version": "6.0.0",
4
+ "description": "Professional MCP server for Git operations - FULLY AUTONOMOUS: each provider uses own username from env, repo name auto-normalized from projectPath (spaces→hyphens, lowercase, safe chars), zero redundant parameters, automatic dual-provider execution (GitHub + Gitea)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "bin": {