@sendora/mcp 1.15.8 → 2.0.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 +5 -4
- package/dist/errors.js +1 -1
- package/dist/generated/docs.json +1 -1
- package/dist/generated/screens/domain-records.html +1 -1
- package/dist/generated/screens/message-timeline.html +1 -1
- package/dist/instructions.js +3 -2
- package/dist/tool-table.js +1 -3
- package/dist/tools/keys.js +4 -97
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/instructions.js
CHANGED
|
@@ -4,9 +4,10 @@ import { grantNote, LIVE_NOTE, SIMULATOR_NOTE, WRITES_OFF_NOTE } from './tools/s
|
|
|
4
4
|
const ABOUT = "Sendora is a transactional email service: an HTTP API, SMTP submission, SDKs for TypeScript (@sendora/sdk), Python (sendora), PHP (sendora/sendora-php, and sendora/sendora-laravel for Laravel) and Java (se.sendora:sendora-java), signed webhooks and a message log with every delivery event. This server carries Sendora's documentation, and with a key, tools for that key's server or account.";
|
|
5
5
|
const DOCS = `Use the SDK for the project's language: @sendora/sdk for TypeScript or JavaScript, sendora for Python, sendora/sendora-php for PHP, sendora/sendora-laravel in a Laravel app, which installs it, or se.sendora:sendora-java for Java or Kotlin; the HTTP API otherwise. The Java SDK comes from Sendora's own Maven repository, https://maven.sendora.se, not from Maven Central. Before writing code, find the answer with search_docs and read the document with read_doc; ${INDEX_URI} lists them all, and sendora://sdk/skill, sendora://sdk/python/skill, sendora://sdk/php/skill and sendora://sdk/java/skill hold the rules an agent must keep with each SDK.`;
|
|
6
6
|
const KEYS = 'Never print or repeat a Sendora key, and never write one into a file under version control; keys belong in the environment.';
|
|
7
|
+
const TEST_DASHBOARD = `A person makes and revokes this server's keys in the dashboard, ${KEYS_PAGE}.`;
|
|
7
8
|
const LIVE_DASHBOARD = `A person makes and revokes this server's keys, and makes and deletes its webhooks, in the dashboard, ${KEYS_PAGE}, with changes on or off, since a new key or signing secret must not reach this conversation.`;
|
|
8
9
|
const ACCOUNT_DASHBOARD = `A server and a key are made in the dashboard, ${KEYS_PAGE}, since a new key is a secret this conversation must not see; a live server is deleted there too.`;
|
|
9
|
-
const GRANT_LIMITS = `Through a connected app,
|
|
10
|
+
const GRANT_LIMITS = `Through a connected app, webhooks and what cannot be undone happen on test servers alone, and the account is read only. A person makes and revokes keys, and does the rest, in the dashboard, ${KEYS_PAGE}. The person sees and ends this connection in the dashboard's user menu, under Connected apps (Anslutna appar).`;
|
|
10
11
|
function serverName(connection) {
|
|
11
12
|
return connection.server === undefined
|
|
12
13
|
? `a ${connection.kind} server the API could not name when this connection opened`
|
|
@@ -32,7 +33,7 @@ export function instructionsFor(connection) {
|
|
|
32
33
|
case 'test':
|
|
33
34
|
return [
|
|
34
35
|
ABOUT,
|
|
35
|
-
`This connection holds a key of ${serverName(connection)}. Call get_server first. ${SIMULATOR_NOTE}`,
|
|
36
|
+
`This connection holds a key of ${serverName(connection)}. Call get_server first. ${SIMULATOR_NOTE} ${TEST_DASHBOARD}`,
|
|
36
37
|
DOCS,
|
|
37
38
|
KEYS,
|
|
38
39
|
].join('\n\n');
|
package/dist/tool-table.js
CHANGED
|
@@ -3,7 +3,7 @@ import { docsTools } from './tools/docs.js';
|
|
|
3
3
|
import { addDomainTool, checkDomainTool, listDomainsTool } from './tools/domains.js';
|
|
4
4
|
import { readInboundMessageTool, searchInboundTool } from './tools/inbound.js';
|
|
5
5
|
import { addInboundDomainTool, checkInboundDomainTool, listInboundDomainsTool, } from './tools/inbound-domains.js';
|
|
6
|
-
import {
|
|
6
|
+
import { listKeysTool } from './tools/keys.js';
|
|
7
7
|
import { getMessageTool, searchMessagesTool } from './tools/messages.js';
|
|
8
8
|
import { sendEmailTool } from './tools/send.js';
|
|
9
9
|
import { getServerTool } from './tools/server.js';
|
|
@@ -41,8 +41,6 @@ export const toolTable = [
|
|
|
41
41
|
createWebhookTool,
|
|
42
42
|
deleteWebhookTool,
|
|
43
43
|
listKeysTool,
|
|
44
|
-
createKeyTool,
|
|
45
|
-
revokeKeyTool,
|
|
46
44
|
searchInboundTool,
|
|
47
45
|
readInboundMessageTool,
|
|
48
46
|
listInboundDomainsTool,
|
package/dist/tools/keys.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { KEYS_PAGE } from '../connection.js';
|
|
2
3
|
import { toolError } from '../errors.js';
|
|
3
4
|
import { READING } from '../tool.js';
|
|
4
5
|
import { registerServerTool } from '../target.js';
|
|
5
6
|
export const keyOutput = z.object({
|
|
6
|
-
tokenId: z.string().describe('
|
|
7
|
+
tokenId: z.string().describe("The key's id."),
|
|
7
8
|
name: z.string().describe('The name given at creation, for people to tell keys apart.'),
|
|
8
9
|
prefix: z.string().describe('The first characters of the key, to match it with a value in hand.'),
|
|
9
10
|
createdAt: z.string().describe('When it was made.'),
|
|
10
11
|
revokedAt: z.string().nullable().describe('When it was revoked; null while it works.'),
|
|
11
12
|
});
|
|
12
13
|
export const listedKeyOutput = keyOutput.extend({
|
|
13
|
-
thisConnection: z
|
|
14
|
-
.boolean()
|
|
15
|
-
.describe('True for the key this connection uses, which revoke_key refuses.'),
|
|
16
|
-
});
|
|
17
|
-
export const createdKeyOutput = keyOutput.extend({
|
|
18
|
-
token: z
|
|
19
|
-
.string()
|
|
20
|
-
.describe("The key, shown this once: into the project's environment, never a file under version control."),
|
|
14
|
+
thisConnection: z.boolean().describe('True for the key this connection uses.'),
|
|
21
15
|
});
|
|
22
16
|
/** `list_keys` (docs/design/mcp.md §4.2, §3.4): the server's keys, the connection's own marked. */
|
|
23
17
|
export const listKeysTool = {
|
|
@@ -28,7 +22,7 @@ export const listKeysTool = {
|
|
|
28
22
|
operations: ['GET /v1/tokens'],
|
|
29
23
|
register: (server, { connection, targets }) => registerServerTool(server, targets, 'list_keys', {
|
|
30
24
|
title: "List the server's keys",
|
|
31
|
-
description:
|
|
25
|
+
description: `Lists this server's keys by name and prefix, with when each was made and revoked; thisConnection marks the one this connection uses. A person makes and revokes keys in the dashboard, ${KEYS_PAGE}, which shows a key's value only when it is made. A server holds at most two live keys: rotate by creating one, switching to it, and revoking the old.`,
|
|
32
26
|
inputSchema: z.object({}),
|
|
33
27
|
outputSchema: z.object({
|
|
34
28
|
tokens: z.array(listedKeyOutput).describe("The server's keys."),
|
|
@@ -50,90 +44,3 @@ export const listKeysTool = {
|
|
|
50
44
|
}
|
|
51
45
|
}),
|
|
52
46
|
};
|
|
53
|
-
/** `create_key` (docs/design/mcp.md §4.2): a key for a test server, answered once. */
|
|
54
|
-
export const createKeyTool = {
|
|
55
|
-
name: 'create_key',
|
|
56
|
-
title: 'Create a key',
|
|
57
|
-
class: 'secret',
|
|
58
|
-
reach: 'server',
|
|
59
|
-
operations: ['POST /v1/tokens'],
|
|
60
|
-
register: (server, { connection, targets }) => registerServerTool(server, targets, 'create_key', {
|
|
61
|
-
title: 'Create a key',
|
|
62
|
-
description: "Creates a key for this test server and answers it, shown this once: put it in the project's environment, such as SENDORA_API_TOKEN in .env, never in a file under version control. A server holds at most two live keys.",
|
|
63
|
-
inputSchema: z.object({
|
|
64
|
-
name: z
|
|
65
|
-
.string()
|
|
66
|
-
.trim()
|
|
67
|
-
.min(1)
|
|
68
|
-
.max(100)
|
|
69
|
-
.describe('1 to 100 characters, for people to tell keys apart, such as CI.'),
|
|
70
|
-
}),
|
|
71
|
-
outputSchema: createdKeyOutput,
|
|
72
|
-
annotations: {
|
|
73
|
-
readOnlyHint: false,
|
|
74
|
-
destructiveHint: false,
|
|
75
|
-
idempotentHint: false,
|
|
76
|
-
openWorldHint: false,
|
|
77
|
-
},
|
|
78
|
-
}, async (request, { sendora }) => {
|
|
79
|
-
try {
|
|
80
|
-
const created = await sendora.tokens.create(request);
|
|
81
|
-
return {
|
|
82
|
-
content: [{ type: 'text', text: JSON.stringify(created) }],
|
|
83
|
-
structuredContent: created,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
return toolError(error, connection);
|
|
88
|
-
}
|
|
89
|
-
}),
|
|
90
|
-
};
|
|
91
|
-
export const OWN_KEY_REFUSED = 'revoke_key refuses the key this connection uses, since revoking it would cut the connection off: create another with create_key, switch the connection to it, and revoke the old one from there, or in the dashboard.';
|
|
92
|
-
function refusedOwnKey() {
|
|
93
|
-
return {
|
|
94
|
-
content: [{ type: 'text', text: `this_connection: ${OWN_KEY_REFUSED}` }],
|
|
95
|
-
structuredContent: { error: { code: 'this_connection', message: OWN_KEY_REFUSED } },
|
|
96
|
-
isError: true,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
/** `revoke_key` (docs/design/mcp.md §4.2, §3.4): a test server's key revoked, never the connection's own. */
|
|
100
|
-
export const revokeKeyTool = {
|
|
101
|
-
name: 'revoke_key',
|
|
102
|
-
title: 'Revoke a key',
|
|
103
|
-
class: 'irreversible',
|
|
104
|
-
reach: 'server',
|
|
105
|
-
operations: ['GET /v1/tokens', 'DELETE /v1/tokens/{id}'],
|
|
106
|
-
register: (server, { connection, targets }) => registerServerTool(server, targets, 'revoke_key', {
|
|
107
|
-
title: 'Revoke a key',
|
|
108
|
-
description: "Revokes a key of this test server: anything using it is refused from then on, and it cannot be restored. It refuses the key this connection uses, and the API refuses a server's last live key.",
|
|
109
|
-
inputSchema: z.object({
|
|
110
|
-
tokenId: z.uuid().describe('The key, from list_keys.'),
|
|
111
|
-
}),
|
|
112
|
-
outputSchema: z.object({
|
|
113
|
-
tokenId: z.string().describe('The key revoked.'),
|
|
114
|
-
}),
|
|
115
|
-
annotations: {
|
|
116
|
-
readOnlyHint: false,
|
|
117
|
-
destructiveHint: true,
|
|
118
|
-
idempotentHint: true,
|
|
119
|
-
openWorldHint: false,
|
|
120
|
-
},
|
|
121
|
-
}, async ({ tokenId }, { sendora, ownKey }) => {
|
|
122
|
-
try {
|
|
123
|
-
const { tokens } = await sendora.tokens.list();
|
|
124
|
-
const target = tokens.find((token) => token.tokenId === tokenId);
|
|
125
|
-
if (target !== undefined && ownKey(target.prefix)) {
|
|
126
|
-
return refusedOwnKey();
|
|
127
|
-
}
|
|
128
|
-
await sendora.tokens.revoke(tokenId);
|
|
129
|
-
}
|
|
130
|
-
catch (error) {
|
|
131
|
-
return toolError(error, connection);
|
|
132
|
-
}
|
|
133
|
-
const output = { tokenId };
|
|
134
|
-
return {
|
|
135
|
-
content: [{ type: 'text', text: JSON.stringify(output) }],
|
|
136
|
-
structuredContent: output,
|
|
137
|
-
};
|
|
138
|
-
}),
|
|
139
|
-
};
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This package's version, held equal to its package.json by a test. */
|
|
2
|
-
export const MCP_VERSION = '
|
|
2
|
+
export const MCP_VERSION = '2.0.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendora/mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "The official MCP server for Sendora: its documentation and API for coding agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@modelcontextprotocol/server": "^2.1.0",
|
|
27
27
|
"zod": "^4.6.2",
|
|
28
|
-
"@sendora/sdk": "^5.
|
|
28
|
+
"@sendora/sdk": "^5.9.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@anthropic-ai/mcpb": "2.1.2",
|