sipgate-mcp 0.5.1 → 0.6.0

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 (39) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +25 -21
  3. package/SKILL.md +11 -6
  4. package/dist/backend/access-controlled-backend.d.ts +4 -0
  5. package/dist/backend/access-controlled-backend.d.ts.map +1 -1
  6. package/dist/backend/access-controlled-backend.js +64 -40
  7. package/dist/backend/access-controlled-backend.js.map +1 -1
  8. package/dist/backend/pagination.d.ts +16 -0
  9. package/dist/backend/pagination.d.ts.map +1 -0
  10. package/dist/backend/pagination.js +52 -0
  11. package/dist/backend/pagination.js.map +1 -0
  12. package/dist/backend/sipgate-backend.d.ts +1 -0
  13. package/dist/backend/sipgate-backend.d.ts.map +1 -1
  14. package/dist/backend/sipgate-backend.js +34 -44
  15. package/dist/backend/sipgate-backend.js.map +1 -1
  16. package/dist/backend/sipgate-client.d.ts +5 -1
  17. package/dist/backend/sipgate-client.d.ts.map +1 -1
  18. package/dist/backend/sipgate-client.js +197 -30
  19. package/dist/backend/sipgate-client.js.map +1 -1
  20. package/dist/backend/telephony-backend.d.ts +1 -0
  21. package/dist/backend/telephony-backend.d.ts.map +1 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +2 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/request-journal.d.ts +14 -0
  26. package/dist/request-journal.d.ts.map +1 -0
  27. package/dist/request-journal.js +7 -0
  28. package/dist/request-journal.js.map +1 -0
  29. package/dist/server.d.ts +1 -1
  30. package/dist/server.d.ts.map +1 -1
  31. package/dist/server.js +40 -6
  32. package/dist/server.js.map +1 -1
  33. package/dist/tools/definitions.d.ts +1 -1
  34. package/dist/tools/definitions.d.ts.map +1 -1
  35. package/dist/tools/definitions.js +125 -114
  36. package/dist/tools/definitions.js.map +1 -1
  37. package/dist/version.d.ts +1 -1
  38. package/dist/version.js +1 -1
  39. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,91 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0 - 2026-09-25
4
+
5
+ Breaking: 18 tools are renamed so that every tool name fits the 28-character
6
+ limit sipgate's AI agent sona applies to connected MCP tools. Backend method
7
+ names and behaviour are unchanged; update client allowlists and saved prompts.
8
+
9
+ | Before (0.5.x) | Since 0.6.0 |
10
+ | --- | --- |
11
+ | `set_external_device_target_number` | `set_external_device_target` |
12
+ | `set_external_device_incoming_call_display` | `set_external_device_display` |
13
+ | `get_device_tariff_announcement` | `get_tariff_announcement` |
14
+ | `set_device_tariff_announcement` | `set_tariff_announcement` |
15
+ | `get_device_single_row_display` | `get_single_row_display` |
16
+ | `set_device_single_row_display` | `set_single_row_display` |
17
+ | `get_phoneline_block_anonymous` | `get_anonymous_call_blocking` |
18
+ | `set_phoneline_block_anonymous` | `set_anonymous_call_blocking` |
19
+ | `create_autorecording_greeting` | `create_recording_greeting` |
20
+ | `delete_autorecording_greeting` | `delete_recording_greeting` |
21
+ | `create_call_email_notification` | `create_call_email_alert` |
22
+ | `create_call_sms_notification` | `create_call_sms_alert` |
23
+ | `create_fax_email_notification` | `create_fax_email_alert` |
24
+ | `create_fax_sms_notification` | `create_fax_sms_alert` |
25
+ | `create_fax_report_notification` | `create_fax_report_alert` |
26
+ | `create_sms_email_notification` | `create_sms_email_alert` |
27
+ | `create_voicemail_email_notification` | `create_voicemail_email_alert` |
28
+ | `create_voicemail_sms_notification` | `create_voicemail_sms_alert` |
29
+
30
+ - Make `user_id` optional in user scope. It defaults to the authenticated user
31
+ before anything is delegated, so an agent no longer has to look up its own ID
32
+ first; 49 tools, including `send_sms`, previously required it. An explicit
33
+ foreign ID is still rejected, and account scope still requires the ID.
34
+ - Add `list_phonelines`. Nine tools need a `phoneline_id`, and the backend
35
+ already implemented the listing, but no tool exposed it.
36
+ - Report a write that sipgate accepted as applied when a later step of the same
37
+ tool call fails. Reading the result back after a successful `send_sms`,
38
+ Click2Dial, call control, or any other write used to surface as a plain,
39
+ retryable error, which invited a second SMS or call. The result now says
40
+ `applied: true`, lists the accepted requests with any session or call ID, and
41
+ says not to repeat the action. A later failed write names the requests that
42
+ were already accepted.
43
+ - Advertise fields with defaults as optional in the tool schemas. `offset` and
44
+ `limit` of `list_numbers`, `call_history`, `export_history`, `list_contacts`,
45
+ and `get_contacts_vcard` were listed as required.
46
+ - Bound every request: each attempt has a 30-second deadline that covers the
47
+ response headers and the body. A write that times out, loses the connection,
48
+ or gets a server error is reported as possibly applied, so an agent checks
49
+ the state instead of sending it again. A write whose confirmation body is not
50
+ JSON is treated as accepted.
51
+ - Retry a read once when sipgate answers HTTP 429 or 503, honouring
52
+ `Retry-After` (seconds or HTTP date) up to 5 seconds. Longer waits are
53
+ reported instead of blocking the tool call, and writes are never retried.
54
+ - Stop passing sipgate's error text into tool results. Only denial sentences
55
+ sipgate is known to send are shown, quoted from a built-in list; any other
56
+ body is dropped. Before, any short plain-text body passed, including one that
57
+ echoed the raw PAT or read like an instruction. `Retry-After` is parsed and
58
+ no longer echoed, and every error message is scrubbed of the configured
59
+ PAT-ID, PAT, and Basic credential.
60
+ - Read paginated results through one bounded helper. It follows the
61
+ `nextOffset` of filtered history pages, so bulk history deletion on accounts
62
+ without history extensions no longer stops after the first page and leaves
63
+ owned entries behind. Offsets advance by what sipgate returned, a
64
+ continuation that does not move forward is an error, and a misbehaving
65
+ endpoint stops after 100 pages. `call_history` no longer invents a total when
66
+ sipgate omits it, and reports a next offset after a full page.
67
+ - Bound the contact cursor used by bulk contact deletion and CSV import, and
68
+ refuse a cursor that repeats instead of truncating the snapshot silently.
69
+ - Require `limit >= 1` for `export_history`, matching `call_history`.
70
+ - Describe where `faxline_id` and `phoneline_id` values come from, and link the
71
+ alert tools to `list_notifications` and `delete_notification`.
72
+ - Correct the README's error-handling claims, list npm first in the setup
73
+ skill, and sync `package-lock.json`, which still said 0.5.1.
74
+ - Add HTTP-level tests for `account_info`, `list_users`, `list_numbers`,
75
+ `list_devices`, `call_history`, and account-scope Click2Dial, plus tests that
76
+ keep every tool name unique and at most 28 characters long.
77
+
78
+ ## 0.5.2 - 2026-08-30
79
+
80
+ - Never send device IDs as history connection filters. sipgate answers HTTP 403
81
+ for them and accepts only real extensions, so `call_history` failed on every
82
+ account whose user owns devices but no phoneline. Accounts with no filterable
83
+ extension now read the history unfiltered and keep the entries that match the
84
+ user's own numbers.
85
+ - Pass through sipgate's own plain-text denial reason. The phoneline endpoints
86
+ answer "This endpoint requires a sipgate Classic PBX Account", which is worth
87
+ more than any guess about token scopes. Structured bodies are still withheld.
88
+
3
89
  ## 0.5.1 - 2026-08-30
4
90
 
5
91
  - List user numbers from sipgate's own user-number endpoint instead of matching
package/README.md CHANGED
@@ -109,7 +109,7 @@ addition to sipgate's own user role and PAT scopes:
109
109
 
110
110
  | Value | Behavior |
111
111
  | --- | --- |
112
- | `user` (default) | Resolves the authenticated user through `/authorization/userinfo`; returns only that user and their assigned numbers, notifications, faxlines, phonelines, voicemails, greetings, and attached devices; forces user-specific device, routing, restriction, and settings reads; constrains history reads, exports, and mutations to owned connections/entries; and validates every write target against owned numbers, phonelines, nested voicemail/forwarding/greeting resources, devices, faxlines, notifications, or emergency addresses associated with an owned device/number. Account-wide contact, blacklist, porting-cancellation, and sipgate.io writes require `confirm_account_wide: true`; their reads are allowed and clearly labelled account-wide. |
112
+ | `user` (default) | Resolves the authenticated user through `/authorization/userinfo`; returns only that user and their assigned numbers, notifications, faxlines, phonelines, voicemails, greetings, and attached devices; forces user-specific device, routing, restriction, and settings reads; constrains history reads, exports, and mutations to owned connections/entries; and validates every write target against owned numbers, phonelines, nested voicemail/forwarding/greeting resources, devices, faxlines, notifications, or emergency addresses associated with an owned device/number. Account-wide contact, blacklist, porting-cancellation, and sipgate.io writes require `confirm_account_wide: true`; their reads are allowed and clearly labelled account-wide. Every `user_id` parameter is optional and defaults to the authenticated user; another user's ID is rejected. |
113
113
  | `account` | Enables account-wide reads and writes. Startup fails unless `/users/{authenticatedUserId}` reports `admin: true`. Requires `users:read` for the administrator check. |
114
114
 
115
115
  Token scopes are permission ceilings, not role elevation. For example,
@@ -141,8 +141,8 @@ listed specific and parent scopes offered by the PAT UI when in doubt.
141
141
  | `get_device` | Read | Ownership `GET /{self}/devices`, then `GET /devices/{deviceId}` | `devices:read` |
142
142
  | `get_device_caller_id` | Read | Device ownership read, then `GET /devices/{deviceId}/callerid` | `devices:read`, `devices:callerid:read` |
143
143
  | `get_device_local_prefix` | Read | Device ownership read, then `GET /devices/{deviceId}/localprefix` | `devices:read`, `devices:localprefix:read` |
