@pidgeon-ai/mcp 1.4.0 → 1.7.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/CHANGELOG.md +30 -0
- package/README.md +11 -6
- package/dist/server.js +9 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +131 -30
- package/package.json +2 -2
- package/server.json +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.0
|
|
4
|
+
|
|
5
|
+
- The registry entry names the hosted server again: `https://pidgeon.ai/mcp`
|
|
6
|
+
(Streamable HTTP, sign-in by OAuth), beside the npm package.
|
|
7
|
+
- `update_site` and `rotate_site_secret`.
|
|
8
|
+
|
|
9
|
+
## 1.6.0
|
|
10
|
+
|
|
11
|
+
- `send_message`, `reply_to_message`, `create_draft` and `update_draft` take
|
|
12
|
+
`attachment_ids`: files uploaded with an SDK or the API.
|
|
13
|
+
- `rename_agent`, `revoke_agent_key`, `revoke_agent` and `remove_pod`.
|
|
14
|
+
- `add_webhook` offers the mandate events.
|
|
15
|
+
- `status` names a key made by `pidgeon keys proof` after its agent, not
|
|
16
|
+
its id, when signed in.
|
|
17
|
+
|
|
18
|
+
## 1.5.0
|
|
19
|
+
|
|
20
|
+
- `hold_suspicious_mail`: hold mail the Firewall calls suspicious for a
|
|
21
|
+
person. `enable_domain_mail`: turn mail on for a proved domain.
|
|
22
|
+
- `create_inbox` takes `domain`; `search_messages` takes `body` and serves
|
|
23
|
+
the cleaned text by default, as the other mail tools do.
|
|
24
|
+
- `update_calendar_event` takes `all_day` and `null` to clear `description`
|
|
25
|
+
or `location`; `create_calendar_event` needs no `end` for an all-day one.
|
|
26
|
+
- `send_draft` takes a `send_at` with an offset; `request_mandate` keeps to
|
|
27
|
+
the API's limits; `add_webhook` offers the events webhooks carry;
|
|
28
|
+
`list_threads`'s `starred` is only `true`; `update_contact` clears with
|
|
29
|
+
`null`; `update_draft` no longer takes `reply_to`.
|
|
30
|
+
- Descriptions say what the API does: reports, the event log, the access
|
|
31
|
+
rules and mandates take.
|
|
32
|
+
|
|
3
33
|
## 1.4.0
|
|
4
34
|
|
|
5
35
|
- `add_webhook` takes `inbox_ids`: the endpoint hears only those inboxes'
|
package/README.md
CHANGED
|
@@ -38,9 +38,10 @@ session is refreshed from then on. On a machine with no browser, set
|
|
|
38
38
|
## Tools
|
|
39
39
|
|
|
40
40
|
- **Passport:** `set_up_agent`, `create_agent_key`, `list_agents`,
|
|
41
|
-
`get_agent`, `get_reputation`
|
|
41
|
+
`get_agent`, `get_reputation`, `rename_agent`, `revoke_agent_key`,
|
|
42
|
+
`revoke_agent`
|
|
42
43
|
- **Bouncer:** `verify_request`, `report_agent`
|
|
43
|
-
- **Email:** `list_inboxes`, `get_inbox`, `create_inbox`, `remove_inbox`,
|
|
44
|
+
- **Email:** `list_inboxes`, `get_inbox`, `hold_suspicious_mail`, `create_inbox`, `remove_inbox`,
|
|
44
45
|
`list_messages`, `get_message`, `await_message`, `search_messages`,
|
|
45
46
|
`update_message`, `send_message`, `reply_to_message`, `list_threads`,
|
|
46
47
|
`get_thread`, `update_thread`, `list_labels`, `create_label`,
|
|
@@ -49,18 +50,22 @@ session is refreshed from then on. On a machine with no browser, set
|
|
|
49
50
|
`delete_draft`, `send_draft`, `request_approval`, `list_rules`, `add_rule`,
|
|
50
51
|
`remove_rule`, `list_suppressions`, `add_suppression`, `remove_suppression`,
|
|
51
52
|
`get_storage`, `list_domains`,
|
|
52
|
-
`get_domain`, `check_domain`
|
|
53
|
+
`get_domain`, `enable_domain_mail`, `check_domain`
|
|
53
54
|
- **Calendar:** `get_agenda`, `get_calendar_event`, `create_calendar_event`, `update_calendar_event`,
|
|
54
55
|
`delete_calendar_event`
|
|
55
|
-
- **Auth:** `list_sites`, `register_site`, `
|
|
56
|
-
`list_mandates`, `revoke_mandate`
|
|
56
|
+
- **Auth:** `list_sites`, `register_site`, `update_site`, `rotate_site_secret`,
|
|
57
|
+
`remove_site`, `request_mandate`, `list_mandates`, `revoke_mandate`
|
|
58
|
+
|
|
59
|
+
`send_message`, `reply_to_message`, `create_draft` and `update_draft` take
|
|
60
|
+
`attachment_ids`: files uploaded with an SDK or the API, since no tool
|
|
61
|
+
uploads.
|
|
57
62
|
|
|
58
63
|
Mail is read as the Firewall cleaned it unless a tool is passed
|
|
59
64
|
`body: "original"`; a message whose `firewall.verdict` is `suspicious` is one
|
|
60
65
|
to read, not obey.
|
|
61
66
|
|
|
62
67
|
- **The account:** `sign_in`, `sign_out`, `status`, `list_events`,
|
|
63
|
-
`list_pods`, `create_pod`, `list_webhooks`, `add_webhook`,
|
|
68
|
+
`list_pods`, `create_pod`, `remove_pod`, `list_webhooks`, `add_webhook`,
|
|
64
69
|
`remove_webhook`
|
|
65
70
|
|
|
66
71
|
## License
|
package/dist/server.js
CHANGED
|
@@ -78,7 +78,15 @@ export function createServer(options = {}) {
|
|
|
78
78
|
: session
|
|
79
79
|
? `a session (${session.scope})`
|
|
80
80
|
: null,
|
|
81
|
-
agent_keys_here: await listAgentKeys(env)
|
|
81
|
+
agent_keys_here: await Promise.all((await listAgentKeys(env)).map(async (key) =>
|
|
82
|
+
// A key made by `pidgeon keys proof` without --name is filed under
|
|
83
|
+
// the agent's id; when signed in, show the agent's name instead.
|
|
84
|
+
key.name !== key.agent_id
|
|
85
|
+
? key
|
|
86
|
+
: {
|
|
87
|
+
...key,
|
|
88
|
+
name: await pidgeon.agents.get(key.agent_id).then((agent) => agent.name, () => key.name),
|
|
89
|
+
})),
|
|
82
90
|
};
|
|
83
91
|
}));
|
|
84
92
|
// -------------------------------------------------------------- Passport
|
package/dist/tools.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
9
9
|
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
10
10
|
import { type Pidgeon } from '@pidgeon-ai/sdk';
|
|
11
|
-
export declare const VERSION = "1.
|
|
11
|
+
export declare const VERSION = "1.7.0";
|
|
12
12
|
export declare const json: (value: unknown) => CallToolResult;
|
|
13
13
|
export declare const failed: (text: string) => CallToolResult;
|
|
14
14
|
/** Run a tool's work and answer its result, or the API's refusal in words the model can act on. */
|
package/dist/tools.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { PidgeonError } from '@pidgeon-ai/sdk';
|
|
3
|
-
export const VERSION = '1.
|
|
2
|
+
import { PidgeonError, WEBHOOK_EVENTS } from '@pidgeon-ai/sdk';
|
|
3
|
+
export const VERSION = '1.7.0';
|
|
4
4
|
export const json = (value) => ({
|
|
5
5
|
content: [{ type: 'text', text: JSON.stringify(value ?? { ok: true }, null, 2) }],
|
|
6
6
|
});
|
|
@@ -30,7 +30,7 @@ const messageShape = {
|
|
|
30
30
|
to: addresses.describe('Who it is to.'),
|
|
31
31
|
cc: z.array(z.string().email()).optional(),
|
|
32
32
|
bcc: z.array(z.string().email()).optional(),
|
|
33
|
-
subject: z.string().max(998),
|
|
33
|
+
subject: z.string().max(998).optional(),
|
|
34
34
|
text: z.string().optional().describe('The plain-text body. Send text, html or both.'),
|
|
35
35
|
html: z.string().optional(),
|
|
36
36
|
reply_to: z
|
|
@@ -38,7 +38,14 @@ const messageShape = {
|
|
|
38
38
|
.uuid()
|
|
39
39
|
.optional()
|
|
40
40
|
.describe('A message of this inbox to reply to; the reply joins its thread.'),
|
|
41
|
+
attachment_ids: z
|
|
42
|
+
.array(z.string().uuid())
|
|
43
|
+
.max(20)
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('Files to attach: finished uploads of this inbox, up to 20 and 25 MB in all. Upload them with the SDK or the API; no tool uploads.'),
|
|
41
46
|
};
|
|
47
|
+
/** A draft's conversation is fixed when it is written. */
|
|
48
|
+
const { reply_to: _replyTo, ...withoutReplyTo } = messageShape;
|
|
42
49
|
const asMessage = (args) => ({
|
|
43
50
|
to: args.to,
|
|
44
51
|
cc: args.cc,
|
|
@@ -47,6 +54,7 @@ const asMessage = (args) => ({
|
|
|
47
54
|
text: args.text,
|
|
48
55
|
html: args.html,
|
|
49
56
|
replyTo: args.reply_to,
|
|
57
|
+
attachmentIds: args.attachment_ids,
|
|
50
58
|
});
|
|
51
59
|
export const READ = { readOnlyHint: true, openWorldHint: true };
|
|
52
60
|
export const WRITE = { readOnlyHint: false, destructiveHint: false, openWorldHint: true };
|
|
@@ -80,10 +88,41 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
80
88
|
}, ({ agent_id }) => answer(async () => {
|
|
81
89
|
const id = agent_id ?? (await pidgeon.agents.list({ limit: 1 })).data[0]?.id;
|
|
82
90
|
if (!id)
|
|
83
|
-
return {
|
|
91
|
+
return {
|
|
92
|
+
reputation: null,
|
|
93
|
+
note: 'The account has no agents yet: register one first (set_up_agent, or register_agent on the hosted server).',
|
|
94
|
+
};
|
|
84
95
|
const agent = await pidgeon.agents.get(id);
|
|
85
96
|
return { agent_id: agent.id, ...agent.reputation };
|
|
86
97
|
}));
|
|
98
|
+
server.registerTool('rename_agent', {
|
|
99
|
+
title: 'Rename an agent',
|
|
100
|
+
description: 'Change an agent’s name, what it does, or both: what websites see when it arrives. Needs the Everything level.',
|
|
101
|
+
inputSchema: {
|
|
102
|
+
agent_id: z.string().uuid(),
|
|
103
|
+
name: z.string().min(1).max(80).optional(),
|
|
104
|
+
purpose: z.string().max(280).optional().describe('What it does, in a sentence.'),
|
|
105
|
+
},
|
|
106
|
+
annotations: WRITE,
|
|
107
|
+
}, ({ agent_id, name, purpose }) => answer(() => pidgeon.agents.update(agent_id, { name, purpose })));
|
|
108
|
+
server.registerTool('revoke_agent_key', {
|
|
109
|
+
title: 'Revoke an agent’s key',
|
|
110
|
+
description: 'Revoke one of an agent’s keys, by its kid (get_agent lists them): requests signed with it stop verifying at once. Its other keys stay. Ask the person first. Needs the Everything level.',
|
|
111
|
+
inputSchema: { agent_id: z.string().uuid(), kid: z.string().min(1) },
|
|
112
|
+
annotations: DESTROY,
|
|
113
|
+
}, ({ agent_id, kid }) => answer(async () => {
|
|
114
|
+
await pidgeon.agents.revokeKey(agent_id, kid);
|
|
115
|
+
return { revoked: kid };
|
|
116
|
+
}));
|
|
117
|
+
server.registerTool('revoke_agent', {
|
|
118
|
+
title: 'Revoke an agent',
|
|
119
|
+
description: 'Revoke an agent and every key it has: no request it signs verifies again, and it cannot be undone. Ask the person first. Needs the Everything level.',
|
|
120
|
+
inputSchema: { agent_id: z.string().uuid() },
|
|
121
|
+
annotations: DESTROY,
|
|
122
|
+
}, ({ agent_id }) => answer(async () => {
|
|
123
|
+
await pidgeon.agents.revoke(agent_id);
|
|
124
|
+
return { revoked: agent_id };
|
|
125
|
+
}));
|
|
87
126
|
// ----------------------------------------------------------------- Email
|
|
88
127
|
server.registerTool('list_inboxes', {
|
|
89
128
|
title: 'List inboxes',
|
|
@@ -97,6 +136,12 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
97
136
|
inputSchema: { inbox_id: z.string().uuid() },
|
|
98
137
|
annotations: READ,
|
|
99
138
|
}, ({ inbox_id }) => answer(() => pidgeon.inboxes.get(inbox_id)));
|
|
139
|
+
server.registerTool('hold_suspicious_mail', {
|
|
140
|
+
title: 'Hold suspicious mail for a person',
|
|
141
|
+
description: 'Hold mail the Firewall calls suspicious in this inbox for a person to read first. A key turns this on, never off.',
|
|
142
|
+
inputSchema: { inbox_id: z.string().uuid() },
|
|
143
|
+
annotations: WRITE,
|
|
144
|
+
}, ({ inbox_id }) => answer(() => pidgeon.inboxes.holdSuspicious(inbox_id)));
|
|
100
145
|
server.registerTool('create_inbox', {
|
|
101
146
|
title: 'Make an inbox',
|
|
102
147
|
description: 'Make an inbox. `name` is the part before the @. Pass agent_id to make it that agent’s: its mail then carries its signed declaration (binding needs a verified domain).',
|
|
@@ -106,9 +151,14 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
106
151
|
agent_id: z.string().uuid().optional(),
|
|
107
152
|
display_name: z.string().max(120).optional(),
|
|
108
153
|
pod_id: z.string().uuid().optional(),
|
|
154
|
+
domain: z
|
|
155
|
+
.string()
|
|
156
|
+
.optional()
|
|
157
|
+
.describe('One of your domains with mail on (enable_domain_mail); pidgeon.email if left out.'),
|
|
109
158
|
},
|
|
110
159
|
annotations: WRITE,
|
|
111
160
|
}, (args) => answer(() => pidgeon.inboxes.create({
|
|
161
|
+
domain: args.domain,
|
|
112
162
|
name: args.name,
|
|
113
163
|
kind: args.kind,
|
|
114
164
|
agentId: args.agent_id,
|
|
@@ -141,8 +191,8 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
141
191
|
}, ({ draft_id }) => answer(() => pidgeon.drafts.get(draft_id)));
|
|
142
192
|
server.registerTool('update_draft', {
|
|
143
193
|
title: 'Edit a draft',
|
|
144
|
-
description: 'Replace a draft’s addresses and body.',
|
|
145
|
-
inputSchema: { draft_id: z.string().uuid(), ...
|
|
194
|
+
description: 'Replace a draft’s addresses and body; it stays in its conversation.',
|
|
195
|
+
inputSchema: { draft_id: z.string().uuid(), ...withoutReplyTo },
|
|
146
196
|
annotations: WRITE,
|
|
147
197
|
}, ({ draft_id, ...message }) => answer(() => pidgeon.drafts.update(draft_id, asMessage(message))));
|
|
148
198
|
server.registerTool('delete_draft', {
|
|
@@ -154,7 +204,10 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
154
204
|
server.registerTool('send_draft', {
|
|
155
205
|
title: 'Send a draft',
|
|
156
206
|
description: 'Send a draft now, or at send_at (ISO 8601, up to 90 days ahead).',
|
|
157
|
-
inputSchema: {
|
|
207
|
+
inputSchema: {
|
|
208
|
+
draft_id: z.string().uuid(),
|
|
209
|
+
send_at: z.string().datetime({ offset: true }).optional(),
|
|
210
|
+
},
|
|
158
211
|
annotations: WRITE,
|
|
159
212
|
}, ({ draft_id, send_at }) => answer(() => pidgeon.drafts.send(draft_id, { sendAt: send_at })));
|
|
160
213
|
server.registerTool('request_approval', {
|
|
@@ -165,12 +218,12 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
165
218
|
}, ({ draft_id }) => answer(() => pidgeon.drafts.requestApproval(draft_id)));
|
|
166
219
|
server.registerTool('list_rules', {
|
|
167
220
|
title: 'List mail rules',
|
|
168
|
-
description: 'The account’s send and receive rules.',
|
|
221
|
+
description: 'The account’s send and receive rules. Needs a key or sign-in of the whole account.',
|
|
169
222
|
annotations: READ,
|
|
170
223
|
}, () => answer(() => pidgeon.rules.list()));
|
|
171
224
|
server.registerTool('add_rule', {
|
|
172
225
|
title: 'Add a mail rule',
|
|
173
|
-
description: 'Allow or block an address, or a domain and its subdomains, for sending or receiving; for one inbox, or every inbox when inbox_id is left out.',
|
|
226
|
+
description: 'Allow or block an address, or a domain and its subdomains, for sending or receiving; for one inbox, or every inbox when inbox_id is left out. Needs the Everything level, of the whole account.',
|
|
174
227
|
inputSchema: {
|
|
175
228
|
direction: z.enum(['send', 'receive']),
|
|
176
229
|
action: z.enum(['allow', 'block']),
|
|
@@ -181,13 +234,13 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
181
234
|
}, ({ direction, action, pattern, inbox_id }) => answer(() => pidgeon.rules.create({ direction, action, pattern, inboxId: inbox_id })));
|
|
182
235
|
server.registerTool('remove_rule', {
|
|
183
236
|
title: 'Remove a mail rule',
|
|
184
|
-
description: 'Remove a send or receive rule.',
|
|
237
|
+
description: 'Remove a send or receive rule. Needs the Everything level, of the whole account.',
|
|
185
238
|
inputSchema: { rule_id: z.string().uuid() },
|
|
186
239
|
annotations: DESTROY,
|
|
187
240
|
}, ({ rule_id }) => answer(async () => (await pidgeon.rules.remove(rule_id), { removed: rule_id })));
|
|
188
241
|
server.registerTool('list_suppressions', {
|
|
189
242
|
title: 'List the do-not-send list',
|
|
190
|
-
description: 'Addresses the account will not send to: bounces, complaints, and ones added by hand.',
|
|
243
|
+
description: 'Addresses the account will not send to: bounces, complaints, and ones added by hand. Needs a key or sign-in of the whole account.',
|
|
191
244
|
annotations: READ,
|
|
192
245
|
}, () => answer(() => pidgeon.suppressions.list()));
|
|
193
246
|
server.registerTool('add_suppression', {
|
|
@@ -220,6 +273,12 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
220
273
|
inputSchema: { domain_id: z.string().uuid() },
|
|
221
274
|
annotations: READ,
|
|
222
275
|
}, ({ domain_id }) => answer(() => pidgeon.domains.get(domain_id)));
|
|
276
|
+
server.registerTool('enable_domain_mail', {
|
|
277
|
+
title: 'Turn mail on for a domain',
|
|
278
|
+
description: 'Turn mail on for a domain the account has proved, so inboxes can be made on it. Answers the DNS records a person sets at the domain’s DNS host (nothing is changed there), then check_domain. Needs the Everything level, of the whole account.',
|
|
279
|
+
inputSchema: { domain_id: z.string().uuid() },
|
|
280
|
+
annotations: WRITE,
|
|
281
|
+
}, ({ domain_id }) => answer(() => pidgeon.domains.enableMail(domain_id)));
|
|
223
282
|
server.registerTool('check_domain', {
|
|
224
283
|
title: 'Check a domain’s records',
|
|
225
284
|
description: 'Ask DNS and the mail service now where a domain whose mail is on stands, after its records were set. Changes nothing. Needs a key or sign-in of the whole account.',
|
|
@@ -229,7 +288,7 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
229
288
|
// --------------------------------------------------------- the account
|
|
230
289
|
server.registerTool('list_events', {
|
|
231
290
|
title: 'Read the event log',
|
|
232
|
-
description: 'What happened in the account, newest first: mail sent, received and held,
|
|
291
|
+
description: 'What happened in the account, newest first: mail sent, received and held, conversations, the calendar, API keys, sign-ins and mandates, reports and reputation, pods and members.',
|
|
233
292
|
inputSchema: {
|
|
234
293
|
type: z.string().optional(),
|
|
235
294
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -245,12 +304,12 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
245
304
|
}, () => answer(() => pidgeon.webhooks.list()));
|
|
246
305
|
server.registerTool('add_webhook', {
|
|
247
306
|
title: 'Add a webhook endpoint',
|
|
248
|
-
description: 'Deliver events to a public https address. The answer has `secret`, shown this once: whoever receives the deliveries checks each signature with it, so hand it to them and keep it out of anything else. Event types: report.created, reputation.changed, operator.reputation_changed, and Email’s message.*, draft.*, thread.*, inbox.*, email.domain_* and calendar.event.* (listed at /docs/webhooks). Needs the Everything level, of the whole account.',
|
|
307
|
+
description: 'Deliver events to a public https address. The answer has `secret`, shown this once: whoever receives the deliveries checks each signature with it, so hand it to them and keep it out of anything else. Event types: report.created, reputation.changed, operator.reputation_changed, Auth’s mandate.requested, mandate.granted, mandate.declined and mandate.revoked, and Email’s message.*, draft.*, thread.*, inbox.*, email.domain_* and calendar.event.* (listed at /docs/webhooks). Needs the Everything level, of the whole account.',
|
|
249
308
|
inputSchema: {
|
|
250
309
|
url: z.string().url().describe('A public https:// address.'),
|
|
251
|
-
events: z.array(z.
|
|
310
|
+
events: z.array(z.enum(WEBHOOK_EVENTS)).min(1).describe('The event types to deliver.'),
|
|
252
311
|
inbox_ids: z
|
|
253
|
-
.array(z.string())
|
|
312
|
+
.array(z.string().uuid())
|
|
254
313
|
.min(1)
|
|
255
314
|
.optional()
|
|
256
315
|
.describe('Hear only these inboxes’ events. Left out, the whole account’s.'),
|
|
@@ -275,6 +334,15 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
275
334
|
inputSchema: { name: z.string().min(1).max(80).describe('Unique in the account.') },
|
|
276
335
|
annotations: WRITE,
|
|
277
336
|
}, ({ name }) => answer(() => pidgeon.pods.create(name)));
|
|
337
|
+
server.registerTool('remove_pod', {
|
|
338
|
+
title: 'Remove a pod',
|
|
339
|
+
description: 'Remove an empty pod. The default pod stays, and so does a pod with agents, domains or webhook endpoints in it. Needs the Everything level, of the whole account.',
|
|
340
|
+
inputSchema: { pod_id: z.string().uuid() },
|
|
341
|
+
annotations: DESTROY,
|
|
342
|
+
}, ({ pod_id }) => answer(async () => {
|
|
343
|
+
await pidgeon.pods.remove(pod_id);
|
|
344
|
+
return { removed: pod_id };
|
|
345
|
+
}));
|
|
278
346
|
// ------------------------------------------------------------ Reading mail
|
|
279
347
|
// Names kept from the old MCP server where the tool still exists: agents
|
|
280
348
|
// have them in their prompts.
|
|
@@ -309,12 +377,13 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
309
377
|
title: 'Search mail',
|
|
310
378
|
description: 'Mail by words in its subject, sender or text, newest first. Held mail is never found.',
|
|
311
379
|
inputSchema: {
|
|
312
|
-
query: z.string().min(1),
|
|
380
|
+
query: z.string().min(1).max(200),
|
|
313
381
|
inbox_id: z.string().uuid().optional(),
|
|
314
382
|
cursor: z.string().optional(),
|
|
383
|
+
body,
|
|
315
384
|
},
|
|
316
385
|
annotations: READ,
|
|
317
|
-
}, ({ query, inbox_id, cursor }) => answer(() => pidgeon.messages.search(query, { inboxId: inbox_id, cursor })));
|
|
386
|
+
}, ({ query, inbox_id, cursor, body }) => answer(() => pidgeon.messages.search(query, { inboxId: inbox_id, cursor, body })));
|
|
318
387
|
server.registerTool('update_message', {
|
|
319
388
|
title: 'Mark a message read',
|
|
320
389
|
description: 'Mark a received message read (`seen: true`) or unread.',
|
|
@@ -329,9 +398,10 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
329
398
|
text: z.string().min(1),
|
|
330
399
|
html: z.string().optional(),
|
|
331
400
|
cc: z.array(z.string().email()).optional(),
|
|
401
|
+
attachment_ids: messageShape.attachment_ids,
|
|
332
402
|
},
|
|
333
403
|
annotations: WRITE,
|
|
334
|
-
}, ({ message_id, text, html, cc }) => answer(async () => {
|
|
404
|
+
}, ({ message_id, text, html, cc, attachment_ids }) => answer(async () => {
|
|
335
405
|
const original = await pidgeon.messages.get(message_id);
|
|
336
406
|
const subject = original.subject ?? '';
|
|
337
407
|
return pidgeon.messages.send(original.inbox_id, {
|
|
@@ -341,6 +411,7 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
341
411
|
text,
|
|
342
412
|
html,
|
|
343
413
|
replyTo: original.id,
|
|
414
|
+
attachmentIds: attachment_ids,
|
|
344
415
|
});
|
|
345
416
|
}));
|
|
346
417
|
// ----------------------------------------------------------- Conversations
|
|
@@ -352,7 +423,7 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
352
423
|
folder: z.enum(['inbox', 'archive', 'spam', 'trash']).optional(),
|
|
353
424
|
label_id: z.string().uuid().optional(),
|
|
354
425
|
status: z.enum(['open', 'waiting', 'resolved', 'human_review']).optional(),
|
|
355
|
-
starred: z.
|
|
426
|
+
starred: z.literal(true).optional().describe('Only starred ones.'),
|
|
356
427
|
cursor: z.string().optional(),
|
|
357
428
|
},
|
|
358
429
|
annotations: READ,
|
|
@@ -452,8 +523,8 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
452
523
|
description: 'A contact’s name or notes. Once edited, mail no longer renames it.',
|
|
453
524
|
inputSchema: {
|
|
454
525
|
contact_id: z.string().uuid(),
|
|
455
|
-
name: z.string().max(200).optional(),
|
|
456
|
-
notes: z.string().max(5000).optional(),
|
|
526
|
+
name: z.string().max(200).nullable().optional().describe('`null` clears it.'),
|
|
527
|
+
notes: z.string().max(5000).nullable().optional().describe('`null` clears it.'),
|
|
457
528
|
},
|
|
458
529
|
annotations: WRITE,
|
|
459
530
|
}, ({ contact_id, name, notes }) => answer(() => pidgeon.contacts.update(contact_id, { name, notes })));
|
|
@@ -486,9 +557,12 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
486
557
|
description: 'An event in an inbox’s calendar. Timed: ISO 8601 times with their offset. All day: dates, `end` the last day. `attendees` records who is on it; invitations go only with `send_invites: true` (a key with send access).',
|
|
487
558
|
inputSchema: {
|
|
488
559
|
inbox_id: z.string().uuid(),
|
|
489
|
-
title: z.string().min(1),
|
|
560
|
+
title: z.string().min(1).max(1000),
|
|
490
561
|
start: z.string(),
|
|
491
|
-
end: z
|
|
562
|
+
end: z
|
|
563
|
+
.string()
|
|
564
|
+
.optional()
|
|
565
|
+
.describe('Required for a timed event; all day, the last day (default the start).'),
|
|
492
566
|
all_day: z.boolean().optional(),
|
|
493
567
|
description: z.string().optional(),
|
|
494
568
|
location: z.string().optional(),
|
|
@@ -511,11 +585,12 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
511
585
|
description: 'Change what you name; the rest of the event stays. `send_invites: true` sends the attendees the updated invitation.',
|
|
512
586
|
inputSchema: {
|
|
513
587
|
event_id: z.string().uuid(),
|
|
514
|
-
title: z.string().optional(),
|
|
588
|
+
title: z.string().max(1000).optional(),
|
|
515
589
|
start: z.string().optional(),
|
|
516
590
|
end: z.string().optional(),
|
|
517
|
-
|
|
518
|
-
|
|
591
|
+
all_day: z.boolean().optional(),
|
|
592
|
+
description: z.string().nullable().optional().describe('`null` clears it.'),
|
|
593
|
+
location: z.string().nullable().optional().describe('`null` clears it.'),
|
|
519
594
|
attendees: z.array(z.string().email()).max(50).optional(),
|
|
520
595
|
send_invites: z.boolean().optional(),
|
|
521
596
|
},
|
|
@@ -524,6 +599,7 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
524
599
|
title: args.title,
|
|
525
600
|
start: args.start,
|
|
526
601
|
end: args.end,
|
|
602
|
+
allDay: args.all_day,
|
|
527
603
|
description: args.description,
|
|
528
604
|
location: args.location,
|
|
529
605
|
attendees: args.attendees,
|
|
@@ -557,7 +633,7 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
557
633
|
}, ({ method, url, headers }) => answer(() => pidgeon.verify({ method, url, headers })));
|
|
558
634
|
server.registerTool('report_agent', {
|
|
559
635
|
title: 'Report an agent',
|
|
560
|
-
description: 'For a website: report the agent behind one of your verifications.
|
|
636
|
+
description: 'For a website: report the agent behind one of your verifications. One upheld report, or open reports from two websites, flag its operator. Needs a verified domain and send access.',
|
|
561
637
|
inputSchema: {
|
|
562
638
|
verification_id: z.string().uuid(),
|
|
563
639
|
category: z.enum(['fraud', 'abuse', 'scraping', 'spam', 'fake_signups', 'other']),
|
|
@@ -577,11 +653,36 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
577
653
|
description: 'Register a site so people and agents can sign in to it with Pidgeon. Answers `client_secret` once: keep it on the site’s server.',
|
|
578
654
|
inputSchema: {
|
|
579
655
|
name: z.string().min(1).max(120),
|
|
580
|
-
redirect_uris: z
|
|
656
|
+
redirect_uris: z
|
|
657
|
+
.array(z.string().url())
|
|
658
|
+
.min(1)
|
|
659
|
+
.max(20)
|
|
660
|
+
.describe('https addresses (http on localhost), matched exactly.'),
|
|
581
661
|
pod_id: z.string().uuid().optional(),
|
|
582
662
|
},
|
|
583
663
|
annotations: WRITE,
|
|
584
664
|
}, ({ name, redirect_uris, pod_id }) => answer(() => pidgeon.sites.create({ name, redirectUris: redirect_uris, podId: pod_id })));
|
|
665
|
+
server.registerTool('update_site', {
|
|
666
|
+
title: 'Edit a site',
|
|
667
|
+
description: 'Rename a Sign in with Pidgeon site, or replace its return addresses (send the whole new list). Its client_id and secret stay.',
|
|
668
|
+
inputSchema: {
|
|
669
|
+
client_id: z.string(),
|
|
670
|
+
name: z.string().min(1).max(120).optional(),
|
|
671
|
+
redirect_uris: z
|
|
672
|
+
.array(z.string().url())
|
|
673
|
+
.min(1)
|
|
674
|
+
.max(20)
|
|
675
|
+
.optional()
|
|
676
|
+
.describe('The whole new list: https addresses (http on localhost), matched exactly.'),
|
|
677
|
+
},
|
|
678
|
+
annotations: WRITE,
|
|
679
|
+
}, ({ client_id, name, redirect_uris }) => answer(() => pidgeon.sites.update(client_id, { name, redirectUris: redirect_uris })));
|
|
680
|
+
server.registerTool('rotate_site_secret', {
|
|
681
|
+
title: 'Rotate a site’s secret',
|
|
682
|
+
description: 'Give a site a new client_secret, answered once: put it on the site’s server. The old one stops working at once, so the site cannot sign anyone in until it has the new one.',
|
|
683
|
+
inputSchema: { client_id: z.string() },
|
|
684
|
+
annotations: DESTROY,
|
|
685
|
+
}, ({ client_id }) => answer(() => pidgeon.sites.rotateSecret(client_id)));
|
|
585
686
|
server.registerTool('remove_site', {
|
|
586
687
|
title: 'Remove a site',
|
|
587
688
|
description: 'Remove a Sign in with Pidgeon site; its sign-ins stop working.',
|
|
@@ -594,8 +695,8 @@ export function registerApiTools(server, pidgeon, signInHint) {
|
|
|
594
695
|
inputSchema: {
|
|
595
696
|
agent_id: z.string().uuid(),
|
|
596
697
|
client_id: z.string(),
|
|
597
|
-
scope: z.string(),
|
|
598
|
-
description: z.string().min(1).max(
|
|
698
|
+
scope: z.string().min(1).max(500),
|
|
699
|
+
description: z.string().min(1).max(280),
|
|
599
700
|
days: z.number().int().min(1).max(90).optional(),
|
|
600
701
|
},
|
|
601
702
|
annotations: WRITE,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pidgeon-ai/mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Pidgeon's MCP server: a coding agent sets an agent up end to end (registered, keyed on your machine, published, its reputation read) and works its inboxes.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
47
47
|
"zod": "^4.6.7",
|
|
48
|
-
"@pidgeon-ai/sdk": "^2.
|
|
48
|
+
"@pidgeon-ai/sdk": "^2.5.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^24.10.1",
|
package/server.json
CHANGED
|
@@ -9,13 +9,15 @@
|
|
|
9
9
|
"source": "github",
|
|
10
10
|
"subfolder": "packages/mcp"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.
|
|
12
|
+
"version": "1.7.0",
|
|
13
13
|
"packages": [
|
|
14
14
|
{
|
|
15
15
|
"registryType": "npm",
|
|
16
16
|
"identifier": "@pidgeon-ai/mcp",
|
|
17
|
-
"version": "1.
|
|
18
|
-
"transport": {
|
|
17
|
+
"version": "1.7.0",
|
|
18
|
+
"transport": {
|
|
19
|
+
"type": "stdio"
|
|
20
|
+
},
|
|
19
21
|
"environmentVariables": [
|
|
20
22
|
{
|
|
21
23
|
"name": "PIDGEON_API_KEY",
|
|
@@ -25,5 +27,11 @@
|
|
|
25
27
|
}
|
|
26
28
|
]
|
|
27
29
|
}
|
|
30
|
+
],
|
|
31
|
+
"remotes": [
|
|
32
|
+
{
|
|
33
|
+
"type": "streamable-http",
|
|
34
|
+
"url": "https://pidgeon.ai/mcp"
|
|
35
|
+
}
|
|
28
36
|
]
|
|
29
37
|
}
|