Skip to content

Conversation

@alfonsodg
Copy link
Contributor

Problem

The GITLAB_API_URL constant was reading directly from process.env.GITLAB_API_URL, ignoring the --api-url CLI argument.

Solution

Changed line 1393 to use getConfig('api-url', 'GITLAB_API_URL') instead of process.env.GITLAB_API_URL, consistent with how other configuration options are handled.

Testing

node build/index.js --token=xxx --api-url=https://gitlab.example.com/api/v4

Now correctly uses the CLI argument instead of requiring the environment variable.

Allows configuration via command-line arguments for MCP clients
that don't support environment variables (like GitHub Copilot CLI).

CLI arguments take precedence over environment variables.

Available arguments:
- --token: GitLab Personal Access Token
- --api-url: GitLab API URL
- --read-only: Enable read-only mode
- --use-wiki: Enable wiki API
- --use-milestone: Enable milestone API
- --use-pipeline: Enable pipeline API

Example:
  npx @zereight/mcp-gitlab --token=glpat-xxx --api-url=https://gitlab.com/api/v4
- Integrate multi-URL support for GITLAB_API_URL
- Add ENABLE_DYNAMIC_API_URL and GITLAB_POOL_MAX_SIZE options
- Update HOST default to 127.0.0.1
- Maintain CLI arguments support for all new options
- Bump version to 2.0.22
Merged latest changes from upstream repository.
The GITLAB_API_URL constant was reading directly from process.env,
ignoring the --api-url CLI argument. Now uses getConfig() like other
configuration options.
Copilot AI review requested due to automatic review settings January 20, 2026 19:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the GITLAB_API_URL configuration was reading directly from the environment variable, ignoring the --api-url CLI argument. The fix changes line 1393 in index.ts to use the getConfig helper function, which properly prioritizes CLI arguments over environment variables.

Changes:

  • Updated GITLAB_API_URL initialization to use getConfig('api-url', 'GITLAB_API_URL') instead of process.env.GITLAB_API_URL
  • Changed package name and description in package.json

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
index.ts Fixed GITLAB_API_URL initialization to properly support --api-url CLI argument using getConfig helper
package.json Updated package name to @alfonsodg/mcp-gitlab and modified description

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +2 to +4
"name": "@alfonsodg/mcp-gitlab",
"version": "2.0.24",
"description": "MCP server for using the GitLab API",
"description": "MCP server for using the GitLab API (with CLI args support)",
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package name change from @zereight/mcp-gitlab to @alfonsodg/mcp-gitlab and description update appear to be unrelated to the PR's stated purpose of fixing the --api-url CLI argument support. If this is intended as a fork, these changes should be in a separate PR or clearly documented in the PR description. Additionally, note that line 6 still shows the original author as "zereight" and line 14 still points to the original repository URL, which may need updating for consistency if this is a fork.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant