Cerngitlab MCP Server

An MCP server that connects LLMs to CERN GitLab for discovering HEP code, documentation, and analysis examples.

Local serverstdioPython

What is the Cerngitlab MCP MCP server?

An MCP server that connects LLMs to CERN GitLab for discovering HEP code, documentation, and analysis examples. Exposed over MCP by the cerngitlab mcp mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

What it actually does

  • 15 MCP tools — for searching, browsing, and analyzing CERN GitLab repositories
  • Dual-mode operation — — stdio (single-user) and HTTP (multi-user) modes
  • CLI tool — (cerngitlab-cli) for direct command-line usage
  • Public access — — works without authentication for public repositories
  • Multi-user HTTP mode — — CERN SSO + GitLab OAuth authentication for centralized deployments; GitLab enforces all access permissions natively
  • HEP-focused — — dependency parsing for Python and C++ ecosystems, binary detection for .root files, issue search

Its toolset

Everything the assistant can do here goes through one of these:

  • search_projects — Search for public CERN GitLab projects (repositories) by keyword, topic, or language
  • get_project_info — Get detailed project metadata (stars, description, languages, statistics)
  • list_branches — List or search project branches and their commit metadata
  • list_project_files — List files and directories in a project's repository
  • get_file_content — Fetch the content of a specific file (includes binary detection)
  • get_project_readme — Get the README content for a project
  • search_code — Search for code within a specific project or globally
  • search_lhcb_stack — Search for code within an LHCb software stack (e.g., 'sim11'), with automatic Git ref resolution
  • search_issues — Search for issues in a project
  • get_wiki_pages — List wiki pages for a project
  • inspect_project — Analyze project structure, build system, dependencies, and CI/CD
  • list_releases — List releases for a project

Adding it to your client

Installation goes through your MCP client rather than a global install: point it at cerngitlab-mcp on PyPI and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

Configuration

You will need 8 environment variables: CERNGITLAB_TOKEN, CERNGITLAB_CERN_CLIENT_ID, CERNGITLAB_GITLAB_OAUTH_CLIENT_ID, CERNGITLAB_GITLAB_OAUTH_CLIENT_SECRET, CERNGITLAB_SERVER_BASE_URL, CERNGITLAB_SESSION_STORAGE_PATH, CERNGITLAB_GITLAB_URL, CERNGITLAB_HOST. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  1. CERN SSO client — Register a client at the CERN Authorization Service. Note the client ID. 2. GitLab OAuth application — Create one at https://gitlab.cern.ch/-/profile/applications. - Set the redirect URI to https://gitlabmcp.cern.ch/oauth/callback (replace with actual URL) - Enable the read_api read_repository read_user scopes - Note the application ID

When to reach for it

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Cerngitlab MCP's toolset — search_projects, get_project_info, list_branches and 11 more — is a fair guide to whether it matches your workflow. It is maintained by mohamedelashri; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Cerngitlab MCP's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Cerngitlab MCP.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the cerngitlab mcp mcp server does with a few real requests.

Available tools

ToolWhat it does
search_projectsSearch for public CERN GitLab projects (repositories) by keyword, topic, or language
get_project_infoGet detailed project metadata (stars, description, languages, statistics)
list_branchesList or search project branches and their commit metadata
list_project_filesList files and directories in a project's repository
get_file_contentFetch the content of a specific file (includes binary detection)
get_project_readmeGet the README content for a project
search_codeSearch for code within a specific project or globally
search_lhcb_stackSearch for code within an LHCb software stack (e.g., 'sim11'), with automatic Git ref resolution
search_issuesSearch for issues in a project
get_wiki_pagesList wiki pages for a project
inspect_projectAnalyze project structure, build system, dependencies, and CI/CD
list_releasesList releases for a project
get_releaseGet details of a specific release
list_tagsList tags for a project

How to install the Cerngitlab MCP MCP server

{
  "mcpServers": {
    "cerngitlab": {
      "command": "uvx",
      "args": ["cerngitlab-mcp"],
      "env": {
        "CERNGITLAB_TOKEN": "glpat-xxxxxxxxxxxx"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  1. CERN SSO client — Register a client at the CERN Authorization Service. Note the client ID. 2. GitLab OAuth application — Create one at https://gitlab.cern.ch/-/profile/applications. - Set the redirect URI to https://gitlabmcp.cern.ch/oauth/callback (replace with actual URL) - Enable the read_api read_repository read_user scopes - Note the application ID
VariableDescriptionRequired
CERNGITLAB_TOKENCredential the server authenticates with.Yes
CERNGITLAB_CERN_CLIENT_IDConfiguration value read at startup.Optional
CERNGITLAB_GITLAB_OAUTH_CLIENT_IDConfiguration value read at startup.Optional
CERNGITLAB_GITLAB_OAUTH_CLIENT_SECRETCredential the server authenticates with.Yes
CERNGITLAB_SERVER_BASE_URLEndpoint or connection string the server talks to.Yes
CERNGITLAB_SESSION_STORAGE_PATHFilesystem location the server is allowed to use.Optional
CERNGITLAB_GITLAB_URLEndpoint or connection string the server talks to.Yes
CERNGITLAB_HOSTEndpoint or connection string the server talks to.Optional

Example prompts to try

  • Use Cerngitlab MCP to search projects.
  • Use Cerngitlab MCP to get project info.
  • Use Cerngitlab MCP to list branches.

Frequently asked questions

It connects Cerngitlab MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (search_projects, get_project_info, list_branches, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Cerngitlab MCP directly.