integram-mcp 0.7.70 → 0.7.76

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 -5
  2. package/index.js +59 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/integram-mcp)](https://www.npmjs.com/package/integram-mcp)
4
4
 
5
- MCP-сервер для Integram — даёт доступ к 737 инструментам (таблицы, документы, отчёты, автоматизации, портал, Telegram-боты, граф знаний и т.д.) из Claude Code, Claude Desktop и Cursor.
5
+ MCP-сервер для Integram — даёт доступ к 740 инструментам (таблицы, документы, отчёты, автоматизации, портал, Telegram-боты, граф знаний и т.д.) из Claude Code, Claude Desktop и Cursor.
6
6
 
7
7
  Работает с облачным Integram на **ai2o.online** или с локальным сервером.
8
8
 
@@ -15,7 +15,7 @@ claude mcp add integram \
15
15
  -e INTEGRAM_URL=https://ai2o.online \
16
16
  -e INTEGRAM_EMAIL=you@example.com \
17
17
  -e INTEGRAM_PASSWORD=secret \
18
- -- npx -y integram-mcp@0.7.70
18
+ -- npx -y integram-mcp@0.7.76
19
19
  ```
20
20
 
21
21
  Ставить ничего не нужно: `npx` скачает пакет сам.
@@ -43,7 +43,7 @@ claude mcp add integram \
43
43
  -e INTEGRAM_URL=http://localhost:8081 \
44
44
  -e INTEGRAM_EMAIL=you@example.com \
45
45
  -e INTEGRAM_PASSWORD=secret \
46
- -- npx -y integram-mcp@0.7.70
46
+ -- npx -y integram-mcp@0.7.76
47
47
  ```
48
48
 
49
49
  Удалить: `claude mcp remove integram`
@@ -57,7 +57,7 @@ claude mcp add integram \
57
57
  "mcpServers": {
58
58
  "integram": {
59
59
  "command": "npx",
60
- "args": ["-y", "integram-mcp@0.7.70"],
60
+ "args": ["-y", "integram-mcp@0.7.76"],
61
61
  "env": {
62
62
  "INTEGRAM_URL": "https://ai2o.online",
63
63
  "INTEGRAM_EMAIL": "you@example.com",
@@ -77,7 +77,7 @@ claude mcp add integram \
77
77
  "mcpServers": {
78
78
  "integram": {
79
79
  "command": "npx",
80
- "args": ["-y", "integram-mcp@0.7.70"],
80
+ "args": ["-y", "integram-mcp@0.7.76"],
81
81
  "env": {
82
82
  "INTEGRAM_URL": "https://ai2o.online",
83
83
  "INTEGRAM_EMAIL": "you@example.com",
@@ -111,6 +111,10 @@ claude mcp add integram -e INTEGRAM_URL=... -e INTEGRAM_EMAIL=... -e INTEGRAM_PA
111
111
 
112
112
  Чего здесь намеренно нет: пакета `update-notifier` — он печатает в `stdout` и только при TTY, то есть под stdio-транспортом не сработает и сломает протокол; и протокольного `notifications/message` — он объявлен устаревшим в версии протокола `2026-07-28`, а отправка до `initialize` ломает строгие клиенты.
113
113
 
114
+ ## Уведомления
115
+
116
+ - On startup the server checks unread notifications across workspaces and appends a summary to the first tool response.
117
+
114
118
  ## Переменные окружения
115
119
 
116
120
  | Переменная | Обязательна | По умолчанию | Описание |
@@ -189,6 +193,7 @@ claude mcp add integram -e INTEGRAM_URL=... -e INTEGRAM_EMAIL=... -e INTEGRAM_PA
189
193
  | **bulk** | Массовые операции: создание, обновление, удаление, AI-batch | 4 |
190
194
  | **dlp** | Контур защиты от утечек: DLP-правила воркспейса (список, создание, правка, удаление; только admin) | 4 |
191
195
  | **ai** | Синтез речи (TTS): озвучка текста, список голосов | 3 |
196
+ | **finmodel** | Финмодели: посчитанная сетка по периодам и сценариям, граф зависимостей ячеек, подбор параметров (goal-seek) с записью решения | 3 |
192
197
  | **normalizer** | Разбор документов: запуск, состояние, подтверждение сопоставления | 3 |
193
198
  | **timeseries** | Временные ряды: запись, запрос, список источников | 3 |
194
199
  | **history** | История изменений объектов, откат | 2 |
package/index.js CHANGED
@@ -206,10 +206,54 @@ async function checkForUpdate() {
206
206
  // Приписывает сигнал к КАЖДОМУ ответу инструмента, пока юзер не обновится:
207
207
  // одноразовая приписка в длинной сессии теряется, а устаревшая сборка — это
208
208
  // дыра против юзера (нет новых тулов и фиксов до ручного обновления).
209
- function withUpdateNotice(result) {
210
- if (!updateNotice) return result;
209
+ export function withUpdateNotice(result) {
211
210
  if (!result || !Array.isArray(result.content)) return result;
212
- return { ...result, content: [...result.content, { type: 'text', text: updateNotice }] };
211
+ let extra = [];
212
+ if (updateNotice) extra.push(updateNotice);
213
+ if (unreadNotice) { extra.push(unreadNotice); unreadNotice = null; }
214
+ if (!extra.length) return result;
215
+ return { ...result, content: [...result.content, { type: 'text', text: extra.join('\n') }] };
216
+ }
217
+
218
+ // ─── Сводка непрочитанных при старте ────────────────────────────────────────
219
+ //
220
+ // Канал «сервер MCP → модель → пользователь» без подписок из спецификации
221
+ // 2026-07-28 (в Claude Code их ещё нет): приписка к ответу инструмента.
222
+ // Одноразовая — сводка в каждом ответе была бы спамом (сигнал обновления
223
+ // приписывается ДО ОБНОВЛЕНИЯ к каждому — там одноразовость вредна).
224
+
225
+ let unreadNotice = null;
226
+
227
+ export function setUnreadNotice(text) { unreadNotice = text; }
228
+
229
+ export function buildUnreadNoticeText(data) {
230
+ if (!data || !Array.isArray(data.items)) return null;
231
+ const busy = data.items.filter((i) => i.count > 0);
232
+ if (!busy.length) return null;
233
+ return [
234
+ `🔔 Непрочитанные уведомления: ${busy.map((i) => `${i.workspace} — ${i.count}`).join(', ')}.`,
235
+ 'Скажи пользователю, где висит непрочитанное. Прочитать: switch_workspace на воркспейс и list_notifications.',
236
+ ].join(' ');
237
+ }
238
+
239
+ async function checkUnreadNotifications() {
240
+ try {
241
+ await ensureAuth();
242
+ let db = workspace;
243
+ if (!db) {
244
+ const list = await apiFetch('/api/v2/workspaces');
245
+ const first = (list.data || list)[0];
246
+ if (!first?.slug) return;
247
+ db = first.slug;
248
+ }
249
+ const data = await apiFetch(`/api/v2/${db}/notifications/across-workspaces`);
250
+ const payload = data.data || data;
251
+ const text = buildUnreadNoticeText(payload);
252
+ if (text) {
253
+ setUnreadNotice(text);
254
+ log(text);
255
+ }
256
+ } catch { /* нет сети, бэкенд недоступен — работе сервера не мешает */ }
213
257
  }
214
258
 
215
259
  // ─── Tool definitions cache ──────────────────────────────────────────────────
@@ -865,6 +909,7 @@ query_audit(type?, actor?, dateFrom?, dateTo?, action?, objectId?, typeId?, repo
865
909
  - get_notification_count() — number of unread notifications for current user
866
910
  - get_unread_across_workspaces() — unread counts across all user's workspaces
867
911
  - notification_action(notifId, actionKey) — execute action on a notification (e.g. approve/reject a suspended automation). Requires confirmation.
912
+ - On startup the server may append an unread-notifications summary to the first tool response — surface it to the user once, then drop it.
868
913
 
869
914
  ## Workspace admin
870
915
 
@@ -893,7 +938,7 @@ Client-facing portal management. Activate via search_tools("portal"); for @kit b
893
938
 
894
939
  **Configuration:**
895
940
  - get_portal_config() — current portal config (branding, pages, modules, auth, chat, SEO)
896
- - set_portal_config(config, active, custom_domain, merge?) — create/replace full config. With \`merge: true\` — deep-merge partial config into existing (no need to send entire config; only changed fields). Arrays are NOT merged — a partial \`pages[]\` replaces every page; for a one-module change use update_portal_module. **Requires confirmation.**
941
+ - set_portal_config(config, active, custom_domain, merge?) — create/replace full config. For \`custom_domain\`: omit it to keep the current value; \`null\` or empty string clears it. With \`merge: true\` — deep-merge partial config into existing (no need to send entire config; only changed fields). Arrays are NOT merged — a partial \`pages[]\` replaces every page; for a one-module change use update_portal_module. **Requires confirmation.**
897
942
  - update_portal_module(slug, config, moduleIndex) — update one module without overwriting others. Shallow merge into modules[moduleIndex ?? 0].config — keys you pass replace, keys you omit survive. If the MCP tool call cannot be issued, the equivalent REST is workspace-admin JWT → POST /api/v2/:db/portal/api/config (same upsertConfig + cache invalidation). Both writers validate references: custom_code repo/file and bindings table:N must exist in THIS workspace, otherwise the save is rejected (REPO_NOT_IN_WORKSPACE / FILE_NOT_IN_REPO / TABLE_NOT_IN_WORKSPACE; defects already present in the previous config do not block the edit). Every save snapshots the previous config to history: GET /api/v2/:db/portal/api/config/history lists snapshots, POST .../config/restore {historyId} rolls back (REST, admin JWT).
898
943
  - portal_preview() — get preview URL
899
944
  - portal_publish(active) — publish (true) or unpublish (false). **Requires confirmation.**
@@ -2238,6 +2283,10 @@ const EN_DESCRIPTIONS = {
2238
2283
  vid_list_jobs: 'List video-engine jobs of the workspace.',
2239
2284
  vid_cancel_job: 'Cancel a video-engine job (if it has not finished yet).',
2240
2285
  vid_validate_scenario: 'Validate a video scenario against the schema without creating anything: returns normalized steps or errors.',
2286
+ // Financial model
2287
+ fin_grid: 'Computed financial-model grid: period columns, rows with per-period values, totals and the sheet structure. scenario picks a scenario (defaults to the model first one), sheetId narrows to one sheet. Rows with an id like "g123" are group subtotals and have no record in the database.',
2288
+ fin_graph: 'Dependency graph of a financial model: the order cells are computed in and which cell depends on which. A circular reference is returned in the cycle field with an empty order — in that case the grid does not compute at all.',
2289
+ fin_goal_seek: 'Goal seek: which levers bring a target cell to the wanted value. target.rowId is a row id (or "g123" for a group subtotal), levers are input rows that may change, with optional min/max bounds. Without apply:true it only computes; with apply:true it writes the solution, and only when the target was reached. Failure is named in reason: unknown_target, no_sensitivity, flat, bounds, no_convergence.',
2241
2290
 
2242
2291
  };
2243
2292
 
@@ -2678,6 +2727,9 @@ export const GROUP_ALIASES = {
2678
2727
  инструмент: 'workspace-tools', пакет: 'workspace-tools', организац: 'orgs',
2679
2728
  найткол: 'nightcall', требован: 'nightcall', спецификац: 'nightcall', верификац: 'nightcall',
2680
2729
  формализ: 'nightcall', formaliz: 'nightcall', governance: 'nightcall', evidence: 'nightcall',
2730
+ // Само имя группы `finmodel` по-русски не ищется: слово «финмодель» с ним не
2731
+ // совпадает ни одной из сторон.
2732
+ финмодел: 'finmodel',
2681
2733
  };
2682
2734
 
2683
2735
  /**
@@ -3076,6 +3128,9 @@ async function main() {
3076
3128
  // 1. Login
3077
3129
  await login();
3078
3130
 
3131
+ // Сводка непрочитанных — fire-and-forget: старт не должен зависеть от бэкенда.
3132
+ checkUnreadNotifications();
3133
+
3079
3134
  // 2. Fetch tool definitions (if workspace is set)
3080
3135
  if (workspace) {
3081
3136
  const tools = await fetchTools();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integram-mcp",
3
- "version": "0.7.70",
3
+ "version": "0.7.76",
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",