Skip to content

gitlab-api

GitLab API + MCP Server + A2A Agent for the agent-utilities ecosystem — a typed, action-routed connector for the GitLab REST and GraphQL APIs.

Official documentation

This site is the canonical reference for gitlab-api, maintained alongside every release.

PyPI MCP Server License GitHub

Overview

gitlab-api wraps the GitLab REST and GraphQL surface with typed, deterministic MCP tools and an optional Pydantic-AI agent server. It provides:

  • Api — a Python client (gitlab_api.api_client.Api) composed from per-domain mixins covering projects, repositories, merge requests, pipelines, environments, issues, users, and groups.
  • Action-routed MCP tools — consolidated, togglable tool modules (branches, commits, merge requests, pipelines, releases, runners, and more) that minimize token overhead in LLM contexts.
  • An A2A agent server — a Pydantic-AI graph agent (console script gitlab-agent) that calls the MCP tool surface and exposes an AG-UI web interface.

The connector remains inactive when credentials are absent: configure GITLAB_URL and GITLAB_TOKEN to connect it to a GitLab instance.

Explore the documentation

  • Installation — pip, source, extras, and the prebuilt Docker image.
  • Deployment — run the MCP and agent servers, Docker Compose, Caddy + Technitium.
  • Usage — the MCP tools, the Api client, and the CLI.
  • Backing Platform — deploy GitLab with Docker.
  • Overview — the action-routed tool surface and architecture.
  • Concepts — the CONCEPT:GL-* registry.

Quick start

pip install "gitlab-api[mcp]"
gitlab-mcp                        # stdio MCP server (default transport)

Connect it to a GitLab instance:

export GITLAB_URL=https://gitlab.example.com
export GITLAB_TOKEN=<your-gitlab-token>
gitlab-mcp --transport streamable-http --host 0.0.0.0 --port 8000

See Installation and Deployment for the full matrix (PyPI extras, Docker image, all transports, the agent server, reverse proxy, DNS).