### Example: Local Single PAT Configuration Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/custom-agent-multiple-pat.md A basic configuration example for a local single-PAT setup. ```bash GITLAB_PERSONAL_ACCESS_TOKEN=glpat-local-user GITLAB_API_URL=https://gitlab.com/api/v4 npx -y @zereight/mcp-gitlab ``` -------------------------------- ### GitLab CI Configuration for Testing Source: https://github.com/zereight/gitlab-mcp/blob/main/test/README.md Example GitLab CI script to install dependencies, build the project, and run the full test suite. It also shows how to set required environment variables. ```yaml test: script: - npm install - npm run build - npm run test:all variables: GITLAB_PERSONAL_ACCESS_TOKEN: $CI_JOB_TOKEN GITLAB_PROJECT_ID: $CI_PROJECT_ID ``` -------------------------------- ### Install GitLab MCP Skill Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Use this command to install the GitLab MCP skill files using the skills CLI. Ensure you have Node.js and npm/npx installed. ```bash npx skills add zereight/gitlab-mcp --skill gitlab-mcp-skill ``` -------------------------------- ### Start GitLab MCP Server Source: https://github.com/zereight/gitlab-mcp/blob/main/docker/README.md Start the GitLab MCP server in detached mode using Docker Compose. ```bash docker compose up -d ``` -------------------------------- ### Update Note Body (Validation Example) Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/resolve-issue-thread.md A minimal example demonstrating how to update a note's body, used for validation purposes. This snippet focuses solely on the 'body' parameter. ```json { "body": "New content" } ``` -------------------------------- ### Set up environment variables Source: https://github.com/zereight/gitlab-mcp/blob/main/docker/README.md Navigate to the docker directory and copy the example environment file to create a new .env file. ```bash cd docker cp .env.example .env ``` -------------------------------- ### Resolve a Thread (Validation Example) Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/resolve-issue-thread.md A minimal example demonstrating how to resolve a thread, used for validation purposes. This snippet focuses solely on the 'resolved' parameter. ```json { "resolved": true } ``` -------------------------------- ### Example: Hosted Multi-User HTTP Server Configuration Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/custom-agent-multiple-pat.md Configuration for a hosted multi-user HTTP server with session timeout. Clients must provide authentication headers. ```bash STREAMABLE_HTTP=true REMOTE_AUTHORIZATION=true SESSION_TIMEOUT_SECONDS=3600 GITLAB_API_URL=https://gitlab.com/api/v4 npx -y @zereight/mcp-gitlab ``` ```http Authorization: Bearer ``` ```http Private-Token: ``` -------------------------------- ### Unresolve a Thread (Validation Example) Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/resolve-issue-thread.md A minimal example demonstrating how to unresolve a thread, used for validation purposes. This snippet focuses solely on the 'resolved' parameter. ```json { "resolved": false } ``` -------------------------------- ### get_project Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a specific project. ```APIDOC ## get_project ### Description Get details of a specific project. ### Method GET ### Endpoint `/projects/:id` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. ``` -------------------------------- ### Multiple GitLab Instances Setup Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/custom-agent-multiple-pat.md Enables dynamic API URL support for a single server connecting to different GitLab instances. Clients include the target instance in the request. ```bash STREAMABLE_HTTP=true REMOTE_AUTHORIZATION=true ENABLE_DYNAMIC_API_URL=true npx -y @zereight/mcp-gitlab ``` ```http X-GitLab-API-URL: https://gitlab.example.com/api/v4 ``` -------------------------------- ### Client Configuration Example with Cursor Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md This JSON configuration shows how to set up an MCP client, such as Cursor, to use a remote GitLab MCP server, including the necessary authorization headers. ```json { "mcpServers": { "GitLab": { "url": "http(s):///mcp", "headers": { "Authorization": "Bearer glpat-மையில்" } } } } ``` -------------------------------- ### Example Wrapper with mcpServers Object Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/json-mcp-clients-setup.md This JSON demonstrates how to integrate the GitLab MCP server block within a client configuration that expects an `mcpServers` object. It uses the PAT authentication method. ```json { "mcpServers": { "gitlab": { "command": "npx", "args": ["-y", "@zereight/mcp-gitlab"], "env": { "GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-your-token", "GITLAB_API_URL": "https://gitlab.com/api/v4" } } } } ``` -------------------------------- ### Add GitLab MCP Server with PAT Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/claude-code-setup.md Use this command for a fast, personal local setup with a Personal Access Token. Ensure your GitLab API URL is correct. ```bash claude mcp add gitlab --transport stdio \ --scope local \ --env GITLAB_PERSONAL_ACCESS_TOKEN=glpat-your-token \ --env GITLAB_API_URL=https://gitlab.com/api/v4 \ -- npx -y @zereight/mcp-gitlab ``` -------------------------------- ### Example Wrapper with servers Object Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/json-mcp-clients-setup.md This JSON shows how to integrate the GitLab MCP server block within a client configuration that expects a `servers` object. It specifies the 'stdio' type and uses PAT authentication. ```json { "servers": { "gitlab": { "type": "stdio", "command": "npx", "args": ["-y", "@zereight/mcp-gitlab"], "env": { "GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-your-token", "GITLAB_API_URL": "https://gitlab.com/api/v4" } } } } ``` -------------------------------- ### Local Single-PAT Setup Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/custom-agent-multiple-pat.md Use for a single local MCP client accessing GitLab with one Personal Access Token. The server process shares this token for all requests. ```bash GITLAB_PERSONAL_ACCESS_TOKEN=glpat-... GITLAB_API_URL=https://gitlab.com/api/v4 npx -y @zereight/mcp-gitlab ``` -------------------------------- ### Kubernetes Deployment Configuration for Stateless Mode Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/stateless-mode.md Example Kubernetes Deployment YAML to enable stateless mode by mounting the secret. ```yaml apiVersion: apps/v1 kind: Deployment spec: template: spec: containers: - name: gitlab-mcp env: - name: OAUTH_STATELESS_MODE value: "true" - name: OAUTH_STATELESS_SECRET valueFrom: secretKeyRef: name: gitlab-mcp-stateless key: secret - name: STREAMABLE_HTTP value: "true" - name: GITLAB_MCP_OAUTH value: "true" # …other env ``` -------------------------------- ### get_label Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get a single label from a project. ```APIDOC ## get_label ### Description Get a single label from a project. ### Method GET ### Endpoint `/projects/:id/labels/:name` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **name** (string) - Required - The name of the label. ``` -------------------------------- ### Multi-User or Multiple-PAT Setup Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/custom-agent-multiple-pat.md Enables remote authorization for different users or agent sessions requiring distinct GitLab tokens. Clients send their token on each HTTP session. ```bash STREAMABLE_HTTP=true REMOTE_AUTHORIZATION=true GITLAB_API_URL=https://gitlab.com/api/v4 npx -y @zereight/mcp-gitlab ``` ```http Authorization: Bearer glpat-user-token ``` ```http Private-Token: glpat-user-token ``` -------------------------------- ### get_namespace Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a namespace by ID or path. ```APIDOC ## get_namespace ### Description Get details of a namespace by ID or path. ### Method GET ### Endpoint `/namespaces/:id` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or path of the namespace. ``` -------------------------------- ### Example: Restricted Agent Configuration Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/custom-agent-multiple-pat.md Configuration for a restricted agent, limiting tools and requiring confirmation for specific write operations. ```bash STREAMABLE_HTTP=true REMOTE_AUTHORIZATION=true GITLAB_TOOLSETS=issues,merge_requests,projects GITLAB_DENIED_TOOLS_REGEX="^(delete_|merge_)" GITLAB_TOOL_POLICY_APPROVE="create_issue,update_issue,create_merge_request" npx -y @zereight/mcp-gitlab ``` -------------------------------- ### Run GitLab MCP Server Locally for Development Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md This command starts the GitLab MCP server locally using Node.js for development purposes, allowing insecure HTTP connections. It requires specific environment variables to be set. ```bash MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL=true \ STREAMABLE_HTTP=true \ GITLAB_MCP_OAUTH=true \ GITLAB_OAUTH_APP_ID=your-gitlab-oauth-app-client-id \ MCP_SERVER_URL=http://localhost:3002 \ GITLAB_API_URL=https://gitlab.com/api/v4 \ node build/index.js ``` -------------------------------- ### GitLab PAT Setup for Cursor MCP Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/cursor-setup.md Configure GitLab MCP in Cursor using a Personal Access Token (PAT). Ensure the PAT has the necessary scopes (api or read_api) and the correct API URL. ```json { "mcpServers": { "gitlab": { "command": "npx", "args": ["-y", "@zereight/mcp-gitlab"], "env": { "GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-your-token", "GITLAB_API_URL": "https://gitlab.com/api/v4", "GITLAB_READ_ONLY_MODE": "false" } } } } ``` -------------------------------- ### GitLab PAT Setup for VS Code MCP Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/copilot-setup.md Configure a GitLab server using a Personal Access Token for secure access. This snippet is used for workspace or global scope configuration in VS Code. ```json { "inputs": [ { "type": "promptString", "id": "gitlab-token", "description": "GitLab Personal Access Token", "password": true } ], "servers": { "gitlab": { "type": "stdio", "command": "npx", "args": ["-y", "@zereight/mcp-gitlab"], "env": { "GITLAB_PERSONAL_ACCESS_TOKEN": "${input:gitlab-token}", "GITLAB_API_URL": "https://gitlab.com/api/v4", "GITLAB_READ_ONLY_MODE": "false" } } } } ``` -------------------------------- ### Enable Dynamic API URL Feature Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/dynamic-api-url.md Enable the dynamic API URL feature along with remote authorization and streamable HTTP by setting specific environment variables. This is the first step in migrating from a single instance to a multi-instance setup. ```bash ENABLE_DYNAMIC_API_URL=true REMOTE_AUTHORIZATION=true STREAMABLE_HTTP=true ``` -------------------------------- ### Batch Resolution in Workflows Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/resolve-issue-thread.md An example demonstrating how to programmatically resolve issue discussions that meet specific criteria, such as containing certain text. This uses JavaScript to iterate through discussions and notes. ```javascript // Example: Resolve all discussions in an issue that mention "LGTM" const discussions = await listIssueDiscussions(projectId, issueIid); for (const discussion of discussions) { for (const note of discussion.notes) { if (note.body.includes("LGTM") && !note.resolved) { await updateIssueNote(projectId, issueIid, discussion.id, note.id, undefined, true); } } } ``` -------------------------------- ### GitLab OAuth Setup for VS Code MCP Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/copilot-setup.md Configure a GitLab server using OAuth for authentication. This requires a GitLab OAuth Client ID and is suitable for workspace or global scope configuration. ```json { "inputs": [ { "type": "promptString", "id": "gitlab-oauth-client-id", "description": "GitLab OAuth Client ID" } ], "servers": { "gitlab": { "type": "stdio", "command": "npx", "args": ["-y", "@zereight/mcp-gitlab"], "env": { "GITLAB_USE_OAUTH": "true", "GITLAB_OAUTH_CLIENT_ID": "${input:gitlab-oauth-client-id}", "GITLAB_OAUTH_REDIRECT_URI": "http://127.0.0.1:8888/callback", "GITLAB_API_URL": "https://gitlab.com/api/v4" } } } } ``` -------------------------------- ### Define New MCP Tool Configuration Source: https://github.com/zereight/gitlab-mcp/blob/main/test/README.md Example of how to add a new tool to the `mcpTools` array in `readonly-mcp-tests.ts`. This includes defining the tool's name, category, and required status. ```typescript { name: 'new_tool_name', category: 'category', required: true } ``` -------------------------------- ### Connect to GitLab Instances with cURL Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/dynamic-api-url.md Shows how to initiate a session with a GitLab instance using cURL, including the necessary headers for authentication and specifying the API URL. Demonstrates subsequent requests reusing the session ID. ```bash # First request - creates session curl -X POST http://localhost:3002/mcp \ -H "Content-Type: application/json" \ -H "Authorization: Bearer glpat-xxxxxxxxxxxxxxxxxxxx" \ -H "X-GitLab-API-URL: https://gitlab.example.com" \ -d '{ "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "list_projects", "arguments": {} }, "id": 1 }' \ -i # Include headers to see MCP-Session-ID # Subsequent request - reuses session curl -X POST http://localhost:3002/mcp \ -H "Content-Type: application/json" \ -H "MCP-Session-ID: " \ -H "Authorization: Bearer glpat-xxxxxxxxxxxxxxxxxxxx" \ -d '{ "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "get_project", "arguments": { "project_id": "my-group/my-project" } }, "id": 2 }' ``` -------------------------------- ### GitLab OAuth Setup for Cursor MCP Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/cursor-setup.md Configure GitLab MCP in Cursor using OAuth. This requires setting up an OAuth app in GitLab and ensuring the redirect URI matches your configuration. For confidential apps, include the client secret. ```json { "mcpServers": { "gitlab": { "command": "npx", "args": ["-y", "@zereight/mcp-gitlab"], "env": { "GITLAB_USE_OAUTH": "true", "GITLAB_OAUTH_CLIENT_ID": "your-client-id", "GITLAB_OAUTH_REDIRECT_URI": "http://127.0.0.1:8888/callback", "GITLAB_API_URL": "https://gitlab.com/api/v4" } } } } ``` -------------------------------- ### Docker Run Command for Remote Authorization Server Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md This command starts the GitLab MCP server with remote authorization enabled, along with other necessary configurations like streamable HTTP and read-only mode. ```bash # Start server with remote authorization docker run -d \ -e HOST=0.0.0.0 \ -e STREAMABLE_HTTP=true \ -e REMOTE_AUTHORIZATION=true \ -e GITLAB_API_URL="https://gitlab.com/api/v4" \ -e GITLAB_READ_ONLY_MODE=true \ -e SESSION_TIMEOUT_SECONDS=3600 \ -p 3333:3002 \ zereight050/gitlab-mcp ``` -------------------------------- ### get_tag_signature Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get the signature of a signed tag. ```APIDOC ## get_tag_signature ### Description Get the signature of a signed tag. ### Method GET (Assumed) ### Endpoint /projects/:id/repository/tags/:tag_name/signature (Assumed) ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the project - **tag_name** (string) - Required - The name of the tag ``` -------------------------------- ### Example Custom API URL Header Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/dynamic-api-url.md Specify the GitLab API URL for a specific request using the X-GitLab-API-URL header. The URL will be automatically normalized to include the /api/v4 suffix. ```http X-GitLab-API-URL: https://gitlab.example.com ``` -------------------------------- ### get_release Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get a release by tag name. ```APIDOC ## get_release ### Description Get a release by tag name. ### Method GET (Assumed) ### Endpoint /projects/:id/releases/:tag_name (Assumed) ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the project - **tag_name** (string) - Required - The name of the tag ``` -------------------------------- ### Recommended First Prompt for GitLab Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/copilot-setup.md A comprehensive prompt to test GitLab integration, retrieving both projects and recent merge requests. ```text Show me my GitLab projects and recent merge requests. ``` -------------------------------- ### get_commit_diff Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get changes/diffs of a specific commit. ```APIDOC ## get_commit_diff ### Description Get changes/diffs of a specific commit. ### Method GET (Assumed) ### Endpoint /projects/:id/repository/commits/:sha/diff (Assumed) ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the project - **sha** (string) - Required - The SHA of the commit ### Response #### Success Response (200) - **diff** (string) - The diff of the commit ``` -------------------------------- ### get_commit Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a specific commit. ```APIDOC ## get_commit ### Description Get details of a specific commit. ### Method GET ### Endpoint `/projects/:id/repository/commits/:commit_sha` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **commit_sha** (string) - Required - The SHA of the commit. ``` -------------------------------- ### Create Work Item Source: https://github.com/zereight/gitlab-mcp/blob/main/skills/gitlab-mcp/reference/work-items.md Creates a new work item with specified project, title, type, and description. ```bash create_work_item project_id: "my-group/my-project" title: "Investigate checkout failure" work_item_type: "issue" description: "Steps to reproduce..." ``` -------------------------------- ### get_milestone Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a specific milestone. ```APIDOC ## get_milestone ### Description Get details of a specific milestone. ### Method GET ### Endpoint `/projects/:id/milestones/:milestone_id` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **milestone_id** (integer) - Required - The ID of the milestone. ``` -------------------------------- ### Recommended First Prompt for GitLab Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/codex-setup.md This prompt is suggested for initial interaction with the GitLab MCP to list projects and recent merge requests. ```text List my GitLab projects and recent merge requests. ``` -------------------------------- ### get_issue_link Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get a specific issue link. ```APIDOC ## get_issue_link ### Description Get a specific issue link. ### Method GET ### Endpoint `/projects/:id/issues/:issue_iid/links/:link_id` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **issue_iid** (integer) - Required - The ID of the issue. - **link_id** (integer) - Required - The ID of the issue link. ``` -------------------------------- ### Connect to Multiple GitLab Instances with JavaScript Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/dynamic-api-url.md Demonstrates making initial requests to different GitLab instances using custom headers like 'X-GitLab-API-URL' to establish sessions. Subsequent requests reuse the obtained session IDs. ```javascript // First request to gitlab.com const response1 = await fetch('http://localhost:3002/mcp', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer glpat-token-for-gitlab-com', 'X-GitLab-API-URL': 'https://gitlab.com' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'tools/call', params: { name: 'list_projects', arguments: {} }, id: 1 }) }); const session1 = response1.headers.get('mcp-session-id'); // Second request to self-hosted GitLab (different session) const response2 = await fetch('http://localhost:3002/mcp', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Private-Token': 'glpat-token-for-self-hosted', 'X-GitLab-API-URL': 'https://gitlab.company.com' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'tools/call', params: { name: 'list_projects', arguments: {} }, id: 2 }) }); const session2 = response2.headers.get('mcp-session-id'); // Subsequent requests use the session ID const response3 = await fetch('http://localhost:3002/mcp', { method: 'POST', headers: { 'Content-Type': 'application/json', 'MCP-Session-ID': session1, 'Authorization': 'Bearer glpat-token-for-gitlab-com' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'tools/call', params: { name: 'get_project', arguments: { project_id: 'my-project' } }, id: 3 }) }); ``` -------------------------------- ### get_merge_request_diffs Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get the changes/diffs of a merge request. ```APIDOC ## get_merge_request_diffs ### Description Get the changes/diffs of a merge request. Either `mergeRequestIid` or `branchName` must be provided. ### Method GET ### Endpoint /get_merge_request_diffs ### Parameters #### Path Parameters None #### Query Parameters - **mergeRequestIid** (string) - Optional - The IID of the merge request. - **branchName** (string) - Optional - The name of the branch associated with the merge request. - **project_id** (string) - Optional - The ID or URL-encoded path of the project. ### Request Example ```json { "mergeRequestIid": "15", "project_id": "your/project-id" } ``` ### Response #### Success Response (200) - **diffs** (array) - An array of diff objects, each representing changes to a file. - Each diff object contains: - **new_path** (string) - The new path of the file. - **old_path** (string) - The old path of the file. - **a_mode** (string) - File mode for the old path. - **b_mode** (string) - File mode for the new path. - **diff** (string) - The diff content. - **new_file** (boolean) - True if this is a new file. - **renamed_file** (boolean) - True if the file was renamed. - **deleted_file** (boolean) - True if the file was deleted. #### Response Example ```json { "diffs": [ { "new_path": "src/new_file.js", "old_path": "src/new_file.js", "a_mode": "100644", "b_mode": "100644", "diff": "--- a/src/new_file.js\n+++ b/src/new_file.js\n@@ -0,0 +1,3 @@\n+console.log('Hello world!');\n", "new_file": true, "renamed_file": false, "deleted_file": false } ] } ``` ``` -------------------------------- ### get_users Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get GitLab user details by usernames. ```APIDOC ## get_users ### Description Get GitLab user details by usernames. ### Method GET (Assumed) ### Endpoint /users (Assumed) ### Parameters #### Query Parameters - **usernames[]** (array of strings) - Required - An array of usernames to retrieve ``` -------------------------------- ### get_tag Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a specific repository tag. ```APIDOC ## get_tag ### Description Get details of a specific repository tag. ### Method GET (Assumed) ### Endpoint /projects/:id/repository/tags/:tag_name (Assumed) ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the project - **tag_name** (string) - Required - The name of the tag ``` -------------------------------- ### create_repository Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Create a new GitLab project. ```APIDOC ## create_repository ### Description Create a new GitLab project. ### Method POST ### Endpoint /create_repository ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the new project. - **path** (string) - Optional - The path for the new project. Defaults to the name. - **description** (string) - Optional - A description for the new project. - **visibility** (string) - Optional - Visibility level ('private', 'internal', 'public'). Defaults to 'private'. - **namespace_id** (string) - Optional - The ID of the namespace (group) to create the project in. If not provided, it's created under the user's namespace. ### Request Example ```json { "name": "new-awesome-project", "description": "This is a project created via API.", "visibility": "private" } ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the newly created project. - **name** (string) - The name of the newly created project. - **web_url** (string) - The URL to the newly created project. #### Response Example ```json { "id": 456, "name": "new-awesome-project", "web_url": "https://gitlab.com/your-username/new-awesome-project" } ``` ``` -------------------------------- ### get_wiki_page Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a specific wiki page. ```APIDOC ## get_wiki_page ### Description Get details of a specific wiki page. ### Method GET ### Endpoint `/projects/:id/wikis/:slug` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **slug** (string) - Required - The slug of the wiki page. ``` -------------------------------- ### Enable Dynamic API URL and Configure Connection Pool Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/dynamic-api-url.md Set environment variables to enable dynamic API URL support and configure the connection pool for managing multiple GitLab instances. Ensure remote authorization is also enabled. ```bash ENABLE_DYNAMIC_API_URL=true REMOTE_AUTHORIZATION=true STREAMABLE_HTTP=true # Optional connection pool configuration GITLAB_POOL_MAX_SIZE=100 GITLAB_POOL_IDLE_TIMEOUT=300000 GITLAB_POOL_CLEANUP_INTERVAL=60000 # Optional proxy settings HTTP_PROXY=http://proxy.example.com:8080 HTTPS_PROXY=https://proxy.example.com:8443 NODE_TLS_REJECT_UNAUTHORIZED=0 GITLAB_CA_CERT_PATH=/path/to/ca.crt ``` -------------------------------- ### get_milestone_burndown_events Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get burndown events for a specific milestone. ```APIDOC ## get_milestone_burndown_events ### Description Get burndown events for a specific milestone. ### Method GET ### Endpoint `/projects/:id/milestones/:milestone_id/burndown_events` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **milestone_id** (integer) - Required - The ID of the milestone. ``` -------------------------------- ### List Webhooks for a Project Source: https://github.com/zereight/gitlab-mcp/blob/main/skills/gitlab-mcp/reference/webhooks.md Use this command to list all webhooks associated with a specific project. Provide the project ID in the format 'group/project'. ```shell list_webhooks project_id: "my-group/my-project" ``` -------------------------------- ### get_milestone_issue Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get issues associated with a specific milestone. ```APIDOC ## get_milestone_issue ### Description Get issues associated with a specific milestone. ### Method GET ### Endpoint `/projects/:id/milestones/:milestone_id/issues` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **milestone_id** (integer) - Required - The ID of the milestone. ``` -------------------------------- ### Set Up GitLab Integration Secrets Locally Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/setup-github-secrets.md Use these environment variables to configure GitLab integration for local testing. Ensure tokens are not committed to the repository. ```bash export GITLAB_TOKEN_TEST="your-token-here" export TEST_PROJECT_ID="70322092" export GITLAB_API_URL="https://gitlab.com" npm run test:integration ``` -------------------------------- ### get_merge_request_note Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get a specific note for a merge request. ```APIDOC ## get_merge_request_note ### Description Get a specific note for a merge request. ### Method GET ### Endpoint /get_merge_request_note ### Parameters #### Path Parameters None #### Query Parameters - **note_id** (string) - Required - The ID of the note to retrieve. - **project_id** (string) - Optional - The ID or URL-encoded path of the project. ### Request Example ```json { "note_id": "701", "project_id": "your/project-id" } ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the note. - **body** (string) - The content of the note. - **created_at** (string) - Timestamp when the note was created. #### Response Example ```json { "id": 701, "body": "This is the note content.", "created_at": "2023-10-27T11:40:00Z" } ``` ``` -------------------------------- ### Enable Stateless Mode Configuration Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/oauth-callback-proxy.md Environment variables to enable stateless mode for multi-pod deployments, requiring a shared secret. ```bash OAUTH_STATELESS_MODE=true OAUTH_STATELESS_SECRET= ``` -------------------------------- ### Manage MCP Servers Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/claude-code-setup.md These commands help list, retrieve, and remove MCP server configurations. ```bash claude mcp list ``` ```bash claude mcp get gitlab ``` ```bash claude mcp remove gitlab ``` -------------------------------- ### get_merge_request_version Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get a specific version of a merge request. ```APIDOC ## get_merge_request_version ### Description Get a specific version of a merge request. ### Method GET ### Endpoint /get_merge_request_version ### Parameters #### Path Parameters None #### Query Parameters - **mergeRequestIid** (string) - Required - The IID of the merge request. - **version_id** (string) - Required - The ID of the specific version to retrieve. - **project_id** (string) - Optional - The ID or URL-encoded path of the project. ### Request Example ```json { "mergeRequestIid": "15", "version_id": "v1", "project_id": "your/project-id" } ``` ### Response #### Success Response (200) - **version** (object) - The specific version object, containing details like `created_at`, `merge_commit_sha`, and `diffs`. #### Response Example ```json { "version": { "version": "v1", "created_at": "2023-10-27T10:00:00Z", "merge_commit_sha": "abcdef1234567890", "diffs": [] } } ``` ``` -------------------------------- ### get_group_wiki_page Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a specific group wiki page. ```APIDOC ## get_group_wiki_page ### Description Get details of a specific group wiki page. ### Method GET ### Endpoint `/groups/:id/wikis/:slug` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the group. - **slug** (string) - Required - The slug of the wiki page. ``` -------------------------------- ### Run Read-Only MCP Integration Tests Source: https://github.com/zereight/gitlab-mcp/blob/main/test/README.md Execute integration tests for all read-only MCP tools. Ensure necessary environment variables like GITLAB_PERSONAL_ACCESS_TOKEN are set. ```bash npm run test:mcp:readonly ``` -------------------------------- ### Enable Stateless Mode and Inject Secret Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/stateless-mode.md Set environment variables to enable stateless mode and provide the generated secret. ```bash export OAUTH_STATELESS_MODE=true export OAUTH_STATELESS_SECRET='' ``` -------------------------------- ### get_milestone_merge_requests Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get merge requests associated with a specific milestone. ```APIDOC ## get_milestone_merge_requests ### Description Get merge requests associated with a specific milestone. ### Method GET ### Endpoint `/projects/:id/milestones/:milestone_id/merge_requests` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **milestone_id** (integer) - Required - The ID of the milestone. ``` -------------------------------- ### get_environment Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a specific environment in a GitLab project. ```APIDOC ## get_environment ### Description Get details of a specific environment in a GitLab project. ### Method GET ### Endpoint `/projects/:id/environments/:environment_id` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **environment_id** (integer) - Required - The ID of the environment. ``` -------------------------------- ### get_deployment Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a specific deployment in a GitLab project. ```APIDOC ## get_deployment ### Description Get details of a specific deployment in a GitLab project. ### Method GET ### Endpoint `/projects/:id/deployments/:deployment_id` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **deployment_id** (integer) - Required - The ID of the deployment. ``` -------------------------------- ### Add GitLab MCP Server with JSON Config (PAT) Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/claude-code-setup.md Register a GitLab MCP server using a pre-existing JSON configuration with a Personal Access Token. ```bash claude mcp add-json gitlab '{"type":"stdio","command":"npx","args":["-y","@zereight/mcp-gitlab"],"env":{"GITLAB_PERSONAL_ACCESS_TOKEN":"glpat-your-token","GITLAB_API_URL":"https://gitlab.com/api/v4"}}' ``` -------------------------------- ### get_pipeline_job Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a GitLab pipeline job number. ```APIDOC ## get_pipeline_job ### Description Get details of a GitLab pipeline job number. ### Method GET ### Endpoint `/projects/:id/jobs/:job_id` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **job_id** (integer) - Required - The ID of the job. ``` -------------------------------- ### get_pipeline Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a specific pipeline in a GitLab project. ```APIDOC ## get_pipeline ### Description Get details of a specific pipeline in a GitLab project. ### Method GET ### Endpoint `/projects/:id/pipelines/:pipeline_id` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **pipeline_id** (integer) - Required - The ID of the pipeline. ``` -------------------------------- ### get_issue Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get details of a specific issue in a GitLab project. ```APIDOC ## get_issue ### Description Get details of a specific issue in a GitLab project. ### Method GET ### Endpoint /get_issue ### Parameters #### Path Parameters None #### Query Parameters - **issue_iid** (string) - Required - The IID of the issue. - **project_id** (string) - Optional - The ID or URL-encoded path of the project. ### Request Example ```json { "issue_iid": "5", "project_id": "your/project-id" } ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the issue. - **iid** (integer) - The internal ID of the issue. - **title** (string) - The title of the issue. - **description** (string) - The description of the issue. - **state** (string) - The current state of the issue. - **web_url** (string) - The URL to the issue. #### Response Example ```json { "id": 101, "iid": 5, "title": "Bug in login page", "description": "Users are unable to log in with valid credentials.", "state": "opened", "web_url": "https://gitlab.com/your-username/your-project/-/issues/5" } ``` ``` -------------------------------- ### get_draft_note Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get a single draft note from a merge request. ```APIDOC ## get_draft_note ### Description Get a single draft note from a merge request. ### Method GET ### Endpoint /get_draft_note ### Parameters #### Path Parameters None #### Query Parameters - **draft_note_id** (string) - Required - The ID of the draft note. - **mergeRequestIid** (string) - Required - The IID of the merge request. - **project_id** (string) - Optional - The ID or URL-encoded path of the project. ### Request Example ```json { "draft_note_id": "draft-123", "mergeRequestIid": "15", "project_id": "your/project-id" } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the draft note. - **body** (string) - The content of the draft note. - **created_at** (string) - Timestamp when the draft note was created. #### Response Example ```json { "id": "draft-123", "body": "Draft comment content.", "created_at": "2023-10-27T12:00:00Z" } ``` ``` -------------------------------- ### Verify Server Configuration Source: https://github.com/zereight/gitlab-mcp/blob/main/docs/claude-code-setup.md If the server is not found in Claude Code, use these commands to verify its configuration. ```bash claude mcp list ``` ```bash claude mcp get gitlab ``` -------------------------------- ### create_wiki_page Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Create a new wiki page in a GitLab project. ```APIDOC ## create_wiki_page ### Description Create a new wiki page in a GitLab project. ### Method POST ### Endpoint `/projects/:id/wikis` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. #### Request Body - **title** (string) - Required - The title of the wiki page. - **content** (string) - Required - The content of the wiki page. - **slug** (string) - Optional - The slug of the wiki page. If not provided, it will be generated from the title. ``` -------------------------------- ### get_merge_request_conflicts Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get the conflicts of a merge request in a GitLab project. ```APIDOC ## get_merge_request_conflicts ### Description Get the conflicts of a merge request in a GitLab project. ### Method GET ### Endpoint /get_merge_request_conflicts ### Parameters #### Path Parameters None #### Query Parameters - **mergeRequestIid** (string) - Required - The IID of the merge request. - **project_id** (string) - Optional - The ID or URL-encoded path of the project. ### Request Example ```json { "mergeRequestIid": "15", "project_id": "your/project-id" } ``` ### Response #### Success Response (200) - **conflicts** (array) - An array of conflict objects. - Each object contains: - **file_path** (string) - The path of the file with conflicts. - **conflict_type** (string) - The type of conflict (e.g., 'STRUCTION_TYPE_MERGE_CONFLICT'). #### Response Example ```json { "conflicts": [ { "file_path": "src/conflicted_file.js", "conflict_type": "STRUCTION_TYPE_MERGE_CONFLICT" } ] } ``` ``` -------------------------------- ### get_file_contents Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get the contents of a file or directory from a GitLab project. ```APIDOC ## get_file_contents ### Description Get the contents of a file or directory from a GitLab project. ### Method GET ### Endpoint /get_file_contents ### Parameters #### Path Parameters None #### Query Parameters - **file_path** (string) - Required - The path to the file or directory. - **project_id** (string) - Optional - The ID or URL-encoded path of the project. - **ref** (string) - Optional - The name of the branch or commit to get the file from. Defaults to the project's default branch. ### Request Example ```json { "file_path": "README.md", "project_id": "your/project-id" } ``` ### Response #### Success Response (200) - **file_name** (string) - The name of the file. - **file_path** (string) - The path of the file. - **size** (integer) - The size of the file in bytes. - **encoding** (string) - The encoding of the file content (e.g., 'base64'). - **content** (string) - The content of the file (decoded if encoding is 'base64'). - **ref** (string) - The branch or commit the file was retrieved from. - **blob_id** (string) - The blob ID of the file. - **commit_id** (string) - The commit ID associated with the file. - **last_commit_id** (string) - The last commit ID that modified the file. #### Response Example ```json { "file_name": "README.md", "file_path": "README.md", "size": 1024, "encoding": "text", "content": "# My Project\nThis is the README content.", "ref": "main", "blob_id": "abcdef123456", "commit_id": "abcdef123456", "last_commit_id": "abcdef123456" } ``` ``` -------------------------------- ### Get Timeline Events Source: https://github.com/zereight/gitlab-mcp/blob/main/skills/gitlab-mcp/reference/work-items.md Lists timeline events for an incident. ```APIDOC ## get_timeline_events ### Description Lists timeline events for an incident. ### Method Not specified (GraphQL-based) ### Endpoint Not specified (GraphQL-based) ### Parameters Not specified ``` -------------------------------- ### Run OAuth Tests Source: https://github.com/zereight/gitlab-mcp/blob/main/test/README.md Execute the OAuth2 authentication tests for the GitLab MCP server. ```bash npm run test:oauth ``` -------------------------------- ### get_merge_request_approval_state Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get merge request approval details including approvers. ```APIDOC ## get_merge_request_approval_state ### Description Get merge request approval details including approvers. Uses `approval_state` when available, otherwise falls back to `approvals`. ### Method GET ### Endpoint /get_merge_request_approval_state ### Parameters #### Path Parameters None #### Query Parameters - **mergeRequestIid** (string) - Required - The IID of the merge request. - **project_id** (string) - Optional - The ID or URL-encoded path of the project. ### Request Example ```json { "mergeRequestIid": "15", "project_id": "your/project-id" } ``` ### Response #### Success Response (200) - **approvals_required** (integer) - The number of approvals required. - **approvals_left** (integer) - The number of approvals remaining. - **approvers** (array) - An array of users who have approved the merge request. #### Response Example ```json { "approvals_required": 1, "approvals_left": 0, "approvers": [ { "username": "approver1" } ] } ``` ``` -------------------------------- ### get_branch_diffs Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Get the changes/diffs between two branches or commits in a GitLab project. ```APIDOC ## get_branch_diffs ### Description Get the changes/diffs between two branches or commits in a GitLab project. ### Method GET ### Endpoint /get_branch_diffs ### Parameters #### Path Parameters None #### Query Parameters - **from** (string) - Required - The name of the starting branch or commit SHA. - **to** (string) - Required - The name of the ending branch or commit SHA. - **project_id** (string) - Optional - The ID or URL-encoded path of the project. ### Request Example ```json { "from": "main", "to": "feature-branch", "project_id": "your/project-id" } ``` ### Response #### Success Response (200) - **diffs** (array) - An array of diff objects, similar to `get_merge_request_diffs`. #### Response Example ```json { "diffs": [ { "new_path": "src/updated_file.js", "old_path": "src/updated_file.js", "diff": "...", "new_file": false, "renamed_file": false, "deleted_file": false } ] } ``` ``` -------------------------------- ### play_pipeline_job Source: https://github.com/zereight/gitlab-mcp/blob/main/README.md Run a manual pipeline job. ```APIDOC ## play_pipeline_job ### Description Run a manual pipeline job. ### Method POST ### Endpoint `/projects/:id/jobs/:job_id/play` ### Parameters #### Path Parameters - **id** (integer or string) - Required - The ID or URL-encoded path of the project. - **job_id** (integer) - Required - The ID of the job to play. ```