Use this API to connect Model Context Protocol (MCP) clients to the GitLab MCP server.

Get MCP response listener

GET /api/v4/mcp

Listens for Model Context Protocol responses

Responses

CodeDescriptionSchema
200OK—
401Unauthorized—
403Forbidden—
404Not found—
405Method not allowed—

Create MCP request handler

POST /api/v4/mcp

Handles Model Context Protocol requests

Request body (application/json)

PropertyTypeDescription
idInteger or stringID of the JSON-RPC request returned in the response
jsonrpc
Required
StringJSON-RPC protocol version identifier. Must be 2.0
Allowed values: 2.0
Minimum length: 1
method
Required
StringName of the JSON-RPC method invoked on the MCP server
paramsObject or arrayObject or array that contains parameters passed to the specified JSON-RPC method

Responses

CodeDescriptionSchema
201Created—
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—