moab-notify 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +62 -37
  2. package/package.json +10 -4
package/README.md CHANGED
@@ -1,49 +1,74 @@
1
- # moab-notify (MCP)
1
+ # moab-notify MCP server for moab.tools notifications
2
2
 
3
- MCP-сервер для управления уведомлениями moab.tools (`apprise.moab.tools`) адресная книга
4
- получателей (Telegram + email) из LLM. Доступ закрыт Keycloak-ролью `apprise-admin` (device-flow).
3
+ Connect Claude Code (or any MCP client) to `apprise.moab.tools` and manage your notification
4
+ **address book** in natural language: list recipients, register or update a recipient's channels
5
+ (Telegram and/or email), remove a recipient, and send a test notification.
5
6
 
6
- ## Инструменты
7
+ The server is a thin local stdio client: it forwards each tool call to the `apprise.moab.tools`
8
+ admin API with your Bearer token. No secrets live in the package — access is protected by Keycloak
9
+ and requires the `apprise-admin` role. (Applications send notifications through the gateway's
10
+ in-cluster API; this MCP only manages who-gets-what.)
7
11
 
8
- | Tool | Назначение |
9
- |---|---|
10
- | `login` / `auth_status` / `auth_logout` | вход через device-flow (auth.moab.tools, клиент `apprise-cli`) |
11
- | `recipient_list` | показать адресную книгу |
12
- | `recipient_set` | создать/изменить получателя (email + каналы; Telegram-only = только chat_id) |
13
- | `recipient_remove` | удалить получателя |
14
- | `notify_test` | тестовое уведомление по каналам получателя |
15
-
16
- ## Запуск (в конфиге Claude)
17
-
18
- ```json
19
- {
20
- "mcpServers": {
21
- "moab-notify": { "command": "npx", "args": ["-y", "moab-notify"] }
22
- }
23
- }
12
+ ## Install
13
+
14
+ ```bash
15
+ claude mcp add notify --scope user -- npx -y moab-notify
16
+ ```
17
+
18
+ On **Windows**, wrap with `cmd /c` (npx is a `.cmd` shim):
19
+
20
+ ```bash
21
+ claude mcp add notify --scope user -- cmd /c npx -y moab-notify
24
22
  ```
25
23
 
26
- ## Конфиг (env, опционально)
24
+ (`notify` is just the local name — call it whatever you like. Requires Node.js 20+.)
25
+
26
+ ## Sign in
27
+
28
+ On your first operation the server asks you to sign in. Run the **`login`** tool — it returns a link
29
+ and a short code; open the link in a browser, confirm via `auth.moab.tools` (the same corporate
30
+ account as the portal `lk.moab.tools`), then repeat your request. You need the **`apprise-admin`**
31
+ role. The token refreshes automatically; you won't need to sign in again while the session is active.
27
32
 
28
- | Переменная | Default |
33
+ - `auth_status` who is signed in.
34
+ - `auth_logout` — sign out (removes stored tokens).
35
+
36
+ ## Tools
37
+
38
+ | Tool | Purpose |
29
39
  |---|---|
30
- | `NOTIFY_API_BASE` | `https://apprise.moab.tools` |
31
- | `KEYCLOAK_AUTHORITY` | `https://auth.moab.tools/realms/moab` |
32
- | `KEYCLOAK_CLIENT` | `apprise-cli` |
33
- | `MOAB_CONFIG_DIR` | `~/.moab` (токены `~/.moab/notify-mcp/credentials.json`, 0600) |
40
+ | `recipient_list` | list the address book (recipients and their channels) |
41
+ | `recipient_set` | create or update a recipient by email id; set channels (Telegram chat_id and/or email). Given fields are overwritten, omitted ones are kept |
42
+ | `recipient_remove` | remove a recipient from the address book |
43
+ | `notify_test` | send a test notification to a recipient over their channels |
34
44
 
35
- ## Разработка
45
+ ### Identity & channels
36
46
 
37
- ```bash
38
- npm install
39
- npm run build # tsc dist/
40
- npm test # vitest
41
- ```
47
+ A recipient is identified by **email** (the same person across all tools). Channels are an arbitrary
48
+ set: a Telegram `chat_id` and/or email delivery. **Telegram-only** = set just `telegram_chat_id`,
49
+ leave `email_enabled` off the email is only an identifier then, nothing is mailed to it.
50
+
51
+ ## Getting a Telegram chat_id
52
+
53
+ The recipient presses **Start** in `@MoabAlertsBot`. Their numeric id (their Telegram user id, which
54
+ equals the private-chat id) is the `chat_id`. A future `pending_starts` tool will read it
55
+ automatically; for now obtain it out-of-band and pass it to `recipient_set`.
42
56
 
43
- Релиз — публикация в npm (`npm publish`); `prepublishOnly` собирает `dist/`.
57
+ ## Examples
44
58
 
45
- ## Как получить chat_id
59
+ Ask in plain language, e.g.:
46
60
 
47
- Получатель жмёт **Start** у `@MoabAlertsBot`. Его numeric id (= chat_id для лички) — это его
48
- Telegram user id. Временно: вытаскивается через `getUpdates` бота (см. `cluster-infra/deploy/apprise`);
49
- позже tool `pending_starts` (перенос getUpdates в gateway, follow-up).
61
+ - "register ivan@moab.pro with telegram chat id 358024411"
62
+ - "show the address book"
63
+ - "also enable email for ivan@moab.pro"
64
+ - "send a test notification to ivan@moab.pro"
65
+ - "remove client@acme.com from notifications"
66
+
67
+ ## Configuration (env, optional)
68
+
69
+ | Variable | Default |
70
+ |---|---|
71
+ | `NOTIFY_API_BASE` | `https://apprise.moab.tools` |
72
+ | `KEYCLOAK_AUTHORITY` | `https://auth.moab.tools/realms/moab` |
73
+ | `KEYCLOAK_CLIENT` | `apprise-cli` |
74
+ | `MOAB_CONFIG_DIR` | `~/.moab` (tokens stored in `~/.moab/notify-mcp/credentials.json`) |
package/package.json CHANGED
@@ -1,11 +1,17 @@
1
1
  {
2
2
  "name": "moab-notify",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server for moab.tools notifications (apprise.moab.tools) — manage notification recipients (Telegram + email) from an LLM.",
5
5
  "type": "module",
6
- "bin": { "moab-notify": "dist/index.js" },
7
- "files": ["dist"],
8
- "engines": { "node": ">=20" },
6
+ "bin": {
7
+ "moab-notify": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "engines": {
13
+ "node": ">=20"
14
+ },
9
15
  "scripts": {
10
16
  "build": "tsc -p tsconfig.json",
11
17
  "test": "vitest run",