@sendora/mcp 1.3.1 → 1.4.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.
- package/README.md +2 -1
- package/dist/errors.js +14 -8
- package/dist/generated/docs.json +1 -1
- package/dist/grant.js +95 -0
- package/dist/handler.js +137 -36
- package/dist/instructions.js +18 -2
- package/dist/listing.js +23 -0
- package/dist/server.js +2 -2
- package/dist/target.js +49 -0
- package/dist/tools/broadcasts.js +14 -13
- package/dist/tools/domains.js +3 -3
- package/dist/tools/inbound-domains.js +13 -13
- package/dist/tools/inbound.js +9 -9
- package/dist/tools/keys.js +11 -13
- package/dist/tools/messages.js +9 -9
- package/dist/tools/send.js +16 -8
- package/dist/tools/server.js +27 -14
- package/dist/tools/servers.js +29 -9
- package/dist/tools/streams.js +19 -14
- package/dist/tools/suppressions.js +39 -37
- package/dist/tools/webhooks.js +21 -21
- package/dist/version.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -78,7 +78,8 @@ The documents are resources under `sendora://docs/…`, `sendora://reference/…
|
|
|
78
78
|
|
|
79
79
|
The only official Sendora MCP server is this package, `@sendora/mcp`, and the
|
|
80
80
|
address Sendora names at [sendora.se/docs/mcp](https://sendora.se/docs/mcp).
|
|
81
|
-
|
|
81
|
+
The MCP Registry lists it as `se.sendora/mcp`, a name that only sendora.se can
|
|
82
|
+
publish. A server under another name is not Sendora's.
|
|
82
83
|
|
|
83
84
|
## License
|
|
84
85
|
|
package/dist/errors.js
CHANGED
|
@@ -17,8 +17,13 @@ const capOwner = {
|
|
|
17
17
|
*/
|
|
18
18
|
const hints = {
|
|
19
19
|
invalid_request: null,
|
|
20
|
-
unauthorized: (
|
|
20
|
+
unauthorized: (_error, connection) => connection.kind === 'grant'
|
|
21
|
+
? `This connection has ended, or the person who approved it may no longer open this server. They see their connections under Account › Connected apps (Konto › Anslutna appar), ${DASHBOARD}/account/apps, and can connect the app again.`
|
|
22
|
+
: `The key was revoked or mistyped. A server key is made under its server in the dashboard, ${KEYS_PAGE}, and an account key by an administrator under Account › API keys (Konto › API-nycklar), ${ACCOUNT_KEYS_PAGE}; restart the connection with the new one.`,
|
|
21
23
|
wrong_token_kind: null,
|
|
24
|
+
not_for_connections: null,
|
|
25
|
+
read_only_connection: () => 'The person approved this connection without changes on live servers, and the account is read only through a connection. They can connect again and tick "Tillåt ändringar på liveservrar" on the approval page, or the change can be made on a test server.',
|
|
26
|
+
test_server_only: () => 'Through a connected app, keys, webhooks and what cannot be undone happen on test servers only. Make the change on a test server, or in the dashboard.',
|
|
22
27
|
payment_required: null,
|
|
23
28
|
account_paused: null,
|
|
24
29
|
account_not_active: null,
|
|
@@ -68,22 +73,23 @@ const hints = {
|
|
|
68
73
|
invalid_signature: null,
|
|
69
74
|
stale_signature: null,
|
|
70
75
|
};
|
|
71
|
-
/** The hint for a refusal, or undefined when the API's message says all there is. */
|
|
72
|
-
export function hintFor(error) {
|
|
76
|
+
/** The hint for a refusal on this connection, or undefined when the API's message says all there is. */
|
|
77
|
+
export function hintFor(error, connection) {
|
|
73
78
|
const hint = hints[error.code];
|
|
74
|
-
return hint === null ? undefined : hint(error);
|
|
79
|
+
return hint === null ? undefined : hint(error, connection);
|
|
75
80
|
}
|
|
76
81
|
/**
|
|
77
82
|
* A refusal from the API as a tool's error (docs/design/mcp.md §7), which
|
|
78
83
|
* the model reads and can act on: the code, the API's message and the next
|
|
79
|
-
* step, with the error's fields as the SDK has them.
|
|
80
|
-
* `SendoraError` is the server's own fault and is
|
|
84
|
+
* step on this connection, with the error's fields as the SDK has them.
|
|
85
|
+
* Anything that is not a `SendoraError` is the server's own fault and is
|
|
86
|
+
* thrown.
|
|
81
87
|
*/
|
|
82
|
-
export function toolError(error) {
|
|
88
|
+
export function toolError(error, connection) {
|
|
83
89
|
if (!(error instanceof SendoraError)) {
|
|
84
90
|
throw error;
|
|
85
91
|
}
|
|
86
|
-
const hint = hintFor(error);
|
|
92
|
+
const hint = hintFor(error, connection);
|
|
87
93
|
return {
|
|
88
94
|
content: [
|
|
89
95
|
{
|