@andre.buzeli/git-mcp 16.0.4 → 16.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andre.buzeli/git-mcp",
3
- "version": "16.0.4",
3
+ "version": "16.0.5",
4
4
  "private": false,
5
5
  "description": "MCP server para Git com operações locais e sincronização paralela GitHub/Gitea",
6
6
  "license": "MIT",
@@ -292,8 +292,13 @@ EXEMPLOS DE USO:
292
292
  }
293
293
 
294
294
  const ensured = await pm.ensureRepos({ repoName: repo, createIfMissing: true, isPublic, organization });
295
- const urls = await pm.getRemoteUrls(repo, organization);
296
- await git.ensureRemotes(projectPath, { githubUrl: urls.github || "", giteaUrl: urls.gitea || "" });
295
+ // Build URLs from actual ensureRepos results (handles GitHub fallback to personal account)
296
+ const githubUrl = ensured.github?.ok && ensured.github.repo
297
+ ? `https://github.com/${ensured.github.repo}.git` : "";
298
+ const giteaBase = pm.giteaUrl?.replace(/\/$/, "");
299
+ const giteaUrl = ensured.gitea?.ok && ensured.gitea.repo && giteaBase
300
+ ? `${giteaBase}/${ensured.gitea.repo}.git` : "";
301
+ await git.ensureRemotes(projectPath, { githubUrl, giteaUrl, organization });
297
302
  const remotes = await git.listRemotes(projectPath);
298
303
  return asToolResult({ success: true, ensured, remotes, isPrivate: !isPublic, organization: organization || undefined }, { tool: 'workflow', action: 'ensure-remotes' });
299
304
  }
@@ -396,9 +401,15 @@ EXEMPLOS DE USO:
396
401
  const organization = args.organization || undefined;
397
402
  if (organization) {
398
403
  const repo = getRepoNameFromPath(projectPath);
399
- await pm.ensureRepos({ repoName: repo, createIfMissing: true, organization });
400
- const urls = await pm.getRemoteUrls(repo, organization);
401
- await git.ensureRemotes(projectPath, { githubUrl: urls.github || "", giteaUrl: urls.gitea || "" });
404
+ const isPublic = args.isPublic === true;
405
+ const ensured = await pm.ensureRepos({ repoName: repo, createIfMissing: true, isPublic, organization });
406
+ // Build URLs from actual ensureRepos results (handles GitHub fallback to personal account)
407
+ const githubUrl = ensured.github?.ok && ensured.github.repo
408
+ ? `https://github.com/${ensured.github.repo}.git` : "";
409
+ const giteaBase = pm.giteaUrl?.replace(/\/$/, "");
410
+ const giteaUrl = ensured.gitea?.ok && ensured.gitea.repo && giteaBase
411
+ ? `${giteaBase}/${ensured.gitea.repo}.git` : "";
412
+ await git.ensureRemotes(projectPath, { githubUrl, giteaUrl, organization });
402
413
  }
403
414
 
404
415
  // 4. Push