gitlab-mcp-agent-server 0.2.0 → 0.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.
@@ -11,12 +11,12 @@ class ProjectResolver {
11
11
  if (project !== undefined && project !== null && String(project).trim() !== '') {
12
12
  return project;
13
13
  }
14
- if (this.config.gitlab.defaultProject) {
15
- return this.config.gitlab.defaultProject;
16
- }
17
14
  if (this.config.gitlab.autoResolveProjectFromGit && this.config.gitlab.autoDetectedProject) {
18
15
  return this.config.gitlab.autoDetectedProject;
19
16
  }
17
+ if (this.config.gitlab.defaultProject) {
18
+ return this.config.gitlab.defaultProject;
19
+ }
20
20
  throw new errors_1.ConfigurationError('Project is not resolved. Provide `project` in tool input or set GITLAB_DEFAULT_PROJECT.');
21
21
  }
22
22
  }
@@ -111,6 +111,9 @@ class GitLabOAuthManager {
111
111
  server.close();
112
112
  resolve(authCode);
113
113
  });
114
+ server.on('error', (error) => {
115
+ reject(new Error(`OAuth callback server failed on ${redirect.hostname}:${resolvePort(redirect)}: ${error.message}`));
116
+ });
114
117
  server.listen(resolvePort(redirect), redirect.hostname, () => {
115
118
  const opened = this.options.openBrowser && openInBrowser(localEntryUrl);
116
119
  if (!opened) {
@@ -60,7 +60,7 @@ export GITLAB_OAUTH_TOKEN_STORE_PATH="$HOME/.config/gitlab-mcp/token.json";
60
60
  export GITLAB_OAUTH_AUTO_LOGIN="true";
61
61
  export GITLAB_OAUTH_OPEN_BROWSER="false";
62
62
 
63
- # optional
63
+ # optional fallback if auto-detect from git remote is unavailable
64
64
  export GITLAB_DEFAULT_PROJECT="group/repo";
65
65
  export GITLAB_AUTO_RESOLVE_PROJECT_FROM_GIT="true";
66
66
 
@@ -97,7 +97,7 @@ npx -y gitlab-mcp-agent-server
97
97
  2. Ограничь права файла:
98
98
  - `chmod 600 /home/<user>/.config/gitlab-mcp/token.json`
99
99
  3. Оставь `GITLAB_OAUTH_OPEN_BROWSER=false` для headless окружений.
100
- 4. Обязательно заполни `GITLAB_DEFAULT_PROJECT`, если агент должен работать в одном проекте.
100
+ 4. Для multi-repo режима лучше не задавать `GITLAB_DEFAULT_PROJECT`, чтобы проект брался из `git remote` текущего `cwd`.
101
101
 
102
102
  ## 7. Быстрая проверка работоспособности
103
103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitlab-mcp-agent-server",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "MCP server for GitLab integration via OAuth",
5
5
  "main": "build/src/index.js",
6
6
  "bin": {