GitLab

Lightweight, dependency-free, in-memory GitLab API v4 fake for testing code that uses @gitbeaker/rest, the glab CLI, or the raw GitLab REST API.

Default port: 4768

Quick start

import { GitlabServer } from "./services/gitlab/src/server.js";

const server = new GitlabServer(4768);
await server.start();
// ... run your app/tests ...
await server.stop();

Point gitbeaker at it:

import { Gitlab } from "@gitbeaker/rest";

const api = new Gitlab({
  host: "http://127.0.0.1:4768",
  token: "glpat-parlel",
});

const user = await api.Users.showCurrentUser();
// user.username => "parlel-user"

Access via MCP / preview URL

Any MCP server or agent reading these standard env vars uses the fake transparently.

Implemented operations

All /api/v4/* routes require a PRIVATE-TOKEN: <token> header or Authorization: Bearer <token> (any non-empty token accepted). Attributes may be supplied via the JSON/form body or the query string (POST /api/v4/projects?name=demo), exactly like the real API. State is in-memory and ephemeral.

Service & inspection (parlel extensions)

Surface coverage

This emulator faithfully replicates the API surface most application code and agents exercise. Anything below the supported lines is either an intentional design choice for a fast, zero-cost local emulator (✓ By design) or a candidate for a future release (⟳ Roadmap) — never a silent inaccuracy.

Legend: ✅ fully supported · ◐ accepted (stored, not strictly enforced) · ✓ by design · ⟳ on the roadmap.

FeatureStatus
GET /user✅ Supported
Projects CRUD✅ Supported
Issues create / list / get / update✅ Supported
Merge requests create / list / get / update✅ Supported
PRIVATE-TOKEN / Bearer auth✅ Required (any non-empty token)
401 / 400 / 404 / 405 error envelopes✅ Match real GitLab shapes
Offset pagination (page/per_page + X-Total/X-Page/Link headers)✅ Supported
Query-string attributes on create/update◐ Accepted — merged with JSON/form body
Rich issue/MR fields (author, references, time_stats, merge_status)✅ Supported
Keyset pagination (pagination=keyset, cursors)⟳ Roadmap
Groups / pipelines / jobs / runners⟳ Roadmap
Real merge / approvals⟳ Roadmap — MR merge_status static
Scope enforcement✓ By design — Any non-empty credential is accepted — no real secrets needed

Error codes & shapes

GitLab's error envelope is { "message": "..." }. For a missing required attribute the message is the literal GitLab string 400 (Bad request) "<field>" not given.

StatusWhenBody
401missing/invalid token{ "message": "401 Unauthorized" }
400missing required field{ "message": "400 (Bad request) \"title\" not given" }
400invalid JSON body{ "message": "400 Bad Request", "error": "invalid JSON" }
404unknown resource{ "message": "404 Project Not Found" } / { "message": "404 Not Found" }
405method not allowed{ "message": "405 Method Not Allowed" }

Manifest

See services/gitlab/manifest.json:

<!-- parlel:testenv:start -->

Configuration — test.env

Copy these into your test.env (used by the bridge sidecar flow). Tokens are Parlel's seeded test credentials — any non-empty value is accepted by the emulator, so you rarely need to change them. Swap in real credentials only when pointing at the live service in prod.env.

GITLAB_TOKEN=glpat-parlel
GITLAB_API_URL=http://parlel-bridge:4768
CI_API_V4_URL=http://parlel-bridge:4768/api/v4
<!-- parlel:testenv:end -->