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 18 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, list-projects, 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, list-projects, 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

export GITLAB_URL=https://gitlab.example.com        # default https://gitlab.com
export GITLAB_TOKEN=<personal-or-project-access-token>   # or GITLAB_PAT
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.

In runspec-console, a token credential labelled GitLab sets GITLAB_TOKEN and GITLAB_PAT. The runnable declares both (on --gitlab-token), so the credential applies to the agent without a scope, not only when picked in Forms. --gitlab-token (password type) takes the token through the console's secret channel and is refused on the command line; --gitlab-url overrides GITLAB_URL.

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.6.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.6.0
File Size Uploaded Provenance Actions
runspec_gitlab-0.6.0.tar.gz 16.7 kB With provenance Details for runspec_gitlab-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 28.4 kB

Release files / runspec_gitlab-0.6.0.tar.gz

Download URL runspec_gitlab-0.6.0.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c982e0e9ed7e2657daf3fdf4e93e191236425e851456c6d054b3f9145af55350
BLAKE2b-256 checksum
How to use checksums
cafb3f3eb8c7e824b5445b976da5b1e52dc1af9e85f78e796732de5f7b5d31bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 25, 2026.

Transparency log

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

Download URL runspec_gitlab-0.6.0-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e67268fbb995ac0222a08f8036e97a10870ad56c0ba412aab1b2b234af5d14cd
BLAKE2b-256 checksum
How to use checksums
275f276ed18a0371e09c0861a0d94410e87641819784ef3a67a8cd082dc7ec75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 25, 2026.

Transparency log

Security for runspec-gitlab 0.6.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for runspec_gitlab-0.6.0.tar.gz

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 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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