CERN GitLab MCP Server

CERN GitLab MCP Server

An MCP server that connects LLMs to CERN GitLab to discover and analyze High Energy Physics code, documentation, and analysis examples. It provides 14 tools for repository browsing, dependency parsing, and CI/CD configuration analysis.

Category
访问服务器

README

<p align="center"> <img src="https://raw.githubusercontent.com/MohamedElashri/cerngitlab-mcp/main/icons/icon.svg" alt="CERN GitLab MCP Server" width="160" /> </p>

<h1 align="center">CERN GitLab MCP Server</h1>

<p align="center"> An <a href="https://modelcontextprotocol.io/">MCP</a> server that connects LLMs to <a href="https://gitlab.cern.ch">CERN GitLab</a> for discovering HEP code, documentation, and analysis examples. </p>

Features

  • 14 MCP tools for searching, browsing, and analyzing CERN GitLab repositories
  • Public access — works without authentication for public repositories
  • HEP-focused — dependency parsing for Python and C++ ecosystems, binary detection for .root files
  • Robust — rate limiting, retries with exponential backoff, graceful error handling

Installation

Requires Python 3.10+.

Quickstart (recommended)

No installation needed — just use uvx to run directly:

uvx cerngitlab-mcp

From PyPI

pip install cerngitlab-mcp

From source

git clone https://github.com/MohamedElashri/cerngitlab-mcp
cd cerngitlab-mcp
uv sync

Configuration

All settings are configured via environment variables prefixed with CERNGITLAB_:

Variable Default Description
CERNGITLAB_GITLAB_URL https://gitlab.cern.ch GitLab instance URL
CERNGITLAB_TOKEN (empty) Personal access token (optional)
CERNGITLAB_TIMEOUT 30 HTTP timeout in seconds
CERNGITLAB_MAX_RETRIES 3 Max retries for failed requests
CERNGITLAB_RATE_LIMIT_PER_MINUTE 300 API rate limit
CERNGITLAB_LOG_LEVEL INFO Logging level

Authentication

The server works in two modes:

  • Without token — Access to all public repositories. Sufficient for most HEP code discovery.
  • With token — Additional access to internal/private projects, code search, and wiki pages.

To create a token:

  1. Go to https://gitlab.cern.ch/-/user_settings/personal_access_tokens
  2. Create a token with read_api scope
  3. Set CERNGITLAB_TOKEN=glpat-xxxxxxxxxxxx

Note: The code search (search_code) and wiki (get_wiki_pages) tools require authentication on CERN GitLab.

Usage

Claude Desktop

Add to your claude_desktop_config.json:

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

Claude Code

claude mcp add cerngitlab-mcp -- uvx cerngitlab-mcp

To include authentication:

claude mcp add cerngitlab-mcp -e CERNGITLAB_TOKEN=glpat-xxxxxxxxxxxx -- uvx cerngitlab-mcp

GitHub Copilot

Add to your VS Code settings.json:

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

Or add a .vscode/mcp.json to your project:

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

Gemini CLI

Add to your ~/.gemini/settings.json:

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

Direct usage

# Run with uvx (no install needed)
uvx cerngitlab-mcp

# Or if installed from PyPI
cerngitlab-mcp

# Or from source
uv run cerngitlab-mcp

# With authentication
CERNGITLAB_TOKEN=glpat-xxx uvx cerngitlab-mcp

Tools

Tool Description Auth required
search_repositories Search public repositories by keywords, topics, or language No
get_repository_info Get repository details (languages, stats, license) No
list_repository_files Browse the file tree of a repository No
get_file_content Retrieve file content with binary detection No
get_repository_readme Get the README file (tries common filenames) No
search_code Search for code across repositories Yes*
get_wiki_pages Access repository wiki pages Yes
analyze_dependencies Parse dependency files (Python, C++, Fortran) No
get_ci_config Retrieve and analyze .gitlab-ci.yml No
get_build_config Find build config files (CMake, Make, setuptools, etc.) No
list_releases List releases from a repository No
get_release Get details of a specific release No
list_tags List repository tags with optional filtering No
test_connectivity Test connection to the GitLab instance No

* search_code works without auth for project-scoped search (uses fallback grep). Global search requires authentication.

For detailed parameter documentation, see 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"

Check dependencies

"What are the dependencies of the lhcb/allen project? Show me the CMakeLists.txt and any Python requirements"

Track releases

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

Explore CI/CD

"Get the CI/CD configuration of the lhcb/allen project and explain the pipeline stages"

Find framework configurations

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

Development

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

License

AGPL-3.0

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选