144
- | `get_device_tariff_announcement` | Read | Device ownership read, then `GET /devices/{deviceId}/tariffannouncement` | `devices:read`, `devices:tariffannouncement:read` |
145
- | `get_device_single_row_display` | Read | Device ownership read, then `GET /devices/{deviceId}/singlerowdisplay` | `devices:read`, `devices:singlerowdisplay:read` |
144
+ | `get_tariff_announcement` | Read | Device ownership read, then `GET /devices/{deviceId}/tariffannouncement` | `devices:read`, `devices:tariffannouncement:read` |
145
+ | `get_single_row_display` | Read | Device ownership read, then `GET /devices/{deviceId}/singlerowdisplay` | `devices:read`, `devices:singlerowdisplay:read` |
146
146
  | `get_device_contingents` | Read | Device/user ownership reads, then `GET /{userId}/devices/{deviceId}/contingents` | `devices:read` |
147
147
  | `list_user_numbers` | Read | `GET /{userId}/numbers`; this direct endpoint never uses phonelines | `numbers:read` |
148
148
  | `validate_quick_dial` | Read | `GET /numbers/quickdial/validation/{quickDialNumber}` | `numbers:read` |
@@ -155,8 +155,9 @@ listed specific and parent scopes offered by the PAT UI when in doubt.
155
155
  | `list_notifications` | Read | `GET /{userId}/notifications` | `notifications:read` |
156
156
  | `list_faxlines` | Read | `GET /{userId}/faxlines` | `faxlines:read` |
157
157
  | `list_faxline_numbers` | Read | User: faxline ownership read, then `GET /{userId}/faxlines/{faxlineId}/numbers`; account: direct `GET` | `faxlines:read`, `faxlines:numbers:read` |
158
+ | `list_phonelines` | Read | `GET /{userId}/phonelines`; an account without a phoneline layer returns an empty list with `phonelinesAvailable: false` | `phonelines:read` |
158
159
  | `get_phoneline` | Read | Owned-phoneline lookup, then `GET /{userId}/phonelines/{phonelineId}` | `phonelines:read` |
159
- | `get_phoneline_block_anonymous` | Read | Owned-phoneline lookup, then `GET /{userId}/phonelines/{phonelineId}/blockanonymous` | `phonelines:read`, `phonelines:blockanonymous:read` |
160
+ | `get_anonymous_call_blocking` | Read | Owned-phoneline lookup, then `GET /{userId}/phonelines/{phonelineId}/blockanonymous` | `phonelines:read`, `phonelines:blockanonymous:read` |
160
161
  | `list_phoneline_devices` | Read | Owned-phoneline/device filtering, then `GET /{userId}/phonelines/{phonelineId}/devices` | `phonelines:read`, `phonelines:devices:read`; user filtering also needs `devices:read` |
161
162
  | `list_parallel_forwardings` | Read | Owned-phoneline lookup, then `GET /{userId}/phonelines/{phonelineId}/parallelforwardings` | `phonelines:read`, `phonelines:parallelforwardings:read` |
162
163
  | `list_phoneline_voicemails` | Read | Owned-phoneline lookup, then `GET /{userId}/phonelines/{phonelineId}/voicemails` | `phonelines:read`, `phonelines:voicemails:read` |
@@ -169,7 +170,7 @@ listed specific and parent scopes offered by the PAT UI when in doubt.
169
170
  | `create_phoneline` | Write/action | `POST /{userId}/phonelines`; 403/404 becomes a clean unavailable result | `phonelines:write` |
170
171
  | `update_phoneline_alias` | Write | Owned-phoneline before/after reads and `PUT /{userId}/phonelines/{phonelineId}` | `phonelines:read`, `phonelines:write` |
171
172
  | `delete_phoneline` | Write | Owned-phoneline before-state read and `DELETE /{userId}/phonelines/{phonelineId}` | `phonelines:read`, `phonelines:write` |
172
- | `set_phoneline_block_anonymous` | Write | Owned-phoneline setting reads and `PUT /{userId}/phonelines/{phonelineId}/blockanonymous` | `phonelines:read`, `phonelines:blockanonymous:read`, `phonelines:blockanonymous:write` |
173
+ | `set_anonymous_call_blocking` | Write | Owned-phoneline setting reads and `PUT /{userId}/phonelines/{phonelineId}/blockanonymous` | `phonelines:read`, `phonelines:blockanonymous:read`, `phonelines:blockanonymous:write` |
173
174
  | `attach_device_to_phoneline` | Write/action | Owned phoneline/device reads, pre/post assignment reads, and `POST /{userId}/phonelines/{phonelineId}/devices` | `phonelines:read`, `phonelines:devices:read`, `phonelines:devices:write`, `devices:read` |
174
175
  | `detach_device_from_phoneline` | Write | Owned phoneline/device reads, pre/post assignment reads, and `DELETE /{userId}/phonelines/{phonelineId}/devices/{deviceId}` | `phonelines:read`, `phonelines:devices:read`, `phonelines:devices:write`, `devices:read` |
175
176
  | `create_parallel_forwarding` | Write/action | Owned-phoneline check, pre/post forwarding reads, and `POST /{userId}/phonelines/{phonelineId}/parallelforwardings` | `phonelines:read`, `phonelines:write`, `phonelines:parallelforwardings:read`, `phonelines:parallelforwardings:write` |
@@ -182,8 +183,8 @@ listed specific and parent scopes offered by the PAT UI when in doubt.
182
183
  | `set_voicemail_transcription` | Write | Verify owned voicemail, pre/post voicemail reads, and `PUT /{userId}/phonelines/{phonelineId}/voicemails/{voicemailId}/transcriptions` | `phonelines:read`, `phonelines:write`, `phonelines:voicemails:read`, `phonelines:voicemails:write` |
183
184
  | `play_voicemail` | Write/action | User: verify owned device and history/data entry; then `POST /sessions/voicemail/play` | `sessions:write`, `sessions:calls:write`; user ownership also needs `devices:read`, `history:read` and owned-connection scopes |
184
185
  | `record_voicemail_greeting` | Write/action | User: verify owned device and target voicemail; then `POST /sessions/voicemail/recording` | `sessions:write`, `sessions:calls:write`; user ownership also needs `devices:read`, `phonelines:read`, `phonelines:voicemails:read` |
185
- | `create_autorecording_greeting` | Write/action | Account scope only: pre/post `GET /autorecordings/greetings`, `POST /autorecordings/greetings` | `autorecording:greeting:read`, `autorecording:greeting:write`; sipgate requires administrator privileges and activated call recording |
186
- | `delete_autorecording_greeting` | Write | Account scope only: before-state read, then `DELETE /autorecordings/greetings/{greetingId}` | `autorecording:greeting:read`, `autorecording:greeting:write`; sipgate requires administrator privileges and activated call recording |
186
+ | `create_recording_greeting` | Write/action | Account scope only: pre/post `GET /autorecordings/greetings`, `POST /autorecordings/greetings` | `autorecording:greeting:read`, `autorecording:greeting:write`; sipgate requires administrator privileges and activated call recording |
187
+ | `delete_recording_greeting` | Write | Account scope only: before-state read, then `DELETE /autorecordings/greetings/{greetingId}` | `autorecording:greeting:read`, `autorecording:greeting:write`; sipgate requires administrator privileges and activated call recording |
187
188
  | `set_autorecording_settings` | Write | Owned phoneline/faxline extension lookup, pre/post setting reads, and `PUT /autorecordings/{extension}/settings` | `devices:read`; ownership also needs `phonelines:read`, `faxlines:read` |
188
189
  | `create_faxline` | Write/action | `POST /{userId}/faxlines` | `faxlines:write` |
189
190
  | `update_faxline_alias` | Write | Owned-faxline pre/post list reads and `PUT /{userId}/faxlines/{faxlineId}` | `faxlines:read`, `faxlines:write` |
@@ -231,10 +232,10 @@ listed specific and parent scopes offered by the PAT UI when in doubt.
231
232
  | `set_device_alias` | Write | Device ownership read; pre/post device reads and `PUT /devices/{deviceId}/alias` | `devices:read`, `devices:write` |
232
233
  | `set_device_caller_id` | Write | Device and caller-number ownership reads; pre/post caller-ID reads and `PUT /devices/{deviceId}/callerid` | `devices:read`, `devices:write`, `devices:callerid:read`, `devices:callerid:write`, plus owned-number read scopes |
233
234
  | `set_device_local_prefix` | Write | Device ownership read; pre/post setting reads and `PUT /devices/{deviceId}/localprefix` | `devices:read`, `devices:write`, `devices:localprefix:read`, `devices:localprefix:write` |
234
- | `set_device_tariff_announcement` | Write | Device ownership read; pre/post setting reads and `PUT /devices/{deviceId}/tariffannouncement` | `devices:read`, `devices:write`, `devices:tariffannouncement:read`, `devices:tariffannouncement:write` |
235
- | `set_device_single_row_display` | Write | Device ownership read; pre/post setting reads and `PUT /devices/{deviceId}/singlerowdisplay` | `devices:read`, `devices:write`, `devices:singlerowdisplay:read`, `devices:singlerowdisplay:write` |
236
- | `set_external_device_target_number` | Write | Device ownership read; pre/post device reads and `PUT /devices/{deviceId}/external/targetnumber` | `devices:read`, `devices:write` |
237
- | `set_external_device_incoming_call_display` | Write | Device ownership read; pre/post device reads and `PUT /devices/{deviceId}/external/incomingcalldisplay` | `devices:read`, `devices:write` |
235
+ | `set_tariff_announcement` | Write | Device ownership read; pre/post setting reads and `PUT /devices/{deviceId}/tariffannouncement` | `devices:read`, `devices:write`, `devices:tariffannouncement:read`, `devices:tariffannouncement:write` |
236
+ | `set_single_row_display` | Write | Device ownership read; pre/post setting reads and `PUT /devices/{deviceId}/singlerowdisplay` | `devices:read`, `devices:write`, `devices:singlerowdisplay:read`, `devices:singlerowdisplay:write` |
237
+ | `set_external_device_target` | Write | Device ownership read; pre/post device reads and `PUT /devices/{deviceId}/external/targetnumber` | `devices:read`, `devices:write` |
238
+ | `set_external_device_display` | Write | Device ownership read; pre/post device reads and `PUT /devices/{deviceId}/external/incomingcalldisplay` | `devices:read`, `devices:write` |
238
239
  | `change_device_password` | Write/action | Device ownership/before-state reads, then `POST /devices/{deviceId}/credentials/password`; the response is redacted | `devices:read`, `devices:write` |
239
240
  | `create_register_device` | Write/action | `POST /{userId}/devices/register` | `devices:write` |
240
241
  | `create_mobile_device` | Write/action | `POST /{userId}/devices/mobile` | `devices:write` |
@@ -245,14 +246,14 @@ listed specific and parent scopes offered by the PAT UI when in doubt.
245
246
  | `update_address` | Write | Address ownership and pre/post address reads, then `PUT /addresses/{addressId}` | `addresses:read`, `addresses:write`, plus user ownership read scopes |
246
247
  | `send_sms` | Write/action | `GET /{userId}/sms`, pre/post `GET /history`, `POST /sessions/sms` | `sms:read`, `history:read`, `sessions:write`, `sessions:sms:write` |
247
248
  | `initiate_call` | Write/action | User: device/number ownership reads, then `POST /sessions/calls`; account: pre/post `GET /calls` plus `POST` | `sessions:write`, `sessions:calls:write`; user also needs `devices:read`, `phonelines:read`, `phonelines:numbers:read`; account needs `rtcm:read` |
248
- | `create_call_email_notification` | Write/action | User: endpoint ownership reads; all modes: pre/post `GET /{userId}/notifications`, `POST /{userId}/notifications/call/email` | `notifications:read`, `notifications:write`; user also needs `devices:read` or `phonelines:read` |
249
- | `create_call_sms_notification` | Write/action | User: endpoint ownership reads; all modes: pre/post notification reads, `POST /{userId}/notifications/call/sms` | `notifications:read`, `notifications:write`; user also needs `devices:read` or `phonelines:read` |
250
- | `create_fax_email_notification` | Write/action | User: faxline ownership read; all modes: pre/post notification reads, `POST /{userId}/notifications/fax/email` | `notifications:read`, `notifications:write`; user also needs `faxlines:read` |
251
- | `create_fax_sms_notification` | Write/action | User: faxline ownership read; all modes: pre/post notification reads, `POST /{userId}/notifications/fax/sms` | `notifications:read`, `notifications:write`; user also needs `faxlines:read` |
252
- | `create_fax_report_notification` | Write/action | User: faxline ownership read; all modes: pre/post notification reads, `POST /{userId}/notifications/fax/report` | `notifications:read`, `notifications:write`; user also needs `faxlines:read` |
253
- | `create_sms_email_notification` | Write/action | Pre/post notification reads, `POST /{userId}/notifications/sms/email` | `notifications:read`, `notifications:write` |
254
- | `create_voicemail_email_notification` | Write/action | Pre/post notification reads, `POST /{userId}/notifications/voicemail/email` | `notifications:read`, `notifications:write` |
255
- | `create_voicemail_sms_notification` | Write/action | Pre/post notification reads, `POST /{userId}/notifications/voicemail/sms` | `notifications:read`, `notifications:write` |
249
+ | `create_call_email_alert` | Write/action | User: endpoint ownership reads; all modes: pre/post `GET /{userId}/notifications`, `POST /{userId}/notifications/call/email` | `notifications:read`, `notifications:write`; user also needs `devices:read` or `phonelines:read` |
250
+ | `create_call_sms_alert` | Write/action | User: endpoint ownership reads; all modes: pre/post notification reads, `POST /{userId}/notifications/call/sms` | `notifications:read`, `notifications:write`; user also needs `devices:read` or `phonelines:read` |
251
+ | `create_fax_email_alert` | Write/action | User: faxline ownership read; all modes: pre/post notification reads, `POST /{userId}/notifications/fax/email` | `notifications:read`, `notifications:write`; user also needs `faxlines:read` |
252
+ | `create_fax_sms_alert` | Write/action | User: faxline ownership read; all modes: pre/post notification reads, `POST /{userId}/notifications/fax/sms` | `notifications:read`, `notifications:write`; user also needs `faxlines:read` |
253
+ | `create_fax_report_alert` | Write/action | User: faxline ownership read; all modes: pre/post notification reads, `POST /{userId}/notifications/fax/report` | `notifications:read`, `notifications:write`; user also needs `faxlines:read` |
254
+ | `create_sms_email_alert` | Write/action | Pre/post notification reads, `POST /{userId}/notifications/sms/email` | `notifications:read`, `notifications:write` |
255
+ | `create_voicemail_email_alert` | Write/action | Pre/post notification reads, `POST /{userId}/notifications/voicemail/email` | `notifications:read`, `notifications:write` |
256
+ | `create_voicemail_sms_alert` | Write/action | Pre/post notification reads, `POST /{userId}/notifications/voicemail/sms` | `notifications:read`, `notifications:write` |
256
257
  | `delete_notification` | Write | User: verify the nested ID in `GET /{userId}/notifications`; all modes: before/after notification reads and `DELETE /{userId}/notifications/{notificationId}` | `notifications:read`, `notifications:write` |
257
258
  | `hangup_call` | Write | User: participant ownership read; all modes: before/after `GET /calls`, `DELETE /calls/{callId}` | `rtcm:read`, `rtcm:write`; user also needs owned-device/number read scopes |
258
259
  | `set_call_hold` | Write | User: participant ownership read; before/after `GET /calls`, `PUT /calls/{callId}/hold` | `rtcm:read`, `rtcm:write`; user also needs owned-device/number read scopes |
@@ -294,7 +295,7 @@ Every write tool returns a JSON object with `before` and `after`. Where a resour
294
295
 
