-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
Describe the bug
The GitLab MCP server fails to connect to a private GitLab instance despite correct configuration. When attempting to use the MCP to interact with repositories, it returns "failed to create client" errors, even though direct API calls using curl with the same credentials work correctly.
To Reproduce
Steps to reproduce the behavior:
- Configure the GitLab MCP server in
.cursor/mcp.jsonwith the correct API URL and token - Try to use the MCP to search for repositories or access project information
- Receive "failed to create client" error
We also tried running the MCP server directly from the command line with the same environment variables, but encountered the same issue.
We also tried an alternative implementation with @zereight/mcp-gitlab, but this also failed to connect properly.
Expected behavior
The GitLab MCP server should successfully connect to the private GitLab instance and allow operations like searching for repositories, accessing project information, and performing other GitLab API operations.
Logs
When attempting to use the MCP, we receive errors like:
"error":"MCP error -32603: Invalid arguments: items.0.owner: Required, items.0.fork: Required..."
And when trying to get file contents:
"error":"MCP error -32603: GitLab API error: Not Found"
However, direct API calls using curl with the same credentials work perfectly.
Additional context
The issue appears to be with how the MCP server handles the API responses from the private GitLab instance. The error suggests that the MCP server expects certain fields (owner and fork) to be present in the response items, but they might be missing or have a different structure in our private GitLab instance.