integram-mcp 0.7.26 → 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 +28 -0
  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.26
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.26
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.26"],
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.26"],
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
@@ -204,6 +204,7 @@ async function checkForUpdate() {
204
204
  // одноразовая приписка в длинной сессии теряется, а устаревшая сборка — это
205
205
  // дыра против юзера (нет новых тулов и фиксов до ручного обновления).
206
206
  function withUpdateNotice(result) {
207
+ lastCallAt = Date.now();
207
208
  if (!updateNotice) return result;
208
209
  if (!result || !Array.isArray(result.content)) return result;
209
210
  return { ...result, content: [...result.content, { type: 'text', text: updateNotice }] };
@@ -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.26",
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",