295
296
  ## Read-only mode
296
297
 
297
- Set `SIPGATE_MCP_READONLY=1` to register only the 47 read tools. Write tools are absent from `tools/list`, rather than merely failing when called.
298
+ Set `SIPGATE_MCP_READONLY=1` to register only the 48 read tools. Write tools are absent from `tools/list`, rather than merely failing when called.
298
299
 
299
300
  ```bash
300
301
  export SIPGATE_MCP_READONLY=1
@@ -408,7 +409,10 @@ MCP stdio server
408
409
  confirmation where documented above.
409
410
  - Account scope fails startup unless the authenticated sipgate user reports `admin: true`.
410
411
  - The Basic Auth header exists only in memory and is sent only to the fixed sipgate API base URL.
411
- - API error bodies are discarded. User-facing errors never include request headers, response bodies, or credentials.
412
+ - API error bodies are not passed on. The single exception is a denial sentence that sipgate is known to send, such as "This endpoint requires a sipgate Classic PBX Account": it is recognised by exact match and quoted from a built-in list, never from the response. `Retry-After` is parsed and never echoed. Every error message has the configured PAT-ID, PAT, and Basic credential replaced by `[REDACTED]`, and request headers never appear in errors.
413
+ - Every request attempt has a 30-second deadline covering headers and body (a retried read can take about 65 seconds in total). A read that sipgate throttles (HTTP 429/503) is retried once after at most 5 seconds; writes are never retried automatically, and a write that times out or loses the connection is reported as possibly applied so the caller checks the state before trying again.
414
+ - Paginated reads follow sipgate's offsets up to 100 pages of 1000 entries (contacts: 100 cursor pages) and then stop with an error instead of looping. A continuation that does not move forward is an error, not a silent end.
415
+ - When a tool fails after sipgate has already accepted one of its writes, the result says `applied: true`, lists the accepted requests with any session or call ID, and tells the agent not to repeat the action. Only a failure before any write is reported as a plain error.
412
416
  - Potentially sensitive response properties such as `credentials`, `password`, `token`, and `secret` are redacted before tool output.
413
417
  - The server writes no application logs to stdout; stdout is reserved for MCP stdio frames.
414
418
  - `.env*`, fetched research data, build output, and package tarballs are ignored by Git.
package/SKILL.md CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sipgate-mcp
3
3
  description: Install and securely configure the sipgate MCP server when a user asks to set up or connect a sipgate account to Codex or Claude. Do not use for ordinary sipgate product questions.
4
4
  metadata:
5
- version: "0.5.1"
5
+ version: "0.6.0"
6
6
  ---
7
7
 
8
8
  # Set up sipgate MCP
@@ -10,19 +10,19 @@ metadata:
10
10
  Install the matching CLI version with one available package manager:
11
11
 
12
12
  ```bash
13
- vp install -g sipgate-mcp@0.5.1
13
+ npm install -g sipgate-mcp@0.6.0
14
14
  ```
15
15
 
16
16
  ```bash
17
- npm install -g sipgate-mcp@0.5.1
17
+ pnpm add -g sipgate-mcp@0.6.0
18
18
  ```
19
19
 
20
20
  ```bash
