
Connect to GitLab Duo
GitLab Duo Agent Platform — MCP in agentic chat and in the IDE extensions.
Which MCP will you connect? The commands below change according to your choice.
- 1
Make sure MCP is enabled
MCP support in Duo is recent and off by default. In the group or project: Settings → General → GitLab Duo, and enable the use of MCP servers. On self-managed instances, the administrator has to allow it first.
- 2
Generate your API key
Sign in to app.newalgorithm.io with your account, open Keys & apps and generate a key. It is shown only once: copy it and store it somewhere safe.
Key formatna_live_xxxxxxxxxxxxxxxxx - 3
Declare the NewAlgorithm server
Duo reads the MCP configuration from the repository. Create the file below at the project root:
.gitlab/duo/mcp.json{ "mcpServers": { "NewAlgorithm-TOTVS": { "url": "https://totvs.mcp.newalgorithm.io/mcp", "headers": { "Authorization": "Bearer $NA_API_KEY" } } } }Expected: Reference the key through a variable ($NA_API_KEY), never in plain text — this file is versioned along with the code.
- 4
Register the key as a CI/CD variable
In Settings → CI/CD → Variables, create NA_API_KEY marked as Masked and Protected. That's what fills in the header without exposing the secret in the repository.
- 5
In the IDE, use the GitLab Workflow extension
If you work in VS Code or with the JetBrains plugin, configure the same server in the extension preferences (GitLab Duo → MCP servers). That way the key stays on your machine, outside the repository.
- 6
Confirm in Duo Agentic Chat
Open the agentic chat and ask for the list of available tools. The five na_* tools should appear.
Expected: na_prepare, na_search, na_route, na_specialists, na_version
The exact menu path changes between GitLab versions and between SaaS and self-managed, and the feature depends on your subscription tier. If your version doesn't expose MCP in Duo yet, the endpoint is still reachable through the Other client guide.
Authentication and tool details in the Docs.