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
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
405 | Method not allowed | — |
Create MCP request handler
POST /api/v4/mcp
Handles Model Context Protocol requests
Request body (application/json)
| Property | Type | Description |
|---|---|---|
id | Integer or string | ID of the JSON- |
jsonrpcRequired | String | JSON-2.Allowed values: 2.Minimum length: 1 |
methodRequired | String | Name of the JSON- |
params | Object or array | Object or array that contains parameters passed to the specified JSON- |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |