Skip to main content

runspec-gitlab

A GitLab runnable for runspec, ported onto the GitLab REST API (v4) — not proxying GitLab's hosted MCP server. One runnable — gitlab — with 17 read verbs (autonomy = "autonomous"), 15 write verbs (autonomy = "confirm", so an agent asks before each one) and 4 delete verbs (autonomy = "manual", so only a person can run them). pip install it into a venv and it's discoverable by runspec local, runspec serve (MCP), and runspec-console.

runspec serve flattens each verb into a leaf MCP tool (gitlab_get-issue, …). Verb names are reconciled against GitLab's canonical MCP tool registry; the extras (whoami, get-project, search-projects, list-issues, get-file, list-tree) are useful REST reads GitLab has no MCP tool for.

Install

pip install runspec-gitlab

Verbs

Area Verbs
Account / project whoami, get-project, search-projects, get-file, list-tree
Issues list-issues, get-issue
Merge requests list-merge-requests, get-merge-request, get-merge-request-diffs, get-merge-request-commits, get-merge-request-notes, get-merge-request-pipelines, get-merge-request-conflicts
Pipelines list-pipelines, get-pipeline-jobs, get-job-log

Writes (all confirm):

Area Verbs
Issues create-issue, update-issue (edit, labels, assignees, close/reopen), add-issue-note
Merge requests create-merge-request, update-merge-request (edit, labels, assignees, reviewers, close/reopen), add-merge-request-note, merge-merge-request
Repository create-branch, write-file (create or replace a text file in one commit)
Pipelines / jobs create-pipeline, retry-pipeline, cancel-pipeline, retry-job, cancel-job, play-job

Assignees and reviewers are given as usernames. Labels, assignees, reviewers and pipeline variables (KEY=VALUE) are repeatable args. Writes need a token with the api scope; reads work with read_api.

Deletes (all manual — refused to an agent, run from the command line or the console's Forms tab): delete-issue, delete-branch, delete-file, delete-pipeline. GitLab itself limits issue and pipeline deletes to project owners/admins and refuses protected or default branches.

get-merge-request-conflicts is best-effort — GitLab has no public /api/v4 conflicts endpoint, so it relays the web-UI endpoint and returns its JSON verbatim.

Auth — env vars only

export GITLAB_URL=https://gitlab.example.com        # default https://gitlab.com
export GITLAB_TOKEN=<personal-or-project-access-token>
export GITLAB_PROJECT=group/subgroup/project        # optional default

Every verb takes --env, selecting GITLAB_<ENV>_* prefixed vars. --project accepts a numeric id or a group/project path and falls back to GITLAB_PROJECT.

gitlab whoami
gitlab list-merge-requests --project group/app --state opened
gitlab get-job-log --project group/app --job-id 998877
gitlab create-issue --project group/app --title "Login fails" --label bug --assignee alice
gitlab write-file --project group/app --branch fix --start-branch main \
  --file-path docs/notes.md --content-file notes.md --commit-message "Add notes"

Public Python API

The pure logic is in runspec-gitlab-core — httpx-only, no runspec dependency, no entry points. Every op takes a GitlabConfig first arg and raises GitlabError, so a private wrapper can inject credentials and bake in a default project / env:

from runspec_gitlab_core import config_from_env, get_issue, list_merge_requests

cfg = config_from_env(env="prod")
mrs = list_merge_requests(cfg, state="opened")

Development

python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
ruff check . && ruff format --check .
pytest

Metadata

Release files for runspec-gitlab 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for runspec-gitlab 0.3.0
File Size Uploaded
runspec_gitlab-0.3.0.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for runspec-gitlab 0.3.0
File Interpreter ABI Platform
runspec_gitlab-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.9 kB

Release files / runspec_gitlab-0.3.0.tar.gz

Download URL runspec_gitlab-0.3.0.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d516c28e75a4c2a39aa94eef810306eb92c36e554b4d94a7305f7acc1db470c0
BLAKE2b-256 checksum
How to use checksums
cea772476caeb252f30b2059bcc8901b662740af6527043f3558ae12cb64b4b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / runspec_gitlab-0.3.0-py3-none-any.whl

Download URL runspec_gitlab-0.3.0-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5238cfe667418dcfe40192e8ea947d29427134561a69a869b4b9ec86fca630d
BLAKE2b-256 checksum
How to use checksums
951907e3ec29fed38eec6f31688a9aa8ac05533c62be638c2e3df970923a81d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page