integram-mcp 0.7.25 → 0.7.27

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 +5 -5
  2. package/index.js +32 -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 — даёт доступ к 613 инструментам (таблицы, документы, отчёты, автоматизации, портал, Telegram-боты, граф знаний и т.д.) из Claude Code, Claude Desktop и Cursor.
5
+ MCP-сервер для Integram — даёт доступ к 615 инструментам (таблицы, документы, отчёты, автоматизации, портал, 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.25
18
+ -- npx -y integram-mcp@0.7.27
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.25
46
+ -- npx -y integram-mcp@0.7.27
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.25"],
60
+ "args": ["-y", "integram-mcp@0.7.27"],
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.25"],
80
+ "args": ["-y", "integram-mcp@0.7.27"],
81
81
  "env": {
82
82
  "INTEGRAM_URL": "https://ai2o.online",
83
83
  "INTEGRAM_EMAIL": "you@example.com",
package/index.js CHANGED
@@ -142,7 +142,6 @@ function log(msg) {
142
142
  const UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
143
143
  const NPM_REGISTRY = (process.env.npm_config_registry || 'https://registry.npmjs.org').replace(/\/$/, '');
144
144
  let updateNotice = null; // текст приписки, когда есть версия новее
145
- let updateNoticeDelivered = false; // приписка отдаётся один раз за процесс
146
145
 
147
146
  // Сравнение версий: >0 если a новее b. Предвыпуск (0.8.0-beta.1) считается
148
147
  // старше своего релиза и не поднимает сигнал.
@@ -201,11 +200,13 @@ async function checkForUpdate() {
201
200
  } catch { /* нет сети, реестр недоступен, прокси — работе сервера не мешает */ }
202
201
  }
203
202
 
204
- // Приписывает сигнал к результату первого вызова инструмента — один раз.
203
+ // Приписывает сигнал к КАЖДОМУ ответу инструмента, пока юзер не обновится:
204
+ // одноразовая приписка в длинной сессии теряется, а устаревшая сборка — это
205
+ // дыра против юзера (нет новых тулов и фиксов до ручного обновления).
205
206
  function withUpdateNotice(result) {
206
- if (!updateNotice || updateNoticeDelivered) return result;
207
+ lastCallAt = Date.now();
208
+ if (!updateNotice) return result;
207
209
  if (!result || !Array.isArray(result.content)) return result;
208
- updateNoticeDelivered = true;
209
210
  return { ...result, content: [...result.content, { type: 'text', text: updateNotice }] };
210
211
  }
211
212
 
@@ -2222,6 +2223,32 @@ async function main() {
2222
2223
  log('MCP server running on stdio');
2223
2224
  }
2224
2225
 
2226
+ // ─── Orphan self-termination ─────────────────────────────────────────────────
2227
+ //
2228
+ // Клиенты (Claude Code, Cursor) не всегда убивают процессы MCP-серверов при
2229
+ // закрытии сессии — известная проблема экосистемы (anthropics/claude-code#22612):
2230
+ // пары «npm exec + node» остаются жить сутками с токенами доступа внутри
2231
+ // (замер от юзер-репорта 01.09.2026: 96 процессов, 2,88 ГБ RSS). Клиентский баг
2232
+ // нам не подвластен — завершаемся сами, тремя независимыми механизмами:
2233
+ // 1. stdin закрылся — клиент мёртв (для stdio-транспорта это канал жизни);
2234
+ // 2. PPID сменился — родитель умер, сироту переусыновил init;
2235
+ // 3. час без единого вызова инструмента — сессия, в которой нас забыли.
2236
+ // Живой клиент переносит смерть сервера безболезненно: stdio-сервер
2237
+ // перезапускается по требованию при следующем вызове.
2238
+ let ppid0 = process.ppid;
2239
+ let lastCallAt = Date.now();
2240
+ const ORPHAN_WATCHDOG_MS = 30_000;
2241
+ const ORPHAN_IDLE_MS = 60 * 60 * 1000;
2242
+
2243
+ function startOrphanWatchdog() {
2244
+ process.stdin.on('end', () => process.exit(0));
2245
+ process.stdin.on('close', () => process.exit(0));
2246
+ const timer = setInterval(() => {
2247
+ if (process.ppid !== ppid0 || Date.now() - lastCallAt > ORPHAN_IDLE_MS) process.exit(0);
2248
+ }, ORPHAN_WATCHDOG_MS);
2249
+ timer.unref();
2250
+ }
2251
+
2225
2252
  // Run only when executed as a program, not when imported. The guard test imports
2226
2253
  // `selectTools` from this file; without this check the import would log in, open a
2227
2254
  // stdio transport and hang the run. realpathSync is required, not decoration: npm
@@ -2237,6 +2264,7 @@ const isProgram = (() => {
2237
2264
  })();
2238
2265
 
2239
2266
  if (isProgram) {
2267
+ startOrphanWatchdog();
2240
2268
  main().catch(err => {
2241
2269
  process.stderr.write(`[integram-mcp] Fatal: ${err.message}\n`);
2242
2270
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integram-mcp",
3
- "version": "0.7.25",
3
+ "version": "0.7.27",
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",