gitflic-cli-mcp 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +10 -10
  2. package/package.json +1 -1
  3. package/tools.mjs +5 -26
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # gitflic-cli MCP-сервер
2
2
 
3
- [Model Context Protocol](https://modelcontextprotocol.io/) сервер, оборачивающий CLI `gitflic` и отдающий **77 типизированных тулзов** поверх команд GitFlic REST для AI-агентов (Claude Code, Cursor и т.п.).
3
+ [Model Context Protocol](https://modelcontextprotocol.io/) сервер, оборачивающий CLI `gitflic` и отдающий **76 типизированных тулзов** поверх команд GitFlic REST для AI-агентов (Claude Code, Cursor и т.п.).
4
4
 
5
5
  ## Что внутри
6
6
 
@@ -66,7 +66,7 @@ claude mcp add gitflic --env GITFLIC_TOKEN=xxxxxxxx -- npx -y gitflic-cli-mcp
66
66
 
67
67
  ## Ограничение набора тулзов (экономия контекста)
68
68
 
69
- Все 77 тулзов уходят хосту по `tools/list` ещё до первого вызова — это ~6K токенов «налога» на контекст модели. Если агенту нужны не все, набор можно сузить через **env-переменные** — прописываются в том же `env`-блоке конфига, где `GITFLIC_TOKEN` (своего конфиг-файла у сервера нет, он читает `process.env` при старте).
69
+ Все 76 тулзов уходят хосту по `tools/list` ещё до первого вызова — это ~6K токенов «налога» на контекст модели. Если агенту нужны не все, набор можно сузить через **env-переменные** — прописываются в том же `env`-блоке конфига, где `GITFLIC_TOKEN` (своего конфиг-файла у сервера нет, он читает `process.env` при старте).
70
70
 
71
71
  | Переменная | Значение | Что делает |
72
72
  |---|---|---|
@@ -76,7 +76,7 @@ claude mcp add gitflic --env GITFLIC_TOKEN=xxxxxxxx -- npx -y gitflic-cli-mcp
76
76
  | `GITFLIC_MCP_TOOLS` | список имён тулзов | явный allowlist (имеет приоритет над `GROUPS`) |
77
77
  | `GITFLIC_MCP_EXCLUDE` | список имён тулзов | убрать конкретные тулзы (применяется последним) |
78
78
 
79
- Все — опциональные. Без них регистрируются все 77 (как и раньше). Неизвестные группы/имена не валят сервер — он пишет `WARN` в stderr и игнорирует их.
79
+ Все — опциональные. Без них регистрируются все 76 (как и раньше). Неизвестные группы/имена не валят сервер — он пишет `WARN` в stderr и игнорирует их.
80
80
 
81
81
  **Порядок применения (precedence):**
82
82
 
@@ -92,7 +92,7 @@ claude mcp add gitflic --env GITFLIC_TOKEN=xxxxxxxx -- npx -y gitflic-cli-mcp
92
92
  | Группа | Тулзов | Read / Write |
93
93
  |---|---|---|
94
94
  | `auth` | 8 | 3 read / 5 write |
95
- | `blob` | 3 | 3 read / 0 write |
95
+ | `blob` | 2 | 2 read / 0 write |
96
96
  | `branch` | 10 | 5 read / 5 write |
97
97
  | `commit` | 4 | 4 read / 0 write |
98
98
  | `issue` | 12 | 4 read / 8 write |
@@ -118,14 +118,14 @@ claude mcp add gitflic --env GITFLIC_TOKEN=xxxxxxxx -- npx -y gitflic-cli-mcp
118
118
  **Примеры:**
119
119
 
120
120
  ```bash
121
- # Только MR и issue (~27 тулзов вместо 77)
121
+ # Только MR и issue (~27 тулзов вместо 76)
122
122
  claude mcp add gitflic --env GITFLIC_TOKEN=xxxx \
123
123
  --env GITFLIC_MCP_GROUPS=mr,issue -- npx -y gitflic-cli-mcp
124
124
 
125
125
  # Read-only агент для код-ревью (только тулзы без мутаций)
126
126
  GITFLIC_MCP_READONLY=1 npx -y gitflic-cli-mcp
127
127
 
128
- # Может всё, кроме удаления (70 тулзов: создаёт/правит/мёрджит — но не удаляет)
128
+ # Может всё, кроме удаления (69 тулзов: создаёт/правит/мёрджит — но не удаляет)
129
129
  GITFLIC_MCP_NO_DESTRUCTIVE=1 npx -y gitflic-cli-mcp
130
130
 
131
131
  # Точный набор из четырёх тулзов
@@ -153,15 +153,15 @@ GITFLIC_MCP_TOOLS="gitflic_mr_list,gitflic_mr_view,gitflic_mr_diff,gitflic_mr_cr
153
153
 
154
154
  > Можно поднять один и тот же сервер дважды под разными именами — напр. `gitflic` (полный) и `gitflic-ro` (`GITFLIC_MCP_READONLY=1`) — и держать оба подключёнными. Либо класть конфиг в проектный `.mcp.json` / `.cursor/mcp.json`, чтобы в каждом репозитории грузились свои группы.
155
155
 
156
- ## Все 77 тулзов
156
+ ## Все 76 тулзов
157
157
 
158
158
  Полный список по группам. **R** = read-only (`readOnlyHint: true`, не меняет состояние — попадает в `GITFLIC_MCP_READONLY=1`); **W** = write/мутация.
159
159
 
160
160
  ### `auth` (8)
161
161
  `R` `gitflic_auth` · `W` `gitflic_auth_login` · `W` `gitflic_auth_logout` · `R` `gitflic_auth_list` · `W` `gitflic_auth_switch` · `W` `gitflic_auth_bind` · `W` `gitflic_auth_unbind` · `R` `gitflic_auth_bindings`
162
162
 
163
- ### `blob` (3)
164
- `R` `gitflic_blob_get` · `R` `gitflic_blob_files` · `R` `gitflic_blob_archive`
163
+ ### `blob` (2)
164
+ `R` `gitflic_blob_get` · `R` `gitflic_blob_files`
165
165
 
166
166
  ### `branch` (10)
167
167
  `R` `gitflic_branch_list` · `W` `gitflic_branch_create` · `W` `gitflic_branch_delete` · `R` `gitflic_branch_get` · `R` `gitflic_branch_default` · `R` `gitflic_branch_protection_list` · `R` `gitflic_branch_protection_get` · `W` `gitflic_branch_protection_create` · `W` `gitflic_branch_protection_edit` · `W` `gitflic_branch_protection_delete`
@@ -190,7 +190,7 @@ GITFLIC_MCP_TOOLS="gitflic_mr_list,gitflic_mr_view,gitflic_mr_diff,gitflic_mr_cr
190
190
  ### `webhook` (4)
191
191
  `R` `gitflic_webhook_list` · `R` `gitflic_webhook_get` · `W` `gitflic_webhook_create` · `W` `gitflic_webhook_delete`
192
192
 
193
- Итого: **40 read / 37 write**. Каждый тул маппится 1-в-1 на подкоманду CLI (`gitflic …`).
193
+ Итого: **39 read / 37 write**. Каждый тул маппится 1-в-1 на подкоманду CLI (`gitflic …`).
194
194
 
195
195
  ## Как это работает
196
196
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitflic-cli-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "MCP server wrapping the gitflic CLI — exposes the GitFlic REST API as typed tools for AI agents (Claude Code, Cursor, etc.)",
5
5
  "type": "module",
6
6
  "bin": {
package/tools.mjs CHANGED
@@ -242,10 +242,10 @@ export const TOOLS = [
242
242
  {
243
243
  name: "gitflic_mr_create",
244
244
  description:
245
- "Create a new merge request. If --from is omitted, uses current git branch. If --to is omitted, uses project default branch.",
245
+ "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.",
246
246
  inputSchema: {
247
247
  type: "object",
248
- required: ["project", "title"],
248
+ required: ["project", "title", "description"],
249
249
  properties: {
250
250
  project: { type: "string" },
251
251
  title: { type: "string" },
@@ -1430,7 +1430,7 @@ export const TOOLS = [
1430
1430
  },
1431
1431
  {
1432
1432
  name: "gitflic_project_edit",
1433
- description: "Edit project metadata (title, description, default branch, visibility).",
1433
+ description: "Edit project title, description, or language (via change-setting). Visibility and default branch are not editable over the REST API.",
1434
1434
  inputSchema: {
1435
1435
  type: "object",
1436
1436
  required: ["project"],
@@ -1438,18 +1438,14 @@ export const TOOLS = [
1438
1438
  project: { type: "string" },
1439
1439
  title: { type: "string" },
1440
1440
  description: { type: "string" },
1441
- isPrivate: { type: "boolean" },
1442
1441
  language: { type: "string" },
1443
- defaultBranch: { type: "string" },
1444
1442
  },
1445
1443
  },
1446
1444
  handler: (a) => {
1447
1445
  const args = ["project", "edit", a.project, "--format", "json"];
1448
1446
  if (a.title) args.push("--title", a.title);
1449
1447
  if (a.description !== undefined) args.push("--description", a.description);
1450
- if (a.isPrivate !== undefined) args.push(a.isPrivate ? "--private" : "--public");
1451
1448
  if (a.language) args.push("--language", a.language);
1452
- if (a.defaultBranch) args.push("--default-branch", a.defaultBranch);
1453
1449
  return args;
1454
1450
  },
1455
1451
  annotations: {
@@ -1540,8 +1536,8 @@ export const TOOLS = [
1540
1536
  },
1541
1537
  },
1542
1538
  handler: (a) => {
1543
- const args = ["blob", "files", "--project", a.project, "--format", "json"];
1544
- if (a.path) args.push("--path", a.path);
1539
+ const args = ["blob", "recursive", "--project", a.project, "--format", "json"];
1540
+ if (a.path) args.push("--directory", a.path);
1545
1541
  if (a.branch) args.push("--branch", a.branch);
1546
1542
  return args;
1547
1543
  },
@@ -1553,23 +1549,6 @@ export const TOOLS = [
1553
1549
  openWorldHint: true,
1554
1550
  },
1555
1551
  },
1556
- {
1557
- name: "gitflic_blob_archive",
1558
- description: "Download a repo archive (tarball). Returns JSON metadata; use shell to stream the body.",
1559
- inputSchema: {
1560
- type: "object",
1561
- required: ["project", "branch"],
1562
- properties: { project: { type: "string" }, branch: { type: "string" } },
1563
- },
1564
- handler: (a) => ["blob", "archive", a.branch, "--project", a.project, "--format", "json"],
1565
- annotations: {
1566
- title: "Blob Archive",
1567
- readOnlyHint: true,
1568
- destructiveHint: false,
1569
- idempotentHint: false,
1570
- openWorldHint: true,
1571
- },
1572
- },
1573
1552
 
1574
1553
  // ===== User: get / projects / followers =================================
1575
1554
  {