gitlab-mcp CLAUDE.md

gitlab-mcp CLAUDE.md is an instructions file for coding agents from ttpears/gitlab-mcp. It costs 1,694 tokens per session, scanned A, original, MIT.

Project instructions for a GitLab MCP server, which connects AI clients to GitLab, a platform for hosting code and managing software projects.

In plain words
What is it for?
Use them to build, run, test, debug, and smoke-test the TypeScript server locally or over HTTP.
Why use it?
They give developers the commands, architecture, configuration rules, testing steps, and release process needed to work on the server consistently.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ttpears/gitlab-mcp/claude-md
Clone the repo
git clone --depth 1 https://github.com/ttpears/gitlab-mcp

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gitlab-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ttpears/gitlab-mcp/claude-md.svg)](https://agentmods.dev/instructions/ttpears/gitlab-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ttpears/gitlab-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/ttpears/gitlab-mcp/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,694 This file is loaded in full into every session.
When invoked 1,694 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01694 $0.01694
Opus 5 $0.00847 $0.00847
Sonnet 5 $0.00339 $0.00339
Haiku 4.5 $0.00169 $0.00169

Measured 4d ago against content hash 466ccfbf712a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gitlab-mcp CLAUDE.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Local smoke test over HTTP: `MCP_TRANSPORT=http GITLAB_MCP_PORT=8008 GITLAB_TOKEN=glpat-... npm run dev`, then point an MCP client at `http://localhost:8008/` (health check: `curl http://localhost:8008/health`).
CLAUDE.md · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Commands

  • npm run build — TypeScript compile to dist/ (tsc, ESM).
  • npm run dev — Run the server directly from src/ via tsx (stdio transport by default).
  • npm start — Run the compiled server from dist/index.js.
  • npm test — Jest. Run a single test with npx jest <path> or npx jest -t "<name>".
  • Local smoke test over HTTP: MCP_TRANSPORT=http GITLAB_MCP_PORT=8008 GITLAB_TOKEN=glpat-... npm run dev, then point an MCP client at http://localhost:8008/ (health check: curl http://localhost:8008/health).
  • Interactive tool testing: npx @modelcontextprotocol/inspector npx @ttpears/gitlab-mcp-server.
  • Debug logging: set NODE_ENV=development — startup prints the resolved config to stderr; production suppresses it.

Architecture

Four source files, ~4.7k lines total — keep the layering in mind before adding code:

  • src/config.tsloadConfig() reads env (GITLAB_URL, GITLAB_TOKEN, GITLAB_READ_TOKEN, GITLAB_MAX_PAGE_SIZE, GITLAB_TIMEOUT) into a zod-validated Config. validateUserConfig() parses per-request userCredentials. GITLAB_TOKEN and GITLAB_READ_TOKEN are mutually exclusive; setting both is a startup error. Old GITLAB_AUTH_MODE and GITLAB_SHARED_ACCESS_TOKEN env vars trigger a deprecation warning and are ignored.
  • src/gitlab-client.tsGitLabGraphQLClient wraps graphql-request and is the only place that talks to GitLab. Every method accepts optional userCredentials; getClient() picks a token per the four-step rule (see Project Conventions below). Also hosts fetchAllPages() — the cursor-loop helper every fetchAll tool uses — and schema-introspection helpers.
  • src/tools.ts — Declarative tool registry: each entry is { name, description, inputSchema: zod, handler(args, client) }. Handlers are thin — they validate input, call the client, and shape the response. This is where pagination defaults and sort enums live for each tool.
  • src/index.tsGitLabMCPServer owns both transports. Stdio mode uses a single Server instance. HTTP mode (MCP_TRANSPORT=http) runs Express and maintains a httpSessions map keyed by session id, each with its own Server + StreamableHTTPServerTransport + per-session userConfig. The HTTP entry point accepts both / and /mcp (the latter exists for container setups). LibreChat sends credentials via Authorization: Bearer <PAT> and optional X-GitLab-Url headers — these are lifted into the session's userConfig. Idle sessions are reaped by sessionCleanupInterval.

Read the full file on GitHub · 53 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 53 lines · 1,694 tokens per session scan A 466ccfbf712a

Subscribe to this mod's changes

gitlab-mcp CLAUDE.md is an instructions file published in the GitHub repository ttpears/gitlab-mcp (10 stars, last pushed 1mo ago), licensed MIT. It adds 1,694 tokens to every session, about $0.0085 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories