diff --git a/doc/user/gitlab_duo/model_context_protocol/mcp_server.md b/doc/user/gitlab_duo/model_context_protocol/mcp_server.md index 6069db205897c05cb874bb3cce1fcd36ad2b0d82..65cce8807a610ff2fddbdb8b6eac997bf59f389f 100644 --- a/doc/user/gitlab_duo/model_context_protocol/mcp_server.md +++ b/doc/user/gitlab_duo/model_context_protocol/mcp_server.md @@ -59,15 +59,20 @@ To do this: 1. Open Cursor. 1. In Cursor, go to **Settings** > **Cursor Settings** > **Tools & Integrations**. 1. Under **MCP Tools**, select `New MCP Server`. -1. Add this definition to the `mcpServers` key, editing the value of `mcp-remote` as needed: +1. Add this definition to the `mcpServers` key, editing the value of: + - `mcp-remote` as needed. + - `"command"` to work with your operating system and package manager. + For example, if you use macOS with Homebrew, you might have to change + it to `"command": "/opt/homebrew/bin/npx"`. ```json { "mcpServers": { "GitLab": { # If npx is installed locally, not globally, provide the full path - "command": "npx", + "command": "", "args": [ + "-y", "mcp-remote", "https://your-gitlab-instance.com/api/v4/mcp" ] @@ -212,3 +217,25 @@ Show me all pipelines for merge request 42 in project gitlab-org/gitlab ## Feedback This feature is experimental. Your feedback is valuable in helping us to improve it. Share your experiences, suggestions, or issues in [issue 561564](https://gitlab.com/gitlab-org/gitlab/-/issues/561564). + +## Troubleshooting + +### OAuth callback error + +When the MCP client creates the authentication callback with the OAuth URL, you might +get an error that states the following: + +```plaintext +An error has occurred + +The requested scope is invalid, unknown, or malformed. +``` + +This error means that you cannot authenticate against the GitLab MCP server, and +blocks you from any further use of the server. + +The workaround for this error is to, when you [configure the `mcpServers` key](#connect-cursor-to-a-gitlab-mcp-server), pin the `mcp-remote` version to `0.1.26`. +For example,`"mcp-remote@0.1.26"`. + +[Issue 566965](https://gitlab.com/gitlab-org/gitlab/-/issues/566965) exists to +investigate this error.