-
Notifications
You must be signed in to change notification settings - Fork 213
fix: use getConfig for GITLAB_API_URL to support --api-url CLI argument #327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
There was a problem hiding this 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_URLinitialization to usegetConfig('api-url', 'GITLAB_API_URL')instead ofprocess.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.
| "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)", |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
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.
Problem
The
GITLAB_API_URLconstant was reading directly fromprocess.env.GITLAB_API_URL, ignoring the--api-urlCLI argument.Solution
Changed line 1393 to use
getConfig('api-url', 'GITLAB_API_URL')instead ofprocess.env.GITLAB_API_URL, consistent with how other configuration options are handled.Testing
Now correctly uses the CLI argument instead of requiring the environment variable.