GitFlic MCP Server
gitflic-cli
Полный консольный клиент для REST API GitFlic. 100% покрытие · ноль внешних зависимостей · MCP-сервер для AI-агентов.
📖 Документация · 🚀 Быстрый старт · 🧩 Команды · 📦 Скачать · 🤖 MCP для AI
gitflic-cli — лёгкий CLI для повседневной работы с GitFlic из терминала, скриптов и AI-агентов: merge-реквесты, обсуждения, задачи, релизы, ветки, теги, коммиты, файлы, вебхуки, окружения, реестр пакетов, CI/CD и администрирование. Все 20 разделов публичного REST API GitFlic обёрнуты в единый бинарник gitflic.
Чем это не является: официальный
cli.jarот GitFlic — это серверный инструмент админа (починка LFS/релизов для self-hosted).gitflic-cli— недостающий пользовательский CLI для ежедневной работы.
✨ Почему
Ноль зависимостей. Чистый Node ESM (≥18) на глобальном
fetch. Никакогоnpm install.100% REST API. Все 20 разделов (~199 эндпоинтов со scope-вариантами). Большинство протестировано вживую. → таблица покрытия
Дружелюбен к агентам. Каждая команда принимает
--format jsonи пишет стабильный JSON в stdout. Код возврата:0при успехе,1при HTTP-ошибке. Плюс NDJSON-стриминг (--stream) и авто-пагинация (--all).MCP-сервер для AI (Claude Code, Cursor и т.п.) — типизированные тулы поверх всего CLI.
Безопасное хранение токенов — macOS Keychain / Linux libsecret /
chmod 0600fallback (как уgh/glab). Multi-account + per-project bindings.Самодокументирующийся.
gitflic helpиgitflic <cmd> helpпоказывают все подкоманды и флаги.
Related MCP server: adtk
📦 Установка
Требуется Node 18+.
# npm (рекомендуется) — ноль транзитивных зависимостей
npm install -g gitflic-cli
# или разово, без установки
npx gitflic-cli help# SSH-клон + установщик (кладёт CLI в ~/.local/share, symlink в ~/.local/bin)
git clone git@gitflic.ru:tikhon/gitflic-cli.git ~/tools/gitflic-cli
cd ~/tools/gitflic-cli && bash install.sh
# Windows / PowerShell
powershell -ExecutionPolicy Bypass -File install.ps1
# Кастомный путь / без symlink / dry-run
bash install.sh --prefix ~/my-tools
bash install.sh --no-symlink
bash install.sh --dry-runГотовые tar.gz — на странице загрузок.
→ Подробно: Установка
🔐 Аутентификация
gitflic auth login --token xxxx-xxxx-xxxx # валидирует через /user/me, кладёт в Keychain
gitflic auth status # backend + identityПоддерживаются несколько аккаунтов (auth login --as work, auth switch) и привязка проектов к аккаунтам (auth bind owner/alias work). Альтернатива — GITFLIC_TOKEN в окружении.
→ Подробно: Аутентификация · Multi-account · Безопасность
🚀 Использование
gitflic mr list --project tikhon/gitflic-cli # список merge-реквестов
gitflic mr create --title "Fix login" --to main # авто: текущая ветка → default
gitflic mr diff 42 # дифф (с декодом HTML-entities)
gitflic mr merge 42 --message "Squash: fix login"
gitflic issue create --title "Bug" --description "..."
gitflic release create --title v1.0.0 --tag v1.0.0
gitflic release upload <uuid> ./build.zip # ассеты релиза
gitflic branch protection create --scope team --team acme \
--branch-template "main" --allowed-to-push NO_ONE --allowed-to-merge DEVELOPER
gitflic registry package upload --fmt maven --project me/app \
./app.jar com.example app 1.0.0 app.jar # реестр пакетов
gitflic user me --format json | jq .username # машинный выводgitflic help — полный список, gitflic <cmd> help — справка по модулю.
🧩 Команды
Модуль | Что умеет |
| login / logout / status / switch / list / bind / unbind — multi-account, per-project |
| list / view / diff / create / edit / approve / merge / close / cancel / by-commit / comment / discuss + approval rules & MR-settings (team/company) |
| list / get / default / create / delete / compare / compare-file / commits + branch-protection (project/team/company) |
| list / get / create + tag-protection (team/company) |
| list / get / latest / create / edit / delete + upload / download / delete-file |
| CRUD + comments + relations + files (link/unlink) + |
| list / get / files / diff / for-file / commit-diff / tag-diff / cherry-pick |
| get (raw) / download / recursive / file-size |
| CRUD + search/my/shared + members/teams + fork/mirror/import + archive + attachments + change-setting + deploy-token + run-script |
| me / get / projects / followers / following |
| ssh / oauth / access-token / transport-token / смена email·username·password |
| list / my / shared / get / create + members + import (+ team transfer) |
| environment-protection (team/company) |
| list / get / create / edit / delete |
|
|
| pipeline + job lifecycle, artifacts, variables, pipeline-lifetime |
| project / company / instance: list / get / jobs / edit / shutdown / delete |
| админ-эндпоинты инстанса (нужны права администратора) |
→ Полный справочник с примерами: cli-gitflic.ru/commands
✅ Покрытие API
100% — все 20 разделов публичного REST GitFlic (~199 эндпоинтов; со scope-вариантами project/company/team/instance — больше). Часть admin/SAML/Enterprise — code-only (нужны права/редакция инстанса).
→ Подробная таблица по разделам: cli-gitflic.ru/api-coverage
🤖 Для AI-агентов
Каждая команда поддерживает --format json — агент или shell-пайплайн получает стабильный JSON.
# Открытые MR в проекте
gitflic mr list --project tikhon/wave --format json \
| jq '[._embedded.mergeRequestModelList[] | select(.status.id == "OPENED")] | length'Есть MCP-сервер (Model Context Protocol) с типизированными тулами поверх CLI — подключается к Claude Code, Cursor и др. После npm i -g gitflic-cli-mcp появляется команда gitflic-mcp; без установки — через npx:
claude mcp add gitflic --env GITFLIC_TOKEN=xxxx -- gitflic-mcp
# или без установки:
claude mcp add gitflic --env GITFLIC_TOKEN=xxxx -- npx -y gitflic-cli-mcpНабор из 78 тулзов можно сузить, чтобы не «съедать» контекст модели: GITFLIC_MCP_GROUPS=mr,issue (по группам), GITFLIC_MCP_READONLY=1 (только чтение) и др. — либо теми же флагами: gitflic-mcp --groups mr,issue --readonly --no-destructive.
→ MCP-сервер. Для ИИ также опубликованы /llms.txt и /llms-full.txt.
🏗️ Архитектура
gitflic-cli/
├── bin/gitflic # bash-шим → node lib/gitflic.mjs
├── bin/gitflic.cmd # Windows .cmd-шим → node lib/gitflic.mjs
├── bin/gitflic.ps1 # PowerShell-шим → node lib/gitflic.mjs
├── lib/
│ ├── gitflic.mjs # диспетчер команд
│ ├── http.mjs # fetch + retry + httpText/httpDownload/httpUploadFile
│ ├── secret.mjs # Keychain / libsecret / chmod 0600
│ ├── paginate.mjs # --all авто-пагинация + NDJSON streaming
│ ├── format.mjs # вывод, цвета, htmlUnescape
│ └── cmd/ # модули команд (mr, branch, release, registry, …)
├── mcp-server/ # Model Context Protocol сервер
├── docs/ # документация (VitePress → cli-gitflic.ru)
└── install.sh / install.ps1 # установщикиКаждый модуль экспортирует usage и handle(ctx, sub, args, flags). Диспетчер берёт на себя резолв токена, резолв проекта (--project или авто-детект из git) и генерацию help.
🛠️ Разработка
npm test # 256 unit-тестов (vitest)
npm run build # lint + тесты + portable tar.gz → dist/
npm run docs:dev # локальный VitePress dev-server
npm run docs:publish # собрать и задеплоить доку→ Подробно: Локальная разработка
📄 Лицензия
MIT.
Available Tools
78 toolsgitflic_authARead-only
Check authentication: returns the current authenticated user (id, username, email, fullName). Use this first to verify the token works.
Inputs: raw, fields.
gitflic_auth_bindADestructiveIdempotent
Bind (owner/alias) to . All subsequent commands scoped to that project resolve to 's token, overriding the active account. Refuses if has no token stored. Use to route different repos to different identities (work vs personal).
Inputs: account (required), project (required), raw.
gitflic_auth_bindingsARead-only
List all current project → account bindings. Sorted alphabetically by project.
Inputs: raw, fields.
gitflic_auth_listARead-only
List all known accounts (default + named) with masked token values. Marks the active account with '*'. Use before switching or binding to confirm available identities.
Inputs: raw, fields.
gitflic_auth_loginADestructive
Validate a GitFlic API token against /user/me, then store it in the OS keychain (macOS Keychain / Linux libsecret) or chmod-0600 file. Refuses to store an invalid token. Use --as to store under a named account; --stdin to read the token from stdin.
Inputs: as, raw, stdin, token, +1 more.
gitflic_auth_logoutADestructiveIdempotent
Remove a stored token. Default removes the active account. Pass --as to remove a specific named account. Pass --all to remove every token (and all per-project bindings).
Inputs: as, all, raw.
gitflic_auth_switchADestructiveIdempotent
Make the active account. Subsequent tool calls without a per-project binding resolve to this account's token. Refuses if no token is stored for the named account.
Inputs: name (required), raw.
gitflic_auth_unbindADestructiveIdempotent
Remove the binding for . Falls back to active-account token resolution for that project afterwards.
Inputs: project (required), raw.
gitflic_blob_filesCRead-only
List files in the repo (optionally under a sub-path).
Inputs: project (required), raw, path, branch, +1 more.
gitflic_blob_getCRead-only
Get a file's text content. Binary files are base64-encoded by the server.
Inputs: path (required), project (required), raw, branch, +2 more.
gitflic_branch_createCDestructiveIdempotent
Create a new branch from an existing one.
Inputs: project (required), newBranch (required), raw, from.
gitflic_branch_defaultCRead-only
Get the project's default branch.
Inputs: project (required), raw, fields.
gitflic_branch_deleteDDestructiveIdempotent
Delete a branch.
Inputs: name (required), project (required), raw.
gitflic_branch_getCRead-only
Get a single branch by name.
Inputs: name (required), project (required), raw, fields.
gitflic_branch_listCRead-only
List branches in a project.
Inputs: project (required), raw, name, sort, +3 more.
gitflic_branch_protection_createCDestructiveIdempotent
Create a branch-protection rule.
Inputs: project (required), allowedToPush (required), allowedToMerge (required), branchTemplate (required), +4 more.
gitflic_branch_protection_deleteCDestructiveIdempotent
Delete a branch-protection rule.
Inputs: uuid (required), project (required), raw.
gitflic_branch_protection_editCDestructiveIdempotent
Edit a branch-protection rule.
Inputs: uuid (required), project (required), raw, autoMerge, +4 more.
gitflic_branch_protection_getCRead-only
Get a branch-protection rule by uuid.
Inputs: uuid (required), project (required), raw, fields.
gitflic_branch_protection_listCRead-only
List branch protection rules.
Inputs: project (required), raw, fields.
gitflic_commit_compareCRead-only
Compare two commits.
Inputs: source (required), target (required), project (required), raw, +1 more.
gitflic_commit_filesCRead-only
List files touched by a commit.
Inputs: hash (required), project (required), raw, fields.
gitflic_commit_getCRead-only
Get one commit by hash.
Inputs: hash (required), project (required), raw, fields.
gitflic_commit_listCRead-only
List commits (default branch or --branch).
Inputs: project (required), q, raw, sort, +4 more.
gitflic_issue_closeBDestructiveIdempotent
Close an issue (shortcut: edit with --status CLOSED).
Inputs: id (required), project (required), raw.
gitflic_issue_commentCDestructive
Add a comment to an issue.
Inputs: id (required), message (required), project (required), raw.
gitflic_issue_comments_deleteCDestructiveIdempotent
Delete an issue comment.
Inputs: id (required), project (required), commentId (required), raw.
gitflic_issue_comments_editCDestructiveIdempotent
Edit an existing issue comment.
Inputs: id (required), message (required), project (required), commentId (required), +1 more.
gitflic_issue_comments_listCRead-only
List comments on an issue.
Inputs: id (required), project (required), raw, fields.
gitflic_issue_createCDestructiveIdempotent
Create a new issue.
Inputs: title (required), project (required), description (required), raw, +1 more.
gitflic_issue_deleteCDestructiveIdempotent
Delete an issue. Irreversible.
Inputs: id (required), project (required), raw.
gitflic_issue_editCDestructiveIdempotent
Edit an issue's title, description, status, assignee, or labels.
Inputs: id (required), project (required), raw, label, +4 more.
gitflic_issue_listCRead-only
List issues. Filter by --status if needed.
Inputs: project (required), q, raw, page, +7 more.
gitflic_issue_relations_listCRead-only
List issue relations (linked/related/blocks).
Inputs: id (required), project (required), raw, fields.
gitflic_issue_reopenCDestructive
Reopen a closed issue.
Inputs: id (required), project (required), raw.
gitflic_issue_viewCRead-only
Get one issue by localId.
Inputs: id (required), project (required), raw, fields.
gitflic_mr_approveADestructive
Toggle approve on a merge request (calling twice removes the approval).
Inputs: id (required), project (required), raw.
gitflic_mr_by_commitCRead-only
Find MR(s) containing a specific commit hash. Optionally filter by status.
Inputs: hash (required), project (required), raw, fields, +1 more.
gitflic_mr_cancelCDestructiveIdempotent
Cancel a merge request.
Inputs: id (required), project (required), raw.
gitflic_mr_closeCDestructiveIdempotent
Close a merge request.
Inputs: id (required), project (required), raw.
gitflic_mr_commentBDestructive
Add a comment to a merge request. For inline-anchored comments, pass new_path/new_line and old_path/old_line.
Inputs: id (required), message (required), project (required), raw, +4 more.
gitflic_mr_createADestructiveIdempotent
Create a new merge request. description is required (GitFlic rejects empty MR descriptions). If from is omitted, uses current git branch; if to is omitted, uses project default branch.
Inputs: title (required), project (required), description (required), to, +4 more.
gitflic_mr_diffBRead-only
Get the file-level diff for a merge request (hunks + per-line annotations).
Inputs: id (required), project (required), all, raw, +4 more.
gitflic_mr_discuss_deleteCDestructiveIdempotent
Delete a discussion thread on a merge request.
Inputs: id (required), project (required), discussionUuid (required), raw.
gitflic_mr_discuss_listARead-only
List discussions (with replies) on a merge request.
Inputs: id (required), project (required), all, raw, +3 more.
gitflic_mr_discuss_replyCDestructive
Reply to a discussion thread on a merge request.
Inputs: id (required), message (required), project (required), discussionUuid (required), +1 more.
gitflic_mr_discuss_resolveCDestructiveIdempotent
Resolve a discussion thread on a merge request.
Inputs: id (required), project (required), discussionUuid (required), raw.
gitflic_mr_editCDestructiveIdempotent
Edit MR title/description/target. Source branch cannot change.
Inputs: id (required), project (required), to, raw, +4 more.
gitflic_mr_listBRead-only
List merge requests in a project. Returns array with localId, title, status, author, source/target branches.
Inputs: project (required), q, raw, page, +8 more.
gitflic_mr_mergeBDestructive
Merge a merge request. May fail with MergeCheckException if branch protection requires more approvals.
Inputs: id (required), project (required), raw, message, +1 more.
gitflic_mr_viewBRead-only
Get one merge request by its localId. Returns full MR object including description, status, conflicts, canMerge.
Inputs: id (required), project (required), raw, fields.
gitflic_project_createCDestructiveIdempotent
Create a new project.
Inputs: alias (required), title (required), raw, language, +4 more.
gitflic_project_editADestructiveIdempotent
Edit project title, description, or language (via change-setting). Visibility and default branch are not editable over the REST API.
Inputs: project (required), raw, title, language, +1 more.
gitflic_project_getCRead-only
Resolve an owner/alias to its UUID + metadata.
Inputs: project (required), raw, fields.
gitflic_project_listARead-only
List accessible projects, including team projects. Defaults to scope shared; filter by owner alias.
Inputs: q, all, raw, page, +8 more.
gitflic_project_list_myARead-only
List projects owned by the current user. Use gitflic_project_list with scope shared for team and member projects.
Inputs: q, all, raw, page, +6 more.
gitflic_project_member_inviteCDestructive
Invite a user to a project with a role.
Inputs: role (required), project (required), userAlias (required), raw.
gitflic_project_member_listCRead-only
List project members.
Inputs: project (required), raw, fields.
gitflic_project_resolveARead-onlyIdempotent
Resolve a project owner/alias to its UUID + defaultBranch. Cached locally; needed before most other calls.
Inputs: project (required), raw, fields.
gitflic_release_createCDestructiveIdempotent
Create a new release.
Inputs: title (required), project (required), raw, tag, +2 more.
gitflic_release_deleteCDestructiveIdempotent
Delete a release.
Inputs: uuid (required), project (required), raw.
gitflic_release_editCDestructiveIdempotent
Edit release metadata.
Inputs: uuid (required), project (required), raw, tag, +3 more.
gitflic_release_getCRead-only
Get one release by uuid.
Inputs: uuid (required), project (required), raw, fields.
gitflic_release_latestCRead-only
Get the most recent release.
Inputs: project (required), raw, fields.
gitflic_release_listCRead-only
List releases.
Inputs: project (required), q, raw, tag, +4 more.
gitflic_tag_createCDestructiveIdempotent
Create a new tag (lightweight or annotated).
Inputs: name (required), project (required), raw, branch, +2 more.
gitflic_tag_getARead-only
Get a tag by name. NOTE: GitFlic returns 400 for project-scoped tag get; prefer tag list.
Inputs: name (required), project (required), raw, fields.
gitflic_tag_listCRead-only
List tags.
Inputs: project (required), raw, name, sort, +3 more.
gitflic_user_followersCRead-only
List a user's followers.
Inputs: alias (required), q, raw, limit, +1 more.
gitflic_user_getCRead-only
Get a user by alias.
Inputs: alias (required), raw, fields.
gitflic_user_meARead-only
Get the current authenticated user (id, username, email, name, fullName).
Inputs: raw, fields.
gitflic_user_projectsCRead-only
List public projects of a user.
Inputs: alias (required), q, raw, sort, +4 more.
gitflic_user_searchARead-only
Search users by username substring.
Inputs: q (required), raw, fields.
gitflic_webhook_createCDestructiveIdempotent
Create a webhook. Pass one or more event names.
Inputs: url (required), project (required), raw, event, +1 more.
gitflic_webhook_deleteCDestructiveIdempotent
Delete a webhook by uuid.
Inputs: uuid (required), project (required), raw.
gitflic_webhook_getCRead-only
Get one webhook by uuid.
Inputs: uuid (required), project (required), raw, fields.
gitflic_webhook_listBRead-only
List webhooks for a project.
Inputs: project (required), raw, event, limit, +1 more.
gitflic_webhook_reveal_secretADestructiveIdempotent
Reveal the raw signing secret of a webhook. SENSITIVE: by default the MCP masks secrets (returns secretSet:true/false). This tool returns the actual secret value and is marked destructive so the MCP host prompts for approval before it runs. Use only when the user explicitly needs the secret value.
Inputs: uuid (required), project (required), raw.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 78 tools
Most tools are scoped by resource and action, but several pairs overlap enough to cause misselection: project_get vs project_resolve, auth vs user_me, mr_cancel vs mr_close, and issue_close vs issue_edit with status CLOSED. Descriptions help clarify some cases, but the boundaries are not consistently crisp.
All tools use snake_case with the gitflic_ prefix, and most follow a predictable resource_action pattern such as gitflic_mr_create or gitflic_issue_comment. Minor deviations like gitflic_auth, gitflic_user_me, gitflic_project_list_my, and gitflic_mr_by_commit keep it from being fully consistent.
With 78 tools, the surface is far larger than the recommended 3-15 range and is heavy for an agent to navigate reliably. The domain is broad and the tools are grouped by resource, but many CRUD/auth variants could be consolidated or exposed more selectively.
Coverage is strong across projects, merge requests, issues, comments, branches, tags, releases, commits, webhooks, users, and authentication. Some expected lifecycle operations are missing or partial, such as project delete, tag delete, webhook edit, and MR reviewer assignment, but most core workflows are supported.
Maintenance
Related MCP Connectors
Go MCP server for GitLab: 2 dynamic tools reach 1000+ REST/GraphQL actions. Free/CE, no paid tier.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
GitLab MCP — wraps the GitLab REST API v4 (BYO API key)
GitLab Public MCP — wraps the GitLab REST API v4 (public endpoints, no auth)
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceFull-coverage GitLab MCP server with 44 tools across 18 resource types. Agent-optimized CQRS design — one tool call handles complete multi-step operations. Supports OAuth 2.1, read-only mode, stdio/SSE/StreamableHTTP transports, and GraphQL-native work items with full hierarchy (epics,issues,etc)1,922 npm8Apache 2.0
- AlicenseBqualityDmaintenanceThe most comprehensive Azure DevOps MCP server & CLI — 13 tools, 82 actions, single Go binary.141Apache 2.0
- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) server for GitLab — exposes 1006 GitLab REST & GraphQL API operations as MCP tools (42 meta-tools / 57 enterprise), 24 resources, 38 prompts, and 17 completion types for AI assistants. Written in Go, single static binary, stdio and HTTP transport.249MIT
- FlicenseNot gradedqualityCmaintenanceUnified MCP server for Git forge management across GitHub, GitLab, Gitea, and Bitbucket, enabling repository, issue, PR, and CI/CD operations via CLI tools and APIs.-