telegram-notifications-mcp 1.0.0 → 1.0.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.
- package/README.md +85 -46
- package/dist/cli.js +7 -7
- package/dist/config.js +16 -12
- package/dist/server.js +1 -1
- package/docker-compose.yml +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Telegram Notifications MCP
|
|
2
2
|
|
|
3
|
-
   [   [](https://www.npmjs.com/package/telegram-notifications-mcp) 
|
|
4
4
|
|
|
5
5
|
A simple secure MCP server for Telegram Bot API notifications.
|
|
6
6
|
|
|
@@ -52,16 +52,18 @@ The examples use the target name `dev-status` and the bot `My_Alerts_Bot`. Repla
|
|
|
52
52
|
### 1. Install and initialize
|
|
53
53
|
|
|
54
54
|
```sh
|
|
55
|
-
npm install --global
|
|
56
|
-
telegram-
|
|
55
|
+
npm install --global telegram-notifications-mcp
|
|
56
|
+
telegram-notifs-mcp init
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
The npm package is `telegram-notifications-mcp`; the command it installs is `telegram-notifs-mcp`. `init` creates `~/.config/telegram-notifs-mcp/config.json` with discovery on.
|
|
60
|
+
|
|
61
|
+
An existing config from before the rename is reused; open the path printed by `init` instead of the example below.
|
|
60
62
|
|
|
61
63
|
### 2. Add your target
|
|
62
64
|
|
|
63
65
|
```sh
|
|
64
|
-
open -e "$HOME/.config/telegram-
|
|
66
|
+
open -e "$HOME/.config/telegram-notifs-mcp/config.json"
|
|
65
67
|
```
|
|
66
68
|
|
|
67
69
|
Fill in `targets`, leaving everything else as is:
|
|
@@ -98,7 +100,7 @@ Make sure nothing else is polling this bot (another script, a hosted copy of thi
|
|
|
98
100
|
**Command:**
|
|
99
101
|
|
|
100
102
|
```sh
|
|
101
|
-
telegram-
|
|
103
|
+
telegram-notifs-mcp discover --target dev-status --confirm-no-other-poller
|
|
102
104
|
```
|
|
103
105
|
|
|
104
106
|
**Agent:** add a temporary entry to your _user-level_ MCP config (not the project's), then ask your agent to call `discover_chats` with `{"source": "target", "name": "dev-status", "confirmNoOtherPoller": true}`:
|
|
@@ -108,7 +110,7 @@ telegram-notif-mcp discover --target dev-status --confirm-no-other-poller
|
|
|
108
110
|
"servers": {
|
|
109
111
|
"telegram-discovery": {
|
|
110
112
|
"type": "stdio",
|
|
111
|
-
"command": "telegram-
|
|
113
|
+
"command": "telegram-notifs-mcp",
|
|
112
114
|
"args": ["serve", "--discovery"]
|
|
113
115
|
}
|
|
114
116
|
}
|
|
@@ -144,8 +146,8 @@ Add `chatId` (keep the minus sign) and, for a forum topic only, `threadId`:
|
|
|
144
146
|
```
|
|
145
147
|
|
|
146
148
|
```sh
|
|
147
|
-
telegram-
|
|
148
|
-
telegram-
|
|
149
|
+
telegram-notifs-mcp check --target dev-status
|
|
150
|
+
telegram-notifs-mcp test-send dev-status
|
|
149
151
|
```
|
|
150
152
|
|
|
151
153
|
`check` sends nothing. `test-send` sends one real message; look for it in Telegram.
|
|
@@ -161,9 +163,9 @@ In the project's `.vscode/mcp.json`:
|
|
|
161
163
|
```json
|
|
162
164
|
{
|
|
163
165
|
"servers": {
|
|
164
|
-
"telegram-
|
|
166
|
+
"telegram-notifs-mcp": {
|
|
165
167
|
"type": "stdio",
|
|
166
|
-
"command": "telegram-
|
|
168
|
+
"command": "telegram-notifs-mcp",
|
|
167
169
|
"args": ["serve", "--target", "dev-status"]
|
|
168
170
|
}
|
|
169
171
|
}
|
|
@@ -181,16 +183,18 @@ Run these in PowerShell.
|
|
|
181
183
|
### 1. Install and initialize
|
|
182
184
|
|
|
183
185
|
```powershell
|
|
184
|
-
npm install --global
|
|
185
|
-
telegram-
|
|
186
|
+
npm install --global telegram-notifications-mcp
|
|
187
|
+
telegram-notifs-mcp init
|
|
186
188
|
```
|
|
187
189
|
|
|
188
|
-
|
|
190
|
+
The npm package is `telegram-notifications-mcp`; the command it installs is `telegram-notifs-mcp`. `init` creates `%LOCALAPPDATA%\telegram-notifs-mcp\config.json` with discovery on. Access is restricted to your account automatically.
|
|
191
|
+
|
|
192
|
+
An existing config from before the rename is reused; open the path printed by `init` instead of the example below.
|
|
189
193
|
|
|
190
194
|
### 2. Add your target
|
|
191
195
|
|
|
192
196
|
```powershell
|
|
193
|
-
notepad "$env:LOCALAPPDATA\telegram-
|
|
197
|
+
notepad "$env:LOCALAPPDATA\telegram-notifs-mcp\config.json"
|
|
194
198
|
```
|
|
195
199
|
|
|
196
200
|
Fill in `targets`, leaving everything else as is:
|
|
@@ -227,7 +231,7 @@ Make sure nothing else is polling this bot. Then use either option.
|
|
|
227
231
|
**Command:**
|
|
228
232
|
|
|
229
233
|
```powershell
|
|
230
|
-
telegram-
|
|
234
|
+
telegram-notifs-mcp discover --target dev-status --confirm-no-other-poller
|
|
231
235
|
```
|
|
232
236
|
|
|
233
237
|
**Agent:** add a temporary entry to your _user-level_ MCP config (not the project's), then ask your agent to call `discover_chats` with `{"source": "target", "name": "dev-status", "confirmNoOtherPoller": true}`:
|
|
@@ -237,7 +241,7 @@ telegram-notif-mcp discover --target dev-status --confirm-no-other-poller
|
|
|
237
241
|
"servers": {
|
|
238
242
|
"telegram-discovery": {
|
|
239
243
|
"type": "stdio",
|
|
240
|
-
"command": "telegram-
|
|
244
|
+
"command": "telegram-notifs-mcp",
|
|
241
245
|
"args": ["serve", "--discovery"]
|
|
242
246
|
}
|
|
243
247
|
}
|
|
@@ -260,8 +264,8 @@ Add `chatId` (keep the minus sign) and, for a forum topic only, `threadId`:
|
|
|
260
264
|
```
|
|
261
265
|
|
|
262
266
|
```powershell
|
|
263
|
-
telegram-
|
|
264
|
-
telegram-
|
|
267
|
+
telegram-notifs-mcp check --target dev-status
|
|
268
|
+
telegram-notifs-mcp test-send dev-status
|
|
265
269
|
```
|
|
266
270
|
|
|
267
271
|
`check` sends nothing. `test-send` sends one real message; look for it in Telegram.
|
|
@@ -277,16 +281,16 @@ In the project's `.vscode/mcp.json`:
|
|
|
277
281
|
```json
|
|
278
282
|
{
|
|
279
283
|
"servers": {
|
|
280
|
-
"telegram-
|
|
284
|
+
"telegram-notifs-mcp": {
|
|
281
285
|
"type": "stdio",
|
|
282
|
-
"command": "telegram-
|
|
286
|
+
"command": "telegram-notifs-mcp",
|
|
283
287
|
"args": ["serve", "--target", "dev-status"]
|
|
284
288
|
}
|
|
285
289
|
}
|
|
286
290
|
}
|
|
287
291
|
```
|
|
288
292
|
|
|
289
|
-
Add `"--label", "my-project"` to the args to prefix messages with a project name. Other MCP clients use the same command and args in their own format. If your client can't start `telegram-
|
|
293
|
+
Add `"--label", "my-project"` to the args to prefix messages with a project name. Other MCP clients use the same command and args in their own format. If your client can't start `telegram-notifs-mcp`, see [Troubleshooting](#troubleshooting).
|
|
290
294
|
|
|
291
295
|
<br/>
|
|
292
296
|
|
|
@@ -297,8 +301,8 @@ Run these on your server. You also need an HTTPS reverse proxy in front of port
|
|
|
297
301
|
### 1. Configure and start
|
|
298
302
|
|
|
299
303
|
```sh
|
|
300
|
-
git clone https://github.com/gmoz22/telegram-
|
|
301
|
-
cd telegram-
|
|
304
|
+
git clone https://github.com/gmoz22/telegram-notifications-mcp.git
|
|
305
|
+
cd telegram-notifications-mcp
|
|
302
306
|
cp .env.example .env
|
|
303
307
|
chmod 600 .env
|
|
304
308
|
```
|
|
@@ -319,7 +323,7 @@ First start creates `/data/config.json` with discovery on, plus a private admini
|
|
|
319
323
|
### 2. Add your target
|
|
320
324
|
|
|
321
325
|
```sh
|
|
322
|
-
docker compose exec telegram-
|
|
326
|
+
docker compose exec telegram-notifs-mcp vi /data/config.json
|
|
323
327
|
```
|
|
324
328
|
|
|
325
329
|
Add your target to `targets`. Keep the generated `discovery` block as is. The token is a reference to the `.env` variable:
|
|
@@ -334,7 +338,7 @@ Add your target to `targets`. Keep the generated `discovery` block as is. The to
|
|
|
334
338
|
```
|
|
335
339
|
|
|
336
340
|
```sh
|
|
337
|
-
docker compose restart telegram-
|
|
341
|
+
docker compose restart telegram-notifs-mcp
|
|
338
342
|
```
|
|
339
343
|
|
|
340
344
|
### 3. Say hello in Telegram
|
|
@@ -352,14 +356,14 @@ Make sure nothing else is polling this bot. Then use either option.
|
|
|
352
356
|
**Command:**
|
|
353
357
|
|
|
354
358
|
```sh
|
|
355
|
-
docker compose exec telegram-
|
|
359
|
+
docker compose exec telegram-notifs-mcp node dist/cli.js discover \
|
|
356
360
|
--target dev-status --confirm-no-other-poller
|
|
357
361
|
```
|
|
358
362
|
|
|
359
363
|
**Agent:** get the administrator key from a trusted terminal:
|
|
360
364
|
|
|
361
365
|
```sh
|
|
362
|
-
docker compose exec telegram-
|
|
366
|
+
docker compose exec telegram-notifs-mcp node dist/cli.js admin-key show
|
|
363
367
|
```
|
|
364
368
|
|
|
365
369
|
Add a temporary entry to your _user-level_ VS Code MCP config. VS Code prompts for the key once and stores it securely:
|
|
@@ -404,9 +408,9 @@ Edit `/data/config.json` again and add `chatId` (keep the minus sign) and, for a
|
|
|
404
408
|
```
|
|
405
409
|
|
|
406
410
|
```sh
|
|
407
|
-
docker compose restart telegram-
|
|
408
|
-
docker compose exec telegram-
|
|
409
|
-
docker compose exec telegram-
|
|
411
|
+
docker compose restart telegram-notifs-mcp
|
|
412
|
+
docker compose exec telegram-notifs-mcp node dist/cli.js check --target dev-status
|
|
413
|
+
docker compose exec telegram-notifs-mcp node dist/cli.js test-send dev-status
|
|
410
414
|
```
|
|
411
415
|
|
|
412
416
|
### 6. Create a project key
|
|
@@ -414,7 +418,7 @@ docker compose exec telegram-notif-mcp node dist/cli.js test-send dev-status
|
|
|
414
418
|
Do this **before** turning off discovery: hosted mode needs at least one project key once discovery is off.
|
|
415
419
|
|
|
416
420
|
```sh
|
|
417
|
-
docker compose exec telegram-
|
|
421
|
+
docker compose exec telegram-notifs-mcp node dist/cli.js keygen \
|
|
418
422
|
--client my-project --target dev-status
|
|
419
423
|
```
|
|
420
424
|
|
|
@@ -425,7 +429,7 @@ The key is printed once; copy it now. Only its hash is stored.
|
|
|
425
429
|
In `/data/config.json`, set `"enabled": false` under `discovery`. Then:
|
|
426
430
|
|
|
427
431
|
```sh
|
|
428
|
-
docker compose restart telegram-
|
|
432
|
+
docker compose restart telegram-notifs-mcp
|
|
429
433
|
```
|
|
430
434
|
|
|
431
435
|
Remove the temporary `telegram-discovery` MCP entry if you added one.
|
|
@@ -445,7 +449,7 @@ In the project's `.vscode/mcp.json`:
|
|
|
445
449
|
}
|
|
446
450
|
],
|
|
447
451
|
"servers": {
|
|
448
|
-
"telegram-
|
|
452
|
+
"telegram-notifs-mcp": {
|
|
449
453
|
"type": "http",
|
|
450
454
|
"url": "https://notify.example.com/mcp",
|
|
451
455
|
"headers": {
|
|
@@ -464,12 +468,12 @@ Enter the project key from step 6 when prompted. Other MCP clients need the same
|
|
|
464
468
|
|
|
465
469
|
### 1. Create the resource
|
|
466
470
|
|
|
467
|
-
1. In Coolify, create a new resource from the public repository `https://github.com/gmoz22/telegram-
|
|
471
|
+
1. In Coolify, create a new resource from the public repository `https://github.com/gmoz22/telegram-notifications-mcp`.
|
|
468
472
|
2. Choose the **Docker Compose** build pack and `docker-compose.yml`.
|
|
469
473
|
3. In **Environment Variables**, set:
|
|
470
474
|
- `TELEGRAM_DEV_BOT_TOKEN` to your BotFather token.
|
|
471
475
|
- `TELEGRAM_MCP_ALLOWED_HOSTS` to your domain, for example `notify.example.com`.
|
|
472
|
-
4. Assign your domain to the `telegram-
|
|
476
|
+
4. Assign your domain to the `telegram-notifs-mcp` service on port 3000, for example `https://notify.example.com:3000`.
|
|
473
477
|
5. Deploy.
|
|
474
478
|
|
|
475
479
|
Coolify generates `TELEGRAM_MCP_ADMIN_KEY` automatically and shows it in the **Environment Variables** tab. It stays the same across redeploys. To use other token variable names, add them to the `environment` list in `docker-compose.yml`.
|
|
@@ -590,7 +594,7 @@ In the project's `.vscode/mcp.json`:
|
|
|
590
594
|
}
|
|
591
595
|
],
|
|
592
596
|
"servers": {
|
|
593
|
-
"telegram-
|
|
597
|
+
"telegram-notifs-mcp": {
|
|
594
598
|
"type": "http",
|
|
595
599
|
"url": "https://notify.example.com/mcp",
|
|
596
600
|
"headers": {
|
|
@@ -669,18 +673,20 @@ Other rules:
|
|
|
669
673
|
|
|
670
674
|
### Config file locations and overrides
|
|
671
675
|
|
|
672
|
-
| Platform | Default path
|
|
673
|
-
| ---------------- |
|
|
674
|
-
| macOS / Linux | `~/.config/telegram-
|
|
675
|
-
| Windows | `%LOCALAPPDATA%\telegram-
|
|
676
|
-
| Docker / Coolify | `/data/config.json` (persistent volume)
|
|
676
|
+
| Platform | Default path |
|
|
677
|
+
| ---------------- | ------------------------------------------------ |
|
|
678
|
+
| macOS / Linux | `~/.config/telegram-notifs-mcp/config.json` |
|
|
679
|
+
| Windows | `%LOCALAPPDATA%\telegram-notifs-mcp\config.json` |
|
|
680
|
+
| Docker / Coolify | `/data/config.json` (persistent volume) |
|
|
677
681
|
|
|
678
682
|
The first match wins:
|
|
679
683
|
|
|
680
684
|
1. `TELEGRAM_NOTIF_CONFIG`: the whole JSON document as an environment variable (read-only; `init` and `keygen` won't work).
|
|
681
685
|
2. `--config /path/to/file.json` on any command.
|
|
682
686
|
3. `TELEGRAM_NOTIF_CONFIG_FILE`: a file path.
|
|
683
|
-
4. The default path above
|
|
687
|
+
4. The default path above, or an existing legacy file.
|
|
688
|
+
|
|
689
|
+
Existing `config.json` and `targets.json` files in the former `telegram-notif-mcp` directory are reused in place. The former Windows `targets.json` location is `~/.config/telegram-notif-mcp/targets.json`. If more than one default or legacy file exists, select one with `--config` or `TELEGRAM_NOTIF_CONFIG_FILE`. Managed secrets remain beside their config.
|
|
684
690
|
|
|
685
691
|
### Environment variables
|
|
686
692
|
|
|
@@ -698,7 +704,7 @@ The first match wins:
|
|
|
698
704
|
|
|
699
705
|
### Commands
|
|
700
706
|
|
|
701
|
-
In Docker, prefix commands with `docker compose exec telegram-
|
|
707
|
+
In Docker, prefix commands with `docker compose exec telegram-notifs-mcp node dist/cli.js`. In the Coolify terminal, use `node dist/cli.js`.
|
|
702
708
|
|
|
703
709
|
| Command | What it does |
|
|
704
710
|
| --- | --- |
|
|
@@ -761,11 +767,44 @@ For sending:
|
|
|
761
767
|
| --- | --- | --- |
|
|
762
768
|
| macOS / Windows commands | Nothing; each command rereads the file. | Rerun in a shell with the new value. |
|
|
763
769
|
| macOS / Windows MCP | Restart the server from your MCP client. | Restart the MCP client's server. |
|
|
764
|
-
| Docker Compose | `docker compose restart telegram-
|
|
770
|
+
| Docker Compose | `docker compose restart telegram-notifs-mcp` | `docker compose up -d --force-recreate` |
|
|
765
771
|
| Coolify | Restart the service. | Redeploy. |
|
|
766
772
|
|
|
767
773
|
`keygen` changes also need a restart in hosted mode.
|
|
768
774
|
|
|
775
|
+
### Updating and pinning versions
|
|
776
|
+
|
|
777
|
+
Local installs come from [npm](https://www.npmjs.com/package/telegram-notifications-mcp):
|
|
778
|
+
|
|
779
|
+
```sh
|
|
780
|
+
npm install --global telegram-notifications-mcp@latest # update
|
|
781
|
+
npm install --global telegram-notifications-mcp@1 # stay on 1.x
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
To pin an exact release, append its version, for example `@1.0.1` if that release is available. Version `1.0.0` uses the former CLI command `telegram-notif-mcp`; use a release containing the rename for `telegram-notifs-mcp`. Restart your MCP servers after updating and change their configured command. Your `config.json` is not touched.
|
|
785
|
+
|
|
786
|
+
To skip the global install, an MCP entry can run the package through `npx` instead:
|
|
787
|
+
|
|
788
|
+
```json
|
|
789
|
+
{
|
|
790
|
+
"type": "stdio",
|
|
791
|
+
"command": "npx",
|
|
792
|
+
"args": [
|
|
793
|
+
"--yes",
|
|
794
|
+
"telegram-notifications-mcp@1",
|
|
795
|
+
"serve",
|
|
796
|
+
"--target",
|
|
797
|
+
"dev-status"
|
|
798
|
+
]
|
|
799
|
+
}
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
Run `npx --yes telegram-notifications-mcp@1 init` once to create the config. The first start downloads the package, so it is slower.
|
|
803
|
+
|
|
804
|
+
Docker and Coolify build from this repository, so redeploy to update. You can pin a Git tag once a corresponding release tag exists.
|
|
805
|
+
|
|
806
|
+
When upgrading an existing Compose deployment, preserve the original Compose project name and its `telegram-notif-data` volume. The service is now named `telegram-notifs-mcp`; remove the old service container during the upgrade, for example with `docker compose up --build -d --remove-orphans` using the same project name. That option also removes any other orphan containers in the project, so inspect them first. If the checkout directory changed, use `-p <old-project>` or `COMPOSE_PROJECT_NAME` to select the original project. Do not remove the volume. In Coolify, confirm the renamed service retains the existing `/data` volume and update its domain routing before deploying.
|
|
807
|
+
|
|
769
808
|
### Adding another destination later
|
|
770
809
|
|
|
771
810
|
1. Turn discovery back on (`"enabled": true`, or set `TELEGRAM_MCP_DISCOVERY_ENABLED=true`) and restart if hosted.
|
|
@@ -801,4 +840,4 @@ For sending:
|
|
|
801
840
|
| HTTP `401 Unauthorized` | Wrong or missing key, or a new key used before restarting. |
|
|
802
841
|
| Hosted requests rejected by host | Add your domain to `TELEGRAM_MCP_ALLOWED_HOSTS`. |
|
|
803
842
|
| `admin-key show` refuses to run | `TELEGRAM_MCP_ADMIN_KEY` is set; read it from your platform instead. |
|
|
804
|
-
| Windows MCP client can't start `telegram-
|
|
843
|
+
| Windows MCP client can't start `telegram-notifs-mcp` | Use `node` as the command and `<npm root -g>\telegram-notifications-mcp\dist\cli.js` as the first argument. |
|
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import { initializeConfig } from "./init.js";
|
|
|
8
8
|
import { readManagedKey, StateError } from "./state.js";
|
|
9
9
|
import { createDiscoveryServer, createNotificationServer } from "./server.js";
|
|
10
10
|
import { discoverTelegramChats, sendTelegramMessage, TelegramError, verifyTelegramTarget } from "./telegram.js";
|
|
11
|
-
const HELP = `telegram-
|
|
11
|
+
const HELP = `telegram-notifs-mcp - Telegram Bot notifications and operator discovery
|
|
12
12
|
|
|
13
13
|
Commands:
|
|
14
14
|
init [--hosted] [--config <file>] Create private setup configuration
|
|
@@ -83,7 +83,7 @@ async function runLocalServer(options) {
|
|
|
83
83
|
clientName: options.label ?? options.targetName,
|
|
84
84
|
prefix: options.label !== undefined,
|
|
85
85
|
}));
|
|
86
|
-
console.error(`telegram-
|
|
86
|
+
console.error(`telegram-notifs-mcp serving target "${options.targetName}" over stdio.`);
|
|
87
87
|
const close = () => {
|
|
88
88
|
void handle.close();
|
|
89
89
|
};
|
|
@@ -95,7 +95,7 @@ async function runLocalDiscoveryServer(config) {
|
|
|
95
95
|
throw new ConfigurationError("Discovery is disabled in the configuration.");
|
|
96
96
|
}
|
|
97
97
|
const handle = serveStdio(() => createDiscoveryServer({ config }));
|
|
98
|
-
console.error("telegram-
|
|
98
|
+
console.error("telegram-notifs-mcp serving operator discovery over stdio.");
|
|
99
99
|
const close = () => {
|
|
100
100
|
void handle.close();
|
|
101
101
|
};
|
|
@@ -106,7 +106,7 @@ async function runHttpServer(config) {
|
|
|
106
106
|
const app = createHttpApp(config);
|
|
107
107
|
const server = await listenHttp(app);
|
|
108
108
|
const { host, port, handler } = app.locals.telegramMcp;
|
|
109
|
-
console.error(`telegram-
|
|
109
|
+
console.error(`telegram-notifs-mcp listening on ${host}:${port} (HTTP MCP at /mcp).`);
|
|
110
110
|
const shutdown = async () => {
|
|
111
111
|
await new Promise((resolve) => server.close(() => resolve()));
|
|
112
112
|
await handler.close();
|
|
@@ -320,14 +320,14 @@ async function main(args) {
|
|
|
320
320
|
await runKeygen(rest);
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
throw new ConfigurationError(`Unknown command "${command}". Run "telegram-
|
|
323
|
+
throw new ConfigurationError(`Unknown command "${command}". Run "telegram-notifs-mcp help".`);
|
|
324
324
|
}
|
|
325
325
|
main(process.argv.slice(2)).catch((error) => {
|
|
326
326
|
if (error instanceof ConfigurationError || error instanceof TelegramError || error instanceof StateError) {
|
|
327
|
-
console.error(`telegram-
|
|
327
|
+
console.error(`telegram-notifs-mcp: ${error.message}`);
|
|
328
328
|
}
|
|
329
329
|
else {
|
|
330
|
-
console.error("telegram-
|
|
330
|
+
console.error("telegram-notifs-mcp: an unexpected error occurred; no success was confirmed.");
|
|
331
331
|
}
|
|
332
332
|
process.exitCode = 1;
|
|
333
333
|
});
|
package/dist/config.js
CHANGED
|
@@ -12,8 +12,8 @@ export class ConfigurationError extends Error {
|
|
|
12
12
|
}
|
|
13
13
|
export function defaultConfigPath(env = process.env, platform = process.platform, home = os.homedir()) {
|
|
14
14
|
return platform === "win32"
|
|
15
|
-
? path.win32.join(env.LOCALAPPDATA ?? path.win32.join(home, "AppData", "Local"), "telegram-
|
|
16
|
-
: path.join(home, ".config", "telegram-
|
|
15
|
+
? path.win32.join(env.LOCALAPPDATA ?? path.win32.join(home, "AppData", "Local"), "telegram-notifs-mcp", "config.json")
|
|
16
|
+
: path.join(home, ".config", "telegram-notifs-mcp", "config.json");
|
|
17
17
|
}
|
|
18
18
|
export const DEFAULT_CONFIG_PATH = defaultConfigPath();
|
|
19
19
|
async function fileExists(filename) {
|
|
@@ -35,16 +35,20 @@ export async function resolveConfigPath(options = {}) {
|
|
|
35
35
|
const platform = options.platform ?? process.platform;
|
|
36
36
|
const home = options.home ?? os.homedir();
|
|
37
37
|
const canonical = defaultConfigPath(env, platform, home);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
const pathApi = platform === "win32" ? path.win32 : path;
|
|
39
|
+
const oldConfig = pathApi.join(pathApi.dirname(pathApi.dirname(canonical)), "telegram-notif-mcp", "config.json");
|
|
40
|
+
const candidates = [
|
|
41
|
+
canonical,
|
|
42
|
+
oldConfig,
|
|
43
|
+
pathApi.join(home, ".config", "telegram-notif-mcp", "targets.json"),
|
|
44
|
+
pathApi.join(home, ".config", "telegram-notifs-mcp", "targets.json"),
|
|
45
|
+
];
|
|
46
|
+
const exists = await Promise.all(candidates.map(fileExists));
|
|
47
|
+
const found = candidates.filter((_candidate, index) => exists[index]);
|
|
48
|
+
if (found.length > 1) {
|
|
49
|
+
throw new ConfigurationError(`Multiple default configuration files exist (${found.join(", ")}); select one with --config.`);
|
|
50
|
+
}
|
|
51
|
+
return found[0] ?? canonical;
|
|
48
52
|
}
|
|
49
53
|
export function requireReadyTarget(config, name) {
|
|
50
54
|
if (!Object.hasOwn(config.targets, name)) {
|
package/dist/server.js
CHANGED
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "telegram-notifications-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Telegram notifications MCP server with local and hosted modes; opt-in administrator chat discovery.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/gmoz22/telegram-
|
|
8
|
+
"url": "https://github.com/gmoz22/telegram-notifications-mcp.git"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=20"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"telegram-
|
|
15
|
+
"telegram-notifs-mcp": "./dist/cli.js"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|