Labsco
MohamedElashri logo

cerngitlab-mcp

โ˜… 4

from MohamedElashri

CERN GitLab MCP Server

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

CERN GitLab MCP Server

CERN GitLab MCP Server

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

Features

  • 14 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
  • Robust โ€” rate limiting, retries with exponential backoff, graceful error handling

Tools

ToolDescriptionAuth required
search_projectsSearch for public CERN GitLab projects (repositories) by keyword, topic, or languageNo
get_project_infoGet detailed project metadata (stars, description, languages, statistics)No
list_project_filesList files and directories in a project's repositoryNo
get_file_contentFetch the content of a specific file (includes binary detection)No
get_project_readmeGet the README content for a projectNo
search_codeSearch for code within a specific project or globallyYes*
search_lhcb_stackSearch for code within an LHCb software stack (e.g., 'sim11'), with automatic Git ref resolutionYes*
search_issuesSearch for issues in a projectYes
get_wiki_pagesList wiki pages for a projectYes
inspect_projectAnalyze project structure, build system, dependencies, and CI/CDNo
list_releasesList releases for a projectNo
get_releaseGet details of a specific releaseNo
list_tagsList tags for a projectNo
test_connectivityTest connection to the GitLab instanceNo

For detailed parameter documentation, see docs/dev.md.

Example Prompts

Search for repositories

"Search CERN GitLab for Python repositories related to ROOT analysis and show me the most starred ones"

Understand a project

"Get the README and file structure of the lhcb/DaVinci project on CERN GitLab"

Find fitting examples

"Search for repositories on CERN GitLab that use RooFit and show me example fitting code"

View LHCb software stack code

"Search the LHCb sim11 stack for the initialization routines in the Boole project"

Analyze a project structure

"Inspect the lhcb/allen project to understand its build system, dependencies, and CI pipeline configuration"

Find usage context

"Search for issues related to 'segmentation fault' in the atlas/athena project to see if others have encountered this"

Track releases

"List the recent releases of lhcb/DaVinci and show me the release notes for the latest version"

Find framework configurations

"Search for Gaudi framework configuration files on CERN GitLab and show me examples"

Development

See docs/dev.md for development setup, project structure, testing, and release instructions.

CLI Tool

A command-line interface is also available for direct usage without the MCP server:

# Install or use with uvx
uvx cerngitlab-cli

# Test connectivity
cerngitlab-cli test-connection

# Search for projects
cerngitlab-cli search-projects --query "ROOT analysis" --language python

# Get project info
cerngitlab-cli get-project-info --project lhcb/DaVinci

# Search code
cerngitlab-cli search-code --search-term "RooFit" --per-page 10

# Inspect project structure
cerngitlab-cli inspect-project --project lhcb/allen

All commands output JSON to stdout for easy piping and composition. See cerngitlab-cli --help for the full list of commands.

Skill File

A detailed skill file (SKILL.md) is available with:

  • Complete documentation of all 14 tools
  • Input/output specifications
  • Usage examples
  • Authentication requirements

This can be used by LLMs or agents to understand the available tools and how to use them.