Skip to content

Self-hosted GitLab with HTTP: "Protocol 'http:' not supported" error #370

@xPalo

Description

@xPalo

Description

When using a self-hosted GitLab instance that returns http:// URLs in API responses (e.g. self links, resource URLs), some operations fail with:

MCP error -32603: Protocol "http:" not supported. Expected "https:"

This happens even when GITLAB_API_URL is set to https://. The issue is that GitLab API responses may contain internal links using http:// (common in self-hosted setups where external_url differs from the actual protocol), and the MCP server's HTTP client rejects them.

Steps to reproduce

  1. Configure a self-hosted GitLab instance that returns http:// in API response bodies
  2. Set GITLAB_API_URL=https://gitlab.example.com/api/v4
  3. Call any tool that follows URLs from API responses, e.g. get_project

Expected behavior

The server should handle http:// URLs from API responses, or at minimum use the protocol from GITLAB_API_URL when constructing follow-up requests.

Actual behavior

Error: MCP error -32603: Protocol "http:" not supported. Expected "https:"

Workaround

Pinning to an older version (@zereight/mcp-gitlab@2.0.25) seem to avoid the issue.
EDIT: Downgrading to v2.0.25 fixed issue mentioned above, but introduces occasional HTTP 500 internal errors

Environment

  • @zereight/mcp-gitlab@2.0.32 (latest to date via npx)
  • Self-hosted GitLab with HTTPS proxy but HTTP internal (dockerized) URLs
  • Claude Code CLI

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions