Skip to content

MCP client sends deprecated protocol version causing GitLab MCP server to fail (401) #20239

Description

@pmontanari

Description

OpenCode MCP client fails to connect to GitLab MCP server (v18.9+) with 401 Unauthorized error.

Environment

  • OpenCode version: 1.3.9
  • GitLab version: 18.9.2-ee
  • GitLab MCP endpoint: /api/v4/mcp

Steps to Reproduce

  1. Configure photon MCP server with GitLab self-managed instance (18.9+)
  2. Run opencode mcp list or opencode mcp debug photon

Expected Result

MCP connection succeeds with successful handshake

Actual Result

HTTP response: 401 Unauthorized
Server returned 401 Unauthorized
Connection error: Streamable HTTP error: Error POSTing to endpoint: {\"message\":\"Invalid params\",\"data\":{\"params\":\"Unsupported protocol version '2024-11-05'. Supported: 2025-06-18, 2025-03-26, 2025-11-25\"}}

Root Cause

OpenCode MCP client sends protocolVersion: "2024-11-05" in the initialize request, but GitLab 18.9+ only supports:

  • 2025-06-18
  • 2025-03-26
  • 2025-11-25

The client needs to be updated to use a supported protocol version.

Workaround

None - the protocol version is hardcoded in the client.

Verification

Manual test with curl using correct protocol version succeeds:

```bash
curl -sk -X POST "https://gitlab.example.com/api/v4/mcp"
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

Returns: {"jsonrpc":"2.0","result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{"listChanged":false}},"serverInfo":{"name":"Official GitLab MCP Server","version":"18.9.2-ee"},"id":1}}

```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions