integram-mcp 0.7.0 → 0.7.2

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 +51 -15
  2. package/index.js +161 -53
  3. package/package.json +5 -1
package/README.md CHANGED
@@ -1,39 +1,49 @@
1
1
  # Integram MCP Server
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/integram-mcp)](https://www.npmjs.com/package/integram-mcp)
4
+
3
5
  MCP-сервер для Integram — даёт доступ к 311 инструментам (таблицы, документы, отчёты, автоматизации, портал, Telegram-боты, граф знаний и т.д.) из Claude Code, Claude Desktop и Cursor.
4
6
 
5
7
  Работает с облачным Integram на **ai2o.online** или с локальным сервером.
6
8
 
9
+ Пакет: **https://www.npmjs.com/package/integram-mcp**
10
+
7
11
  ## Быстрый старт
8
12
 
13
+ ```bash
14
+ claude mcp add integram \
15
+ -e INTEGRAM_URL=https://ai2o.online \
16
+ -e INTEGRAM_EMAIL=you@example.com \
17
+ -e INTEGRAM_PASSWORD=secret \
18
+ -- npx -y integram-mcp@0.7.2
19
+ ```
20
+
21
+ Ставить ничего не нужно: `npx` скачает пакет сам.
22
+
23
+ **Номер версии в команде обязателен.** Плавающий `integram-mcp@latest` не годится по двум причинам. Первая: npx кэширует по строке запуска, поэтому окружение, чей кэш заполнился при старом `latest`, продолжает годами запускать ту сборку под тем же именем — открытая ошибка `npm/rfcs#700`. Второй: MCP-сервер по stdio исполняется на твоей машине с твоими правами и без песочницы, и плавающий номер означает «выполнить произвольный свежий код при каждом запуске клиента». О выходе новой версии сервер сообщит сам (см. ниже) — обновление остаётся осознанным движением.
24
+
25
+ ### Из репозитория (для разработки сервера)
26
+
9
27
  ```bash
10
28
  cd mcp-server
11
29
  npm install
12
30
  bash setup.sh
13
31
  ```
14
32
 
15
- Скрипт спросит URL, логин/пароль, клиент — и настроит всё сам.
33
+ Скрипт спросит URL, логин/пароль, клиент — и настроит всё сам. В этом режиме сервер сам подтягивает изменения: при запуске и раз в час делает `git pull --ff-only`, и если появились новые коммиты — доставляет зависимости и завершается, чтобы клиент поднял его заново.
16
34
 
17
35
  ## Ручная настройка
18
36
 
19
37
  ### Claude Code
20
38
 
21
- ```bash
22
- claude mcp add integram \
23
- -e INTEGRAM_URL=https://ai2o.online \
24
- -e INTEGRAM_EMAIL=you@example.com \
25
- -e INTEGRAM_PASSWORD=secret \
26
- -- node /absolute/path/to/mcp-server/index.js
27
- ```
28
-
29
- Для локального сервера замени URL:
39
+ Локальный сервер вместо облака — меняется только URL:
30
40
 
31
41
  ```bash
32
42
  claude mcp add integram \
33
43
  -e INTEGRAM_URL=http://localhost:8081 \
34
44
  -e INTEGRAM_EMAIL=you@example.com \
35
45
  -e INTEGRAM_PASSWORD=secret \
36
- -- node /absolute/path/to/mcp-server/index.js
46
+ -- npx -y integram-mcp@0.7.2
37
47
  ```
38
48
 
39
49
  Удалить: `claude mcp remove integram`
@@ -46,8 +56,8 @@ claude mcp add integram \
46
56
  {
47
57
  "mcpServers": {
48
58
  "integram": {
49
- "command": "node",
50
- "args": ["/absolute/path/to/mcp-server/index.js"],
59
+ "command": "npx",
60
+ "args": ["-y", "integram-mcp@0.7.2"],
51
61
  "env": {
52
62
  "INTEGRAM_URL": "https://ai2o.online",
53
63
  "INTEGRAM_EMAIL": "you@example.com",
@@ -66,8 +76,8 @@ claude mcp add integram \
66
76
  {
67
77
  "mcpServers": {
68
78
  "integram": {
69
- "command": "node",
70
- "args": ["/absolute/path/to/mcp-server/index.js"],
79
+ "command": "npx",
80
+ "args": ["-y", "integram-mcp@0.7.2"],
71
81
  "env": {
72
82
  "INTEGRAM_URL": "https://ai2o.online",
73
83
  "INTEGRAM_EMAIL": "you@example.com",
@@ -78,6 +88,27 @@ claude mcp add integram \
78
88
  }
79
89
  ```
80
90
 
91
+ Клон репозитория вместо пакета — `"command": "node", "args": ["/absolute/path/to/mcp-server/index.js"]`.
92
+
93
+ ## Обновление
94
+
95
+ Пакет выкладывается вручную, поэтому сервер сам сообщает, что запущен устаревшим. Раз в сутки он спрашивает у реестра npm тег `latest` (только теги, без метаданных пакета) и, если выложено новее, подаёт сигнал по двум каналам:
96
+
97
+ - **в `stderr`** — строкой `Доступна версия X (запущена Y)`. Это единственный поток, куда спецификация stdio-транспорта разрешает писать что угодно; в `stdout` нельзя ничего, кроме JSON-RPC. Клиент вправе `stderr` проигнорировать — поэтому канал не один;
98
+ - **припиской к ответу первого вызова инструмента** — единственный канал, доходящий до модели и через неё до человека. Ровно один раз за запуск процесса.
99
+
100
+ Обновиться — заменить номер версии в конфиге MCP и перезапустить клиент:
101
+
102
+ ```bash
103
+ claude mcp remove integram
104
+ claude mcp add integram -e INTEGRAM_URL=... -e INTEGRAM_EMAIL=... -e INTEGRAM_PASSWORD=... \
105
+ -- npx -y integram-mcp@НОВАЯ_ВЕРСИЯ
106
+ ```
107
+
108
+ Проверка не блокирует запуск, молчит без сети и глушится переменными `NO_UPDATE_NOTIFIER=1` (общепринятое соглашение) или `INTEGRAM_MCP_NO_UPDATE_CHECK=1`. Ответ реестра кэшируется на сутки в системном временном каталоге. Бета-версии не предлагаются тому, кто сидит на стабильной.
109
+
110
+ Чего здесь намеренно нет: пакета `update-notifier` — он печатает в `stdout` и только при TTY, то есть под stdio-транспортом не сработает и сломает протокол; и протокольного `notifications/message` — он объявлен устаревшим в версии протокола `2026-07-28`, а отправка до `initialize` ломает строгие клиенты.
111
+
81
112
  ## Переменные окружения
82
113
 
83
114
  | Переменная | Обязательна | По умолчанию | Описание |
@@ -87,6 +118,10 @@ claude mcp add integram \
87
118
  | `INTEGRAM_PASSWORD` | Да | — | Пароль |
88
119
  | `INTEGRAM_WORKSPACE` | Нет | _(не задан)_ | Slug воркспейса. Без него — выбрать из чата через `list_workspaces` + `switch_workspace` |
89
120
  | `INTEGRAM_SKIP_HITL` | Нет | `false` | `true` — выполнять деструктивные операции без подтверждения |
121
+ | `NO_UPDATE_NOTIFIER` | Нет | _(не задан)_ | Любое значение — не проверять новую версию в npm |
122
+ | `INTEGRAM_MCP_NO_UPDATE_CHECK` | Нет | _(не задан)_ | То же самое, только для этого сервера |
123
+ | `npm_config_registry` | Нет | `https://registry.npmjs.org` | Другой реестр для проверки версии |
124
+ | `HTTPS_PROXY` / `HTTP_PROXY` | Нет | _(не задан)_ | Прокси для исходящих запросов. Локальный Integram при заданном прокси добавляй в `NO_PROXY` |
90
125
 
91
126
  ## Как это работает
92
127
 
@@ -96,6 +131,7 @@ claude mcp add integram \
96
131
  4. Остальные инструменты подключаются по запросу через `search_tools`
97
132
  5. Вызовы проксируются на бэкенд с JWT-авторизацией
98
133
  6. JWT обновляется автоматически
134
+ 7. Раз в сутки сверяет свою версию с тегом `latest` в npm — см. «Обновление»
99
135
 
100
136
  ## Встроенные инструменты
101
137
 
package/index.js CHANGED
@@ -22,6 +22,11 @@ import {
22
22
  ListToolsRequestSchema,
23
23
  CallToolRequestSchema,
24
24
  } from '@modelcontextprotocol/sdk/types.js';
25
+ import { createRequire } from 'module';
26
+
27
+ // Own identity — read from package.json, never hardcoded: a hardcoded copy drifts
28
+ // (it sat at 0.5.0 through the 0.6.0 and 0.7.0 releases).
29
+ const PKG = createRequire(import.meta.url)('./package.json');
25
30
 
26
31
  const BASE_URL = (process.env.INTEGRAM_URL || 'http://localhost:8081').replace(/\/$/, '');
27
32
  const EMAIL = process.env.INTEGRAM_EMAIL;
@@ -113,6 +118,97 @@ function log(msg) {
113
118
  process.stderr.write(`[integram-mcp] ${msg}\n`);
114
119
  }
115
120
 
121
+ // ─── Сигнал о новой версии в npm ─────────────────────────────────────────────
122
+ //
123
+ // Пакет обновляется вручную (npm publish), поэтому клиенту нужен способ узнать,
124
+ // что он запустил устаревшую сборку. Два канала, оба необязательные для работы:
125
+ //
126
+ // 1. stderr — единственный поток, куда спецификация stdio-транспорта прямо
127
+ // разрешает писать что угодно ("The server MAY write UTF-8 strings to
128
+ // stderr for any logging purposes"). В stdout нельзя ничего, кроме
129
+ // JSON-RPC. Клиент stderr МОЖЕТ проигнорировать — поэтому канал не один.
130
+ // 2. Приписка к результату первого вызова инструмента — единственный канал,
131
+ // который доходит до модели и через неё до человека. Ровно один раз за
132
+ // запуск процесса.
133
+ //
134
+ // Чего здесь намеренно нет: пакета update-notifier (печатает в stdout и только
135
+ // при TTY — под stdio-транспортом не сработает и сломает протокол) и
136
+ // notifications/message (объявлен устаревшим в версии протокола 2026-07-28,
137
+ // а отправка до initialize ломает строгие клиенты).
138
+ //
139
+ // Проверка не блокирует запуск, не падает без сети и глушится переменными
140
+ // NO_UPDATE_NOTIFIER (общепринятое соглашение) и INTEGRAM_MCP_NO_UPDATE_CHECK.
141
+
142
+ const UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
143
+ const NPM_REGISTRY = (process.env.npm_config_registry || 'https://registry.npmjs.org').replace(/\/$/, '');
144
+ let updateNotice = null; // текст приписки, когда есть версия новее
145
+ let updateNoticeDelivered = false; // приписка отдаётся один раз за процесс
146
+
147
+ // Сравнение версий: >0 если a новее b. Предвыпуск (0.8.0-beta.1) считается
148
+ // старше своего релиза и не поднимает сигнал.
149
+ function cmpVersion(a, b) {
150
+ const parse = v => {
151
+ const m = /^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/.exec(String(v).trim());
152
+ return m ? { nums: [+m[1], +m[2], +m[3]], pre: m[4] || '' } : null;
153
+ };
154
+ const pa = parse(a), pb = parse(b);
155
+ if (!pa || !pb) return 0;
156
+ for (let i = 0; i < 3; i++) {
157
+ if (pa.nums[i] !== pb.nums[i]) return pa.nums[i] > pb.nums[i] ? 1 : -1;
158
+ }
159
+ if (pa.pre === pb.pre) return 0;
160
+ if (!pa.pre) return 1;
161
+ if (!pb.pre) return -1;
162
+ return pa.pre > pb.pre ? 1 : -1;
163
+ }
164
+
165
+ async function checkForUpdate() {
166
+ if (process.env.NO_UPDATE_NOTIFIER || process.env.INTEGRAM_MCP_NO_UPDATE_CHECK) return;
167
+ try {
168
+ const { readFileSync, writeFileSync } = await import('fs');
169
+ const os = await import('os');
170
+ const path = await import('path');
171
+ const cacheFile = path.join(os.tmpdir(), `${PKG.name}-update-check.json`);
172
+
173
+ let latest = null;
174
+ try {
175
+ const cached = JSON.parse(readFileSync(cacheFile, 'utf8'));
176
+ if (Date.now() - cached.checkedAt < UPDATE_CHECK_INTERVAL_MS) latest = cached.latest;
177
+ } catch { /* кэша нет или он битый — спросим реестр */ }
178
+
179
+ if (!latest) {
180
+ // Самая лёгкая точка реестра: только теги, без метаданных пакета.
181
+ const res = await fetch(`${NPM_REGISTRY}/-/package/${PKG.name}/dist-tags`, {
182
+ signal: AbortSignal.timeout(3000),
183
+ });
184
+ if (!res.ok) return;
185
+ latest = (await res.json())?.latest;
186
+ if (!latest) return;
187
+ try { writeFileSync(cacheFile, JSON.stringify({ checkedAt: Date.now(), latest })); } catch { /* кэш необязателен */ }
188
+ }
189
+
190
+ // Предвыпуск не предлагаем тому, кто сидит на стабильной версии: тег latest
191
+ // на него в норме не указывает, а если указал — это оплошность выкладки.
192
+ if (/-/.test(latest) && !/-/.test(PKG.version)) return;
193
+ if (cmpVersion(latest, PKG.version) <= 0) return;
194
+
195
+ log(`Доступна версия ${latest} (запущена ${PKG.version}): https://www.npmjs.com/package/${PKG.name}`);
196
+ updateNotice = [
197
+ `⚠️ integram-mcp: запущена версия ${PKG.version}, в npm выложена ${latest}.`,
198
+ `Скажи пользователю обновиться: заменить версию в конфиге MCP на \`${PKG.name}@${latest}\` и перезапустить клиент.`,
199
+ `Список изменений: https://www.npmjs.com/package/${PKG.name}`,
200
+ ].join(' ');
201
+ } catch { /* нет сети, реестр недоступен, прокси — работе сервера не мешает */ }
202
+ }
203
+
204
+ // Приписывает сигнал к результату первого вызова инструмента — один раз.
205
+ function withUpdateNotice(result) {
206
+ if (!updateNotice || updateNoticeDelivered) return result;
207
+ if (!result || !Array.isArray(result.content)) return result;
208
+ updateNoticeDelivered = true;
209
+ return { ...result, content: [...result.content, { type: 'text', text: updateNotice }] };
210
+ }
211
+
116
212
  // ─── Tool definitions cache ──────────────────────────────────────────────────
117
213
 
118
214
  let allTools = []; // full list from backend
@@ -147,33 +243,33 @@ Server: ${BASE_URL}
147
243
  3. Workspace management: clone_workspace to duplicate an existing workspace; delete_workspace to permanently remove one.
148
244
 
149
245
  ## Tool discovery
150
- Only core tools (~15: CRUD, search, graph, comments, bulk, history) are loaded by default. Use search_tools to activate more:
151
- - "schema" — create/modify tables and columns, AI/HTTP/script buttons, computed columns (LOOKUP/ROLLUP/FORMULA), validation rules, AI formula generation (~27 tools)
152
- - "reports" — create, run, export reports with aggregation, joins and filters (~15 tools)
153
- - "docs" — documents, blocks, folders, tags, sharing, versions, templates, PDF generation (~38 tools)
154
- - "workspace" — files, import/export, connectors, members, backups, dashboards, view/record sharing, audit log, normalizer, automations, webhooks, forms (~80 tools)
155
- - "portal" — portal config, catalog, carts, orders, tickets, KB articles, metrics, customer profiles, Telegram bots, @kit component catalog (~45 tools)
246
+ Only core tools (CRUD, search, graph, comments, bulk, history) are loaded by default. Use search_tools to activate more — it reports how many tools it activated and names them:
247
+ - "schema" — create/modify tables and columns, AI/HTTP/script buttons, computed columns (LOOKUP/ROLLUP/FORMULA), validation rules, AI formula generation
248
+ - "reports" — create, run, export reports with aggregation, joins and filters
249
+ - "docs" — documents, blocks, folders, tags, sharing, versions, templates, PDF generation
250
+ - "workspace" — files, import/export, connectors, members, backups, dashboards, view/record sharing, audit log, normalizer, automations, webhooks, forms
251
+ - "portal" — portal config, catalog, carts, orders, tickets, KB articles, metrics, customer profiles, Telegram bots, @kit component catalog
156
252
  - "telegram" — Telegram bot management, messaging, moderation, payments, stories, business API (subset of portal group)
157
- - "grants" — roles, grants, row-level rules, member access (admin only) (~11 tools)
158
- - "codespace" — git repositories: branches, commits, files, pull requests, conflict-safe writes (~22 tools)
159
- - "teamchat" — rooms, topics, messages, decisions, agent metrics, W-matrix (ONA) (~35 tools)
160
- - "graph" — get_related, graph_query, neighborhood, shortest path, health, memory agents (~9 tools)
161
- - "meta-kb" — debate-based knowledge curation: start debates, parallel experts, LLM synthesis (~6 tools)
162
- - "kag" — knowledge-augmented generation: search, traverse, ask, import, browse, stats, clusters, anomalies (~12 tools)
163
- - "memory" — agent long-term memory, recall, procedures, contradictions (~7 tools)
164
- - "timeseries" — record, query, and list time-series data sources (~3 tools)
165
- - "advisor" — platform expert: docs map/search/read, tool cards, advice on schema design and best practices (~6 tools)
166
- - "ai" — text-to-speech synthesis (TTS): speak text, list voices (~2 tools)
167
- - "agents" — list and delegate to external AI agents (~2 tools)
168
- - "pm" — project management: issues CRUD + bulk ops, checklists, sprints, board, backlog, comments CRUD, issue links, data-links (issue ↔ table/document/report), watchers, templates, trash/restore, members, CSV export, metrics (velocity, burndown, cycle time, workload), AI helpers (triage, decompose, estimate, plan sprint, detect blockers), org aggregation (portfolio, people, cross-project issues) (~53 tools)
169
- - "nightcall" — specification-driven execution: CNM requirements graph, formalization proposals (Extraction IR → governance decisions), artifact specifications, EffectiveSpecification resolver, execution compiler, directed-retry pipeline run, evidence verification, compliance/release decisions, waivers (~21 tools)
170
- - "orgs" — organizations: create, list, manage multi-workspace orgs and members (~8 tools)
171
- - "bulk" — bulk_create, bulk_update, bulk_delete, autofill_batch (~4 tools)
172
- - "comments" — comments, reactions on records (~6 tools)
173
- - "history" — object change history, rollback (~2 tools)
174
- - "objects" — move, reorder, duplicate records (~4 tools)
175
- - "lookups" — get lookup options, ref options (~2 tools)
176
- - "automations" — get automation details, webhook delivery log (~3 tools)
253
+ - "grants" — roles, grants, row-level rules, member access (admin only)
254
+ - "codespace" — git repositories: branches, commits, files, pull requests, conflict-safe writes
255
+ - "teamchat" — rooms, topics, messages, decisions, agent metrics, W-matrix (ONA)
256
+ - "graph" — get_related, graph_query, neighborhood, shortest path, health, memory agents
257
+ - "meta-kb" — debate-based knowledge curation: start debates, parallel experts, LLM synthesis
258
+ - "kag" — knowledge-augmented generation: search, traverse, ask, import, browse, stats, clusters, anomalies
259
+ - "memory" — agent long-term memory, recall, procedures, contradictions
260
+ - "timeseries" — record, query, and list time-series data sources
261
+ - "advisor" — platform expert: docs map/search/read, tool cards, advice on schema design and best practices
262
+ - "ai" — text-to-speech synthesis (TTS): speak text, list voices, check TTS service status
263
+ - "agents" — list and delegate to external AI agents
264
+ - "pm" — project management: issues CRUD + bulk ops, checklists, sprints, board, backlog, comments CRUD, issue links, data-links (issue ↔ table/document/report), watchers, templates, trash/restore, members, CSV export, metrics (velocity, burndown, cycle time, workload), AI helpers (triage, decompose, estimate, plan sprint, detect blockers), org aggregation (portfolio, people, cross-project issues)
265
+ - "nightcall" — specification-driven execution: CNM requirements graph, formalization proposals (Extraction IR → governance decisions), artifact specifications, EffectiveSpecification resolver, execution compiler, directed-retry pipeline run, evidence verification, compliance/release decisions, waivers
266
+ - "orgs" — organizations: create, list, manage multi-workspace orgs and members
267
+ - "bulk" — bulk_create, bulk_update, bulk_delete, autofill_batch
268
+ - "comments" — comments, reactions on records
269
+ - "history" — object change history, rollback
270
+ - "objects" — move, reorder, duplicate records
271
+ - "lookups" — get lookup options, ref options
272
+ - "automations" — get automation details, webhook delivery log
177
273
 
178
274
  ---
179
275
 
@@ -593,7 +689,8 @@ Block-based documents (like Notion). Activate via search_tools("documents").
593
689
 
594
690
  Event-driven rules: when X happens → check condition → do Y. Activate via search_tools("automations").
595
691
 
596
- create_automation({ name, trigger: { type, typeId }, condition, actions: [{ type, config }] })
692
+ create_automation({ name, trigger: { type, typeId }, active?, condition, actions: [{ type, config }] })
693
+ - active: false — создать выключенной (по умолчанию включена; выключенная не встаёт в расписание и не срабатывает)
597
694
  - Trigger types: on_create, on_update, on_delete, on_deadline, on_webhook, on_form_submit, schedule, manual, ai_analysis, on_metric_threshold, on_metric_silence, on_document, on_telegram_command, on_telegram_message, on_telegram_pre_checkout, on_telegram_shipping, on_telegram_payment, on_telegram_inline, on_telegram_join_request, on_telegram_business_connection, on_telegram_business_message, on_bot_chat_member
598
695
  - Actions: send_notification, send_notification_to_group, update_field, create_object, delete_object, fire_webhook, run_ai_agent, run_script, run_server_function, send_telegram, run_connector, send_email, update_related_records, set_requisite, update_related, http_request, if_else, switch, transform, wait_delay, request_approval, delegate_to_agent, invoke_agent, send_invoice, telegram_forward, answer_inline_query, telegram_ban, telegram_unban, telegram_restrict, telegram_promote, telegram_approve_join, telegram_decline_join, telegram_pin, telegram_unpin, telegram_get_chat, telegram_post_story, answer_shipping, telegram_business_reply
599
696
  update_related_records: { childTypeId, matchRefReqId, targetTypeId, targetMatchReqId, targetFieldReqId, sourceFieldReqId, operation: 'add'|'subtract'|'set' } — declarative cross-table update (e.g. inventory deduction: order items → match product ref → subtract from stock)
@@ -704,7 +801,7 @@ Activate via search_tools("history").
704
801
 
705
802
  ## Audit log (admin)
706
803
 
707
- query_audit(type, typeId, userId, from, to, limit) — unified audit log across objects, schema, and reports.
804
+ query_audit(type?, actor?, dateFrom?, dateTo?, action?, objectId?, typeId?, reportId?, limit?, offset?) — unified audit log across objects, schema, and reports. type: all|objects|schema|reports (default all). actor filters by username; dateFrom/dateTo are ISO timestamps. objectId narrows type=objects, typeId narrows type=schema, reportId narrows type=reports.
708
805
 
709
806
  ## Notifications
710
807
 
@@ -721,7 +818,7 @@ Read-only workspace metadata available without search_tools activation.
721
818
  ## Trash
722
819
 
723
820
  - list_trash(typeId) — see deleted records for a specific table
724
- - restore_from_trash(objId) — restore a deleted record
821
+ - restore_from_trash(objectId) — restore a deleted record
725
822
 
726
823
  ## Memory (agent long-term memory)
727
824
 
@@ -935,9 +1032,9 @@ Internal messaging with rooms, topics, and decisions. Activate via search_tools(
935
1032
 
936
1033
  **Rooms:**
937
1034
  - list_rooms() — list chat rooms the user has access to
938
- - create_room(name, description?, isPublic?) — create a new room
1035
+ - create_room(name, isPublic?) — create a new room
939
1036
  - get_room(roomId) — room details
940
- - update_room(roomId, name?, description?) — update room info
1037
+ - update_room(roomId, name?) — rename a room (name is the only editable field)
941
1038
  - delete_room(roomId) — delete room. **Requires confirmation.**
942
1039
  - join_room(roomId) — join a public room
943
1040
 
@@ -947,33 +1044,33 @@ Internal messaging with rooms, topics, and decisions. Activate via search_tools(
947
1044
  - remove_room_member(roomId, userId) — remove a member
948
1045
 
949
1046
  **Topics:**
950
- - list_topics(roomId?, search?) — list topics across rooms or in a specific room
1047
+ - list_topics(search?, limit?) — list topics across ALL rooms the user is a member of; there is no per-room filter
951
1048
  - list_recent_topics(limit?) — recently active topics
952
- - create_topic(roomId, title, description?) — create a topic in a room
953
- - update_topic(topicId, title?, description?, status?) — update topic
1049
+ - create_topic(roomId, title, first_message?) — create a topic in a room; first_message posts an opening message
1050
+ - update_topic(topicId, name?, status?, pinned?, assigned_to?, priority?, deadline_at?) — update topic. The title is called \`name\` here, not \`title\` as in create_topic.
954
1051
  - delete_topic(topicId) — delete topic. **Requires confirmation.**
955
1052
  - summarize_topic(topicId) — AI-generated summary of topic discussion
956
1053
  - mark_topic_read(topicId) — mark topic as read
957
1054
  - export_topic_to_document(topicId) — export topic content to a document
958
1055
 
959
1056
  **Messages:**
960
- - list_messages(topicId, limit?, before?) — list messages in a topic
1057
+ - list_messages(topicId, limit?, cursor?) — list messages in a topic
961
1058
  - create_message(topicId, text) — post a message
962
1059
  - send_teamchat_message(topicId, text, cards?) — post a message with optional code_cell cards for executable code
963
1060
  - update_message(msgId, text) — edit a message
964
1061
  - delete_message(msgId) — delete a message. **Requires confirmation.**
965
1062
  - move_message(msgId, targetTopicId) — move a message to another topic
966
- - search_teamchat(query, roomId?, limit?) — full-text search across messages
1063
+ - search_teamchat(query, room_id?, limit?, task_only?) — full-text search across messages; task_only narrows to task-flagged messages
967
1064
 
968
1065
  **Decisions:**
969
1066
  - create_decision(title, description?, domain?) — create an architectural decision record
970
- - get_decision(decisionId) — get decision details
971
- - update_decision(decisionId, title?, description?, status?) — update a decision
972
- - delete_decision(decisionId) — delete a decision. **Requires confirmation.**
1067
+ - get_decision(id) — get decision details
1068
+ - update_decision(id, title?, description?, domain?, verdict?, impact?) — update a decision. There is no \`status\` field: the lifecycle field is \`verdict\` (proposed | accepted | rejected | superseded | draft). \`impact\`: critical | high | medium | low. When the caller is an agent account (username starting with \`agent:\`), changing \`verdict\` is not applied immediately — the call returns \`status: "approval_requested"\` and waits for a human.
1069
+ - delete_decision(id) — delete a decision. **Requires confirmation.**
973
1070
  - search_similar_decisions(query, domain?, limit?) — semantic search for similar decisions
974
1071
  - analyze_decision_conflicts(decisionId) — find conflicts with other decisions
975
- - list_decision_links(decisionId) — list links to/from a decision
976
- - create_decision_link(fromId, toId, type) — link two decisions (type: supersedes|depends_on|relates_to|conflicts_with)
1072
+ - list_decision_links(id) — list links to/from a decision
1073
+ - create_decision_link(id, targetId, type) — link two decisions. \`id\` is the SOURCE decision (the "from" side), \`targetId\` is the destination — the link reads id → targetId. type: supersedes|depends_on|related_to|conflicts_with
977
1074
  - delete_decision_link(linkId) — remove a link
978
1075
 
979
1076
  **Analytics:**
@@ -983,22 +1080,24 @@ Internal messaging with rooms, topics, and decisions. Activate via search_tools(
983
1080
  ## Organizations
984
1081
 
985
1082
  Multi-workspace organizations. Activate via search_tools("orgs").
1083
+ Organizations are addressed by \`slug\`, never by a numeric id.
986
1084
 
987
1085
  - list_orgs() — list organizations the user belongs to
988
- - get_org(orgId) — organization details
1086
+ - get_org(slug) — organization details
989
1087
  - create_org(name, slug) — create a new organization. **Requires confirmation.**
990
- - update_org(orgId, name?) — update organization. **Requires confirmation.**
991
- - delete_org(orgId) — delete organization. **Requires confirmation.**
992
- - list_org_members(orgId) — list members of an organization
993
- - add_org_member(orgId, userId, role?) — add member. **Requires confirmation.**
994
- - remove_org_member(orgId, userId) — remove member. **Requires confirmation.**
1088
+ - update_org(slug, name?) — update organization. **Requires confirmation.**
1089
+ - delete_org(slug) — delete organization. **Requires confirmation.**
1090
+ - list_org_members(slug) — list members of an organization
1091
+ - add_org_member(slug, email, role?) — add member by e-mail. **Requires confirmation.**
1092
+ - remove_org_member(slug, memberId) — remove member by membership id (from list_org_members). **Requires confirmation.**
995
1093
 
996
1094
  ## Timeseries
997
1095
 
998
1096
  Time-series data ingestion and aggregated queries. Activate via search_tools("timeseries").
999
1097
 
1000
- - record_timeseries(source, metric, value, timestamp?, tags?) — record a data point
1001
- - query_timeseries(source, metric, from?, to?, aggregation?, interval?) — query aggregated data. aggregation: avg|sum|min|max|count. interval: 1h|1d|1w|1M
1098
+ - record_timeseries(source_id, metric, value?, text_val?, ts?) — record one data point. \`value\` is numeric, \`text_val\` is its textual alternative — one of the two is required. \`ts\` is an ISO timestamp (defaults to now). There is no \`tags\` field.
1099
+ - record_timeseries(points) — batch form: points is an array of { source_id, metric, value?, text_val?, ts? }. Every point needs its own source_id and metric.
1100
+ - query_timeseries(source_id, metric, from?, to?, bucket?, agg?, limit?) — query aggregated data. source_id and metric are REQUIRED. from/to are ISO timestamps. agg: avg|sum|min|max|count (default avg). bucket: 1m|5m|15m|30m|1h|6h|1d|7d|30d (default 1h) — any other value is rejected.
1002
1101
  - list_timeseries_sources() — list available data sources and their metrics
1003
1102
 
1004
1103
  ## KAG (Knowledge-Augmented Generation)
@@ -1068,7 +1167,7 @@ Destructive and schema operations return "REQUIRES CONFIRMATION". Ask the user t
1068
1167
  `;
1069
1168
 
1070
1169
  const server = new Server(
1071
- { name: 'integram', version: '0.5.0' },
1170
+ { name: 'integram', version: PKG.version },
1072
1171
  { capabilities: { tools: { listChanged: true }, elicitation: {} }, instructions: INSTRUCTIONS },
1073
1172
  );
1074
1173
 
@@ -1356,6 +1455,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
1356
1455
 
1357
1456
  // Handler: call tool
1358
1457
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
1458
+ return withUpdateNotice(await dispatchTool(request));
1459
+ });
1460
+
1461
+ async function dispatchTool(request) {
1359
1462
  const { name, arguments: args } = request.params;
1360
1463
 
1361
1464
  // Built-in tools
@@ -1365,7 +1468,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1365
1468
  if (name === 'delete_workspace') return handleDeleteWorkspace(args?.slug || '');
1366
1469
  if (name === 'clone_workspace') return handleCloneWorkspace(args || {});
1367
1470
  if (name === 'search_tools') return handleSearchTools(args?.query || '');
1368
- if (name === 'confirm_action') return handleConfirmAction(args?.approved ?? false);
1471
+ if (name === 'confirm_action') return handleConfirmAction(args?.approved === true);
1369
1472
 
1370
1473
  // Check workspace is set
1371
1474
  if (!workspace) {
@@ -1459,7 +1562,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1459
1562
  } catch (err) {
1460
1563
  return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };
1461
1564
  }
1462
- });
1565
+ }
1463
1566
 
1464
1567
  // ─── confirm_action handler ──────────────────────────────────────────────────
1465
1568
 
@@ -1473,7 +1576,7 @@ async function handleConfirmAction(approved) {
1473
1576
  let msg;
1474
1577
  if (pending.onApprove) {
1475
1578
  // Local HITL (e.g. delete_workspace) — execute callback directly
1476
- if (approved) {
1579
+ if (approved === true) {
1477
1580
  msg = await pending.onApprove();
1478
1581
  } else {
1479
1582
  if (pending.onReject) pending.onReject();
@@ -1855,6 +1958,11 @@ async function main() {
1855
1958
  tryAutoUpdate();
1856
1959
  setInterval(tryAutoUpdate, AUTO_UPDATE_INTERVAL);
1857
1960
 
1961
+ // Не ждём: запуск сервера не должен зависеть от доступности реестра npm.
1962
+ checkForUpdate();
1963
+ setInterval(checkForUpdate, UPDATE_CHECK_INTERVAL_MS).unref();
1964
+
1965
+ log(`integram-mcp ${PKG.version}`);
1858
1966
  log(`Connecting to ${BASE_URL}, workspace "${workspace || '(not set)'}"`);
1859
1967
 
1860
1968
  // 1. Login
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integram-mcp",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "description": "MCP server for Integram — connect AI assistants to your workspace via Model Context Protocol",
6
6
  "mcpName": "io.github.judas-priest/integram",
@@ -19,6 +19,10 @@
19
19
  "bin": {
20
20
  "integram-mcp": "./index.js"
21
21
  },
22
+ "scripts": {
23
+ "test": "node scripts/check-versions.mjs",
24
+ "prepublishOnly": "node scripts/check-versions.mjs"
25
+ },
22
26
  "files": [
23
27
  "index.js"
24
28
  ],