21
- pnpm add -g sipgate-mcp@0.5.1
21
+ vp install -g sipgate-mcp@0.6.0
22
22
  ```
23
23
 
24
24
  Run only one install command. Confirm that `sipgate-mcp --version` reports
25
- `0.5.1` before continuing.
25
+ `0.6.0` before continuing.
26
26
 
27
27
  ## Security boundary
28
28
 
@@ -86,7 +86,7 @@ user-scoped stdio server. Its interactive prompt asks whether write tools should
86
86
  be enabled; do not answer that choice on the user's behalf. The client starts
87
87
  and stops that process, so do not launch `sipgate-mcp` as a daemon.
88
88
 
89
- Version 0.5.1 adds user-scoped device, quick-dial, user-number, emergency-
89
+ The server covers user-scoped device, quick-dial, user-number, emergency-
90
90
  address, notification, live-call-control, phoneline, voicemail/greeting,
91
91
  automated-recording, fax, contact, blacklist, restriction, history-management,
92
92
  porting, balance, and sipgate.io self-service. It supports accounts without
@@ -103,6 +103,11 @@ sessions, recording, and other writes may incur charges or carry legal
103
103
  consequences, and address changes can deactivate associated numbers depending
104
104
  on country.
105
105
 
106
+ When upgrading from 0.5.x: version 0.6.0 renamed 18 tools so that every name
107
+ fits sipgate's 28-character limit for connected MCP tools (see the CHANGELOG
108
+ table). Existing registrations keep working, but client permission allowlists
109
+ or saved prompts that name an old tool must be updated.
110
+
106
111
  When credentials already exist in Keychain, setup reuses them without another
107
112
  prompt. Use `--replace-credentials` only when the user explicitly wants to
108
113
  rotate or replace the stored PAT-ID and PAT.
@@ -57,6 +57,7 @@ export declare class AccessControlledBackend implements TelephonyBackend {
57
57
  listFaxlines(userId: string): Promise<JsonValue>;
58
58
  listFaxlineNumbers(userId: string, faxlineId: string): Promise<JsonValue>;
59
59
  getFaxlineCallerId(userId: string, faxlineId: string): Promise<JsonValue>;
60
+ listSmsExtensions(userId: string): Promise<JsonValue>;
60
61
  getHistoryEntry(entryId: string): Promise<JsonValue>;
61
62
  getSettings(userId?: string): Promise<JsonValue>;
62
63
  getBalance(): Promise<JsonValue>;
@@ -179,6 +180,9 @@ export declare class AccessControlledBackend implements TelephonyBackend {
179
180
  private assertOwnedFaxline;
180
181
  private assertOwnedCall;
181
182
  private isOwnedCall;
183
+ private isOwnedHistoryEntry;
184
+ private ownedSmsExtensionIds;
185
+ private ownedHistoryConnectionIds;
182
186
  private ownedPhonelineIds;
183
187
  private ownedPhonelineState;
184
188
  private assertOwnedPhoneline;
@@ -1 +1 @@
1
- {"version":3,"file":"access-controlled-backend.d.ts","sourceRoot":"","sources":["../../src/backend/access-controlled-backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,cAAc,EACd,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,EAEZ,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,+BAA+B,EAC/B,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,6BAA6B,EAC9B,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,YAAmB,OAAO,EAAE,MAAM,EAGjC;CACF;AA6FD;;;;GAIG;AACH,qBAAa,uBAAwB,YAAW,gBAAgB;IAE5D,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAH1B,YACmB,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,wBAAwB,EAChD;IAEG,oBAAoB,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAE/D;IAEY,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAGvD;IAEY,cAAc,IAAI,OAAO,CAAC,SAAS,CAAC,CAQhD;IAEY,SAAS,IAAI,OAAO,CA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AAE,WAAW,GACjB,OAAO,CAAC,uBAAuB,CAAC,CAWlC"}
1
+ {"version":3,"file":"access-controlled-backend.d.ts","sourceRoot":"","sources":["../../src/backend/access-controlled-backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,cAAc,EACd,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,EAEZ,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,+BAA+B,EAC/B,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,6BAA6B,EAC9B,MAAM,wBAAwB,CAAC;AAGhC,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,YAAmB,OAAO,EAAE,MAAM,EAGjC;CACF;AA6FD;;;;GAIG;AACH,qBAAa,uBAAwB,YAAW,gBAAgB;IAE5D,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAH1B,YACmB,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,wBAAwB,EAChD;IAEG,oBAAoB,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAE/D;IAEY,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAGvD;IAEY,cAAc,IAAI,OAAO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sB;YAWtB,kBAAkB;YAWlB,cAAc;YAId,kBAAkB;IA8ChC,OAAO,CAAC,aAAa;IAOrB;;;OAGG;YACW,6BAA6B;YAa7B,YAAY;CAsB3B;AAED,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,uBAAuB,CAAC,CAWlC"}
@@ -1,3 +1,4 @@
1
+ import { collectPages } from "./pagination.js";
1
2
  export class AccessPolicyError extends Error {
2
3
  constructor(message) {
3
4
  super(message);
@@ -338,7 +339,9 @@ export class AccessControlledBackend {
338
339
  async getCallHistory(query) {
339
340
  if (this.scope === "account")
340
341
  return this.delegate.getCallHistory(query);
341
- const connectionIds = await this.ownedConnectionIds();
342
+ // sipgate rejects device IDs as history connection filters with HTTP 403.
343
+ // Only real extensions (phonelines, faxlines, SMS) are accepted there.
344
+ const connectionIds = await this.ownedHistoryConnectionIds();
342
345
  const requested = query.connectionIds;
343
346
  if (requested) {
344
347
  for (const connectionId of requested) {
@@ -346,18 +349,22 @@ export class AccessControlledBackend {
346
349
  }
347
350
  }
348
351
  const scopedConnectionIds = requested ?? [...connectionIds];
349
- if (scopedConnectionIds.length === 0) {
350
- return {
351
- items: [],
352
- pagination: {
353
- offset: query.offset,
354
- limit: query.limit,
355
- totalCount: 0,
356
- nextOffset: null,
357
- },
358
- };
352
+ if (scopedConnectionIds.length > 0) {
353
+ return this.delegate.getCallHistory({ ...query, connectionIds: scopedConnectionIds });
359
354
  }
360
- return this.delegate.getCallHistory({ ...query, connectionIds: scopedConnectionIds });
355
+ // An account without filterable extensions would otherwise report an empty
356
+ // history. Read it unfiltered and keep only what belongs to the user.
357
+ const numbers = await this.ownedNumbers();
358
+ const { connectionIds: _ignored, ...unfiltered } = query;
359
+ const response = await this.delegate.getCallHistory(unfiltered);
360
+ const object = asObject(response);
361
+ const owned = items(response).filter((entry) => this.isOwnedHistoryEntry(entry, numbers));
362
+ return {
363
+ ...(object ?? {}),
364
+ items: owned,
365
+ filteredBy: "owned phone numbers",
366
+ note: "This account has no history extensions to filter on, so the account history was filtered by the user's own numbers.",
367
+ };
361
368
  }
362
369
  async exportHistory(query) {
363
370
  if (this.scope === "account")
@@ -418,6 +425,10 @@ export class AccessControlledBackend {
418
425
  await this.assertOwnedFaxline(faxlineId);
419
426
  return this.delegate.getFaxlineCallerId(userId, faxlineId);
420
427
  }
428
+ listSmsExtensions(userId) {
429
+ this.assertUser(userId);
430
+ return this.delegate.listSmsExtensions(this.scope === "account" ? userId : this.context.userId);
431
+ }
421
432
  async getHistoryEntry(entryId) {
422
433
  if (this.scope === "user")
423
434
  await this.assertOwnedHistoryEntry(entryId);
@@ -1019,6 +1030,13 @@ export class AccessControlledBackend {
1019
1030
  : [];
1020
1031
  if (entryConnections.some((connectionId) => connectionIds.has(connectionId)))
1021
1032
  return;
1033
+ // Accounts without extensions produce entries that carry no owned
1034
+ // connection, so fall back to the numbers the entry was placed between.
1035
+ if (entry !== undefined) {
1036
+ const numbers = await this.ownedNumbers();
1037
+ if (this.isOwnedHistoryEntry(entry, numbers))
1038
+ return;
1039
+ }
1022
1040
  throw new AccessPolicyError("User scope does not permit access to the requested history entry.");
1023
1041
  }
1024
1042
  assertAccountWideConfirmation(confirmAccountWide, operation) {
@@ -1028,28 +1046,21 @@ export class AccessControlledBackend {
1028
1046
  }
1029
1047
  async ownedHistoryEntryIds() {
1030
1048
  try {
1031
- const connectionIds = [...await this.ownedConnectionIds()];
1032
- if (connectionIds.length === 0)
1033
- return [];
1034
1049
  const found = new Set();
1035
- const pageSize = 1000;
1036
1050
  for (const archived of [false, true]) {
1037
- for (let offset = 0;; offset += pageSize) {
1038
- const response = await this.delegate.getCallHistory({
1039
- archived,
1040
- connectionIds,
1041
- limit: pageSize,
1042
- offset,
1043
- types: ["CALL", "VOICEMAIL", "SMS", "FAX"],
1044
- });
1045
- const page = items(response);
1046
- for (const entry of page) {
1047
- const entryId = stringField(entry, "id");
1048
- if (entryId)
1049
- found.add(entryId);
1050
- }
1051
- if (page.length < pageSize)
1052
- break;
1051
+ // Route through the scoped reader so device IDs never reach sipgate
1052
+ // as connection filters and unfilterable accounts still enumerate.
1053
+ // Its entries may be filtered, so collectPages follows nextOffset.
1054
+ const entries = await collectPages((offset, limit) => this.getCallHistory({
1055
+ archived,
1056
+ limit,
1057
+ offset,
1058
+ types: ["CALL", "VOICEMAIL", "SMS", "FAX"],
1059
+ }), items, "history entries");
1060
+ for (const entry of entries) {
1061
+ const entryId = stringField(entry, "id");
1062
+ if (entryId)
1063
+ found.add(entryId);
1053
1064
  }
1054
1065
  }
1055
1066
  return [...found];
@@ -1128,6 +1139,26 @@ export class AccessControlledBackend {
1128
1139
  return (participantId !== undefined && deviceIds.has(participantId))
1129
1140
  || (phoneNumber !== undefined && numbers.phoneNumbers.has(phoneNumber));
1130
1141
  }
1142
+ isOwnedHistoryEntry(entry, numbers) {
1143
+ const source = stringField(entry, "source");
1144
+ const target = stringField(entry, "target");
1145
+ return (source !== undefined && numbers.phoneNumbers.has(source))
1146
+ || (target !== undefined && numbers.phoneNumbers.has(target));
1147
+ }
1148
+ async ownedSmsExtensionIds() {
1149
+ const response = await this.delegate.listSmsExtensions(this.context.userId);
1150
+ return new Set(items(response)
1151
+ .map((extension) => stringField(extension, "id"))
1152
+ .filter((id) => Boolean(id)));
1153
+ }
1154
+ async ownedHistoryConnectionIds() {
1155
+ const [phonelineIds, faxlineIds, smsIds] = await Promise.all([
1156
+ this.ownedPhonelineIds(),
1157
+ this.ownedFaxlineIds(),
1158
+ this.ownedSmsExtensionIds(),
1159
+ ]);
1160
+ return new Set([...phonelineIds, ...faxlineIds, ...smsIds]);
1161
+ }
1131
1162
  async ownedPhonelineIds() {
1132
1163
  return (await this.ownedPhonelineState()).ids;
1133
1164
  }
@@ -1383,14 +1414,7 @@ export class AccessControlledBackend {
1383
1414
  throw new AccessPolicyError("User scope does not permit editing an address that is shared with numbers of other users.");
1384
1415
  }
1385
1416
  async ownedNumbers() {
1386
- const pageSize = 1000;
1387
- const routed = [];
1388
- for (let offset = 0;; offset += pageSize) {
1389
- const page = items(await this.delegate.listUserNumbers(this.context.userId, { offset, limit: pageSize }));
1390
- routed.push(...page);
1391
- if (page.length < pageSize)
1392
- break;
1393
- }
1417
+ const routed = await collectPages((offset, limit) => this.delegate.listUserNumbers(this.context.userId, { offset, limit }), items, "user numbers");
1394
1418
  // Quick dials and other number types are listed by the direct user-number
1395
1419
  // endpoint but may never appear in phoneline or device routing.
1396
1420
  const direct = items(await this.delegate.getUserNumbers(this.context.userId));