Troubleshooting the GitLab MCP server

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
  • Status: Beta

When working with the GitLab MCP server, you might encounter the following issues.

Error: 403 Forbidden

You might get this error when you start the GitLab MCP server. You might also get this error when POST /api/v4/mcp or GET /api/v4/mcp returns 403 Forbidden after the OAuth flow completes.

In GitLab 19.4 and earlier, the same issue returns 404 Not Found instead. Both status codes share the same causes.

To resolve this issue, make sure you meet the prerequisites for the GitLab MCP server.

To find the cause, read the message in the response body. Administrators can also check the denial_reason field in the mcp.log file:

  • MCP server disabled for this instance (denial_reason: instance_setting_disabled): On GitLab Self-Managed, an administrator turned off the MCP server for the instance.
  • MCP server not enabled for any of your groups (denial_reason: no_enabled_namespace): On GitLab.com, no top-level group you belong to has the MCP server turned on.

404 errors returned by a REST-backed tool call, for example 404 Project Not Found, appear in the JSON-RPC response body with isError: true, and in mcp.log with tool_status set to not_found. Other tool call failures also appear in the response body with isError: true, and in mcp.log with a tool_status that describes what happened.

Error: Server's protocol version is not supported: 2025-06-18

In GitLab 18.6 and earlier, you might get this error when the MCP client library does not support the GitLab MCP server protocol specification.

To resolve this issue, ask the AI tool provider to update their client implementation.

Error: rate_limited tool result

You might get a tool result with isError: true, even though the MCP server itself returned 200 OK. This happens when a tool call hits a rate limit on the underlying GitLab API endpoint it calls, for example the search rate limit when a search tool runs.

The MCP server does not return 429 Too Many Requests for this case. Instead, it follows the Model Context Protocol specification, which classifies API failures as tool execution errors reported in the result so a client or language model can read them and self-correct.

The content field contains a human-readable message, for example:

Rate limited by search_rate_limit. Retry after 60 seconds.

The structuredContent field contains machine-readable retry detail:

json
{
  "error": {
    "type": "rate_limited",
    "retry_after_seconds": 60,
    "limit": "search_rate_limit",
    "message": "This endpoint has been requested too many times. Try again later."
  }
}

To resolve this issue, wait and retry the tool call. When you build an MCP client, check error.type == "rate_limited" rather than match on the message text, because the wording can change. Use limit to identify which rate limit was hit, as a single tool call can consume more than one. Treat retry_after_seconds as a safe upper bound rather than an exact wait time, because it is the full rate limit period rather than the time remaining in the current window.

retry_after_seconds and limit are present only when the endpoint that GitLab called provided them. Always handle a response where these fields are absent. Administrators can change rate limits for individual endpoints, so actual values vary by instance.

Troubleshoot the GitLab MCP Server in Cursor

  1. In Cursor, to open the Output view, do one of the following:
    • Go to View > Output.
    • In macOS, press Command+Shift+U.
    • In Windows or Linux, press Control+Shift+U.
  2. In the Output view, select MCP:SERVERNAME. The name depends on the MCP configuration value. The example with GitLab results in MCP: user-GitLab.
  3. When reporting bugs, copy the output into the issue template logs section.

Troubleshoot the GitLab MCP Server on the CLI with mcp-remote

  1. Install Node.js version 20 or later.

  2. To test the exact same command as the IDEs and desktop clients:

    1. Extract the MCP configuration.
    2. Assemble the npx command string into one line.
    3. Run the command string.
    shell
    rm -rf ~/.mcp-auth/mcp-remote*
    
    npx -y mcp-remote@latest https://gitlab.example.com/api/v4/mcp --static-oauth-client-metadata '{"scope": "mcp"}'
  3. Add the --debug parameter to log more verbose output:

    shell
    rm -rf ~/.mcp-auth/mcp-remote*
    
    npx -y mcp-remote@latest https://gitlab.example.com/api/v4/mcp --static-oauth-client-metadata '{"scope": "mcp"}' --debug
  4. Optional. Run the mcp-remote-client executable directly.

    shell
    rm -rf ~/.mcp-auth/mcp-remote*
    
    npx -p mcp-remote@latest mcp-remote-client https://gitlab.example.com/api/v4/mcp --static-oauth-client-metadata '{"scope": "mcp"}'
  5. Optional. If you encounter version-specific bugs, pin the version of the mcp-remote module to a specific version. For example, use mcp-remote@0.1.26 to pin the version to 0.1.26.

    For security reasons, you should not pin versions if possible.

Troubleshoot GitLab MCP Server with Claude Desktop

Verify the installed Node.js versions. Claude Desktop requires Node.js version 20 or later.

shell
for n in $(which -a node); do echo "$n" && $n -v; done

Delete MCP authentication caches

The MCP authentication is heavily cached locally. While troubleshooting, you might encounter false positives. To prevent these, delete the cache directory during troubleshooting:

shell
rm -rf ~/.mcp-auth/mcp-remote*

Debugging and development tools

MCP Inspector is an interactive developer tool for testing and debugging MCP servers. To run this tool, use the command line and access the web interface to inspect the GitLab MCP Server.

shell
npx -y @modelcontextprotocol/inspector npx