verdo-mcp 0.0.0-stage → 1.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 +50 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +60 -0
- package/dist/tools.d.ts +232 -0
- package/dist/tools.js +303 -0
- package/package.json +31 -6
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# Verdo MCP Server
|
|
2
|
+
|
|
3
|
+
MCP server for [Verdo](https://verdo.ink) team decisions. Lets Claude Desktop,
|
|
4
|
+
Claude Code, and other MCP clients create, check, close, and manage team
|
|
5
|
+
decisions programmatically.
|
|
6
|
+
|
|
7
|
+
## Setup
|
|
8
|
+
|
|
9
|
+
1. Get a Verdo API key: **verdo.ink/dashboard/settings → API Keys → Create**
|
|
10
|
+
2. Save it:
|
|
11
|
+
```bash
|
|
12
|
+
mkdir -p ~/.verdo-mcp
|
|
13
|
+
echo "YOUR_KEY_HERE" > ~/.verdo-mcp/api_key
|
|
14
|
+
chmod 600 ~/.verdo-mcp/api_key
|
|
15
|
+
```
|
|
16
|
+
3. Add to your Claude Desktop config (`claude_desktop_config.json`):
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"verdo": {
|
|
21
|
+
"command": "npx",
|
|
22
|
+
"args": ["-y", "verdo-mcp"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Tools
|
|
29
|
+
|
|
30
|
+
| Tool | Description |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `create_decision` | Create a team decision with title, options, method, deadline, and participants |
|
|
33
|
+
| `check_decision` | Check status, votes, and outcome of a decision |
|
|
34
|
+
| `list_decisions` | List or search decisions in the workspace |
|
|
35
|
+
| `close_decision` | Close a decision now, with optional winner override |
|
|
36
|
+
| `add_participants` | Add voters to an active decision by email |
|
|
37
|
+
|
|
38
|
+
## Decision methods
|
|
39
|
+
|
|
40
|
+
- **single_choice** — each voter picks one option (default)
|
|
41
|
+
- **ranked_choice** — voters rank options by preference
|
|
42
|
+
- **approval** — voters approve any number of options
|
|
43
|
+
- **dot_voting** — voters distribute a fixed number of dots
|
|
44
|
+
|
|
45
|
+
## Authority modes
|
|
46
|
+
|
|
47
|
+
- **majority** — the option with the most votes wins (default)
|
|
48
|
+
- **unanimous** — all voters must agree
|
|
49
|
+
- **owner_decides** — the workspace owner makes the final call
|
|
50
|
+
- **approver** — designated approver(s) must sign off (Pro/Business)
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Verdo MCP server, stdio transport, for Claude Desktop and Claude Code.
|
|
3
|
+
// Auth: workspace API key stored at ~/.verdo-mcp/api_key (one key, no quotes).
|
|
4
|
+
// The server wraps the Zapier REST API (verdo.ink/api/zapier/*).
|
|
5
|
+
import { readFile } from "node:fs/promises";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
9
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
11
|
+
import { addParticipantsTool, checkDecision, closeDecision, createDecision, listDecisions, toolDefinitions, } from "./tools.js";
|
|
12
|
+
const KEY_FILE = join(homedir(), ".verdo-mcp", "api_key");
|
|
13
|
+
const keyStore = {
|
|
14
|
+
async get() {
|
|
15
|
+
try {
|
|
16
|
+
const key = (await readFile(KEY_FILE, "utf8")).trim();
|
|
17
|
+
return key.length > 0 ? key : null;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return null; // no file yet
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
const server = new Server({ name: "verdo-team-decisions", version: "1.0.0" }, { capabilities: { tools: {} } });
|
|
25
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
26
|
+
tools: toolDefinitions(),
|
|
27
|
+
}));
|
|
28
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
29
|
+
const { name, arguments: args } = request.params;
|
|
30
|
+
const a = (args ?? {});
|
|
31
|
+
switch (name) {
|
|
32
|
+
case "create_decision":
|
|
33
|
+
return createDecision({
|
|
34
|
+
title: String(a.title ?? ""),
|
|
35
|
+
options: a.options ?? [],
|
|
36
|
+
method: a.method,
|
|
37
|
+
deadline_hours: a.deadline_hours,
|
|
38
|
+
authority_mode: a.authority_mode,
|
|
39
|
+
participants: a.participants,
|
|
40
|
+
anonymous: a.anonymous,
|
|
41
|
+
}, keyStore);
|
|
42
|
+
case "check_decision":
|
|
43
|
+
return checkDecision({ id: String(a.id ?? "") }, keyStore);
|
|
44
|
+
case "list_decisions":
|
|
45
|
+
return listDecisions({ query: a.query }, keyStore);
|
|
46
|
+
case "close_decision":
|
|
47
|
+
return closeDecision({ id: String(a.id ?? ""), winner_option_id: a.winner_option_id }, keyStore);
|
|
48
|
+
case "add_participants":
|
|
49
|
+
return addParticipantsTool({ id: String(a.id ?? ""), emails: a.emails ?? [] }, keyStore);
|
|
50
|
+
default:
|
|
51
|
+
return { content: [{ type: "text", text: `Unknown tool: ${name}` }], isError: true };
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
async function main() {
|
|
55
|
+
await server.connect(new StdioServerTransport());
|
|
56
|
+
}
|
|
57
|
+
main().catch((err) => {
|
|
58
|
+
console.error(err);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
});
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
export type ApiKeyStore = {
|
|
2
|
+
get(): Promise<string | null>;
|
|
3
|
+
};
|
|
4
|
+
type Text = {
|
|
5
|
+
content: {
|
|
6
|
+
type: "text";
|
|
7
|
+
text: string;
|
|
8
|
+
}[];
|
|
9
|
+
isError?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function createDecision(args: {
|
|
12
|
+
title: string;
|
|
13
|
+
options: string[];
|
|
14
|
+
method?: string;
|
|
15
|
+
deadline_hours?: number;
|
|
16
|
+
authority_mode?: string;
|
|
17
|
+
participants?: string[];
|
|
18
|
+
anonymous?: boolean;
|
|
19
|
+
}, store: ApiKeyStore): Promise<Text>;
|
|
20
|
+
export declare function checkDecision(args: {
|
|
21
|
+
id: string;
|
|
22
|
+
}, store: ApiKeyStore): Promise<Text>;
|
|
23
|
+
export declare function listDecisions(args: {
|
|
24
|
+
query?: string;
|
|
25
|
+
}, store: ApiKeyStore): Promise<Text>;
|
|
26
|
+
export declare function closeDecision(args: {
|
|
27
|
+
id: string;
|
|
28
|
+
winner_option_id?: string;
|
|
29
|
+
}, store: ApiKeyStore): Promise<Text>;
|
|
30
|
+
export declare function addParticipantsTool(args: {
|
|
31
|
+
id: string;
|
|
32
|
+
emails: string[];
|
|
33
|
+
}, store: ApiKeyStore): Promise<Text>;
|
|
34
|
+
export declare function toolDefinitions(): ({
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
annotations: {
|
|
38
|
+
title: string;
|
|
39
|
+
readOnlyHint: boolean;
|
|
40
|
+
destructiveHint: boolean;
|
|
41
|
+
idempotentHint: boolean;
|
|
42
|
+
openWorldHint: boolean;
|
|
43
|
+
};
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: "object";
|
|
46
|
+
required: string[];
|
|
47
|
+
properties: {
|
|
48
|
+
title: {
|
|
49
|
+
type: string;
|
|
50
|
+
maxLength: number;
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
options: {
|
|
54
|
+
type: string;
|
|
55
|
+
minItems: number;
|
|
56
|
+
maxItems: number;
|
|
57
|
+
items: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
method: {
|
|
63
|
+
type: string;
|
|
64
|
+
enum: string[];
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
deadline_hours: {
|
|
68
|
+
type: string;
|
|
69
|
+
minimum: number;
|
|
70
|
+
maximum: number;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
authority_mode: {
|
|
74
|
+
type: string;
|
|
75
|
+
enum: string[];
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
participants: {
|
|
79
|
+
type: string;
|
|
80
|
+
items: {
|
|
81
|
+
type: string;
|
|
82
|
+
format: string;
|
|
83
|
+
};
|
|
84
|
+
description: string;
|
|
85
|
+
};
|
|
86
|
+
anonymous: {
|
|
87
|
+
type: string;
|
|
88
|
+
description: string;
|
|
89
|
+
};
|
|
90
|
+
id?: undefined;
|
|
91
|
+
query?: undefined;
|
|
92
|
+
winner_option_id?: undefined;
|
|
93
|
+
emails?: undefined;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
} | {
|
|
97
|
+
name: string;
|
|
98
|
+
description: string;
|
|
99
|
+
annotations: {
|
|
100
|
+
title: string;
|
|
101
|
+
readOnlyHint: boolean;
|
|
102
|
+
destructiveHint: boolean;
|
|
103
|
+
idempotentHint: boolean;
|
|
104
|
+
openWorldHint: boolean;
|
|
105
|
+
};
|
|
106
|
+
inputSchema: {
|
|
107
|
+
type: "object";
|
|
108
|
+
required: string[];
|
|
109
|
+
properties: {
|
|
110
|
+
id: {
|
|
111
|
+
type: string;
|
|
112
|
+
format: string;
|
|
113
|
+
description: string;
|
|
114
|
+
};
|
|
115
|
+
title?: undefined;
|
|
116
|
+
options?: undefined;
|
|
117
|
+
method?: undefined;
|
|
118
|
+
deadline_hours?: undefined;
|
|
119
|
+
authority_mode?: undefined;
|
|
120
|
+
participants?: undefined;
|
|
121
|
+
anonymous?: undefined;
|
|
122
|
+
query?: undefined;
|
|
123
|
+
winner_option_id?: undefined;
|
|
124
|
+
emails?: undefined;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
} | {
|
|
128
|
+
name: string;
|
|
129
|
+
description: string;
|
|
130
|
+
annotations: {
|
|
131
|
+
title: string;
|
|
132
|
+
readOnlyHint: boolean;
|
|
133
|
+
destructiveHint: boolean;
|
|
134
|
+
idempotentHint: boolean;
|
|
135
|
+
openWorldHint: boolean;
|
|
136
|
+
};
|
|
137
|
+
inputSchema: {
|
|
138
|
+
type: "object";
|
|
139
|
+
properties: {
|
|
140
|
+
query: {
|
|
141
|
+
type: string;
|
|
142
|
+
description: string;
|
|
143
|
+
};
|
|
144
|
+
title?: undefined;
|
|
145
|
+
options?: undefined;
|
|
146
|
+
method?: undefined;
|
|
147
|
+
deadline_hours?: undefined;
|
|
148
|
+
authority_mode?: undefined;
|
|
149
|
+
participants?: undefined;
|
|
150
|
+
anonymous?: undefined;
|
|
151
|
+
id?: undefined;
|
|
152
|
+
winner_option_id?: undefined;
|
|
153
|
+
emails?: undefined;
|
|
154
|
+
};
|
|
155
|
+
required?: undefined;
|
|
156
|
+
};
|
|
157
|
+
} | {
|
|
158
|
+
name: string;
|
|
159
|
+
description: string;
|
|
160
|
+
annotations: {
|
|
161
|
+
title: string;
|
|
162
|
+
readOnlyHint: boolean;
|
|
163
|
+
destructiveHint: boolean;
|
|
164
|
+
idempotentHint: boolean;
|
|
165
|
+
openWorldHint: boolean;
|
|
166
|
+
};
|
|
167
|
+
inputSchema: {
|
|
168
|
+
type: "object";
|
|
169
|
+
required: string[];
|
|
170
|
+
properties: {
|
|
171
|
+
id: {
|
|
172
|
+
type: string;
|
|
173
|
+
format: string;
|
|
174
|
+
description: string;
|
|
175
|
+
};
|
|
176
|
+
winner_option_id: {
|
|
177
|
+
type: string;
|
|
178
|
+
format: string;
|
|
179
|
+
description: string;
|
|
180
|
+
};
|
|
181
|
+
title?: undefined;
|
|
182
|
+
options?: undefined;
|
|
183
|
+
method?: undefined;
|
|
184
|
+
deadline_hours?: undefined;
|
|
185
|
+
authority_mode?: undefined;
|
|
186
|
+
participants?: undefined;
|
|
187
|
+
anonymous?: undefined;
|
|
188
|
+
query?: undefined;
|
|
189
|
+
emails?: undefined;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
} | {
|
|
193
|
+
name: string;
|
|
194
|
+
description: string;
|
|
195
|
+
annotations: {
|
|
196
|
+
title: string;
|
|
197
|
+
readOnlyHint: boolean;
|
|
198
|
+
destructiveHint: boolean;
|
|
199
|
+
idempotentHint: boolean;
|
|
200
|
+
openWorldHint: boolean;
|
|
201
|
+
};
|
|
202
|
+
inputSchema: {
|
|
203
|
+
type: "object";
|
|
204
|
+
required: string[];
|
|
205
|
+
properties: {
|
|
206
|
+
id: {
|
|
207
|
+
type: string;
|
|
208
|
+
format: string;
|
|
209
|
+
description: string;
|
|
210
|
+
};
|
|
211
|
+
emails: {
|
|
212
|
+
type: string;
|
|
213
|
+
minItems: number;
|
|
214
|
+
items: {
|
|
215
|
+
type: string;
|
|
216
|
+
format: string;
|
|
217
|
+
};
|
|
218
|
+
description: string;
|
|
219
|
+
};
|
|
220
|
+
title?: undefined;
|
|
221
|
+
options?: undefined;
|
|
222
|
+
method?: undefined;
|
|
223
|
+
deadline_hours?: undefined;
|
|
224
|
+
authority_mode?: undefined;
|
|
225
|
+
participants?: undefined;
|
|
226
|
+
anonymous?: undefined;
|
|
227
|
+
query?: undefined;
|
|
228
|
+
winner_option_id?: undefined;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
})[];
|
|
232
|
+
export {};
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
// Verdo MCP tools — wraps the Zapier REST API (apps/verdo-web/app/api/zapier/*)
|
|
2
|
+
// with agent-friendly descriptions and error messages that help agents self-remedy.
|
|
3
|
+
const VERDO_API = process.env.VERDO_API_URL ?? "https://verdo.ink/api";
|
|
4
|
+
const text = (t, isError = false) => ({
|
|
5
|
+
content: [{ type: "text", text: t }],
|
|
6
|
+
...(isError ? { isError } : {}),
|
|
7
|
+
});
|
|
8
|
+
// ---- Shared fetch with auth + agent-friendly error formatting ----
|
|
9
|
+
async function verdoFetch(path, apiKey, init) {
|
|
10
|
+
const res = await fetch(`${VERDO_API}${path}`, {
|
|
11
|
+
...init,
|
|
12
|
+
headers: {
|
|
13
|
+
"Content-Type": "application/json",
|
|
14
|
+
Authorization: `Bearer ${apiKey}`,
|
|
15
|
+
"X-Verdo-Client": "mcp_stdio",
|
|
16
|
+
...(init?.headers ?? {}),
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const data = (await res.json().catch(() => ({})));
|
|
20
|
+
return { ok: res.ok, status: res.status, data };
|
|
21
|
+
}
|
|
22
|
+
function agentError(action, status, data) {
|
|
23
|
+
const raw = String(data.error ?? data.message ?? "unknown error");
|
|
24
|
+
// Enrich known error codes with remediation guidance
|
|
25
|
+
const hints = {
|
|
26
|
+
workspace_read_only: "This workspace's plan has lapsed (read-only). The workspace owner needs to reactivate at verdo.ink/dashboard/settings/billing.",
|
|
27
|
+
upgrade_required: "This feature requires a Pro or Business plan. The workspace owner can upgrade at verdo.ink/dashboard/settings/billing.",
|
|
28
|
+
"invalid or missing API key": "The API key is invalid or missing. Go to verdo.ink/dashboard/settings > API Keys > Create, then save the key to ~/.verdo-mcp/api_key (one key per line, no quotes).",
|
|
29
|
+
};
|
|
30
|
+
const enriched = hints[raw] ?? raw;
|
|
31
|
+
const retry = typeof data.retry_after_seconds === "number" ? ` (retry in ${data.retry_after_seconds}s)` : "";
|
|
32
|
+
if (status >= 500) {
|
|
33
|
+
return text(`Could not ${action}: internal error. This is not your fault. Try again in 30 seconds; if it persists, the service may be temporarily down.`, true);
|
|
34
|
+
}
|
|
35
|
+
return text(`Could not ${action}: ${enriched}${retry}`, true);
|
|
36
|
+
}
|
|
37
|
+
// ---- Tool implementations ----
|
|
38
|
+
export async function createDecision(args, store) {
|
|
39
|
+
const apiKey = await store.get();
|
|
40
|
+
if (!apiKey)
|
|
41
|
+
return noKeyError();
|
|
42
|
+
const { ok, status, data } = await verdoFetch("/zapier/decisions", apiKey, {
|
|
43
|
+
method: "POST",
|
|
44
|
+
body: JSON.stringify({
|
|
45
|
+
title: args.title,
|
|
46
|
+
options: args.options,
|
|
47
|
+
method: args.method ?? "single_choice",
|
|
48
|
+
deadline_hours: args.deadline_hours ?? 48,
|
|
49
|
+
authority_mode: args.authority_mode ?? "majority",
|
|
50
|
+
participants: args.participants ?? [],
|
|
51
|
+
anonymous: args.anonymous ?? false,
|
|
52
|
+
}),
|
|
53
|
+
});
|
|
54
|
+
if (!ok)
|
|
55
|
+
return agentError("create the decision", status, data);
|
|
56
|
+
const lines = [
|
|
57
|
+
`Decision created.`,
|
|
58
|
+
``,
|
|
59
|
+
`ID: ${data.id}`,
|
|
60
|
+
`Dashboard: ${data.url}`,
|
|
61
|
+
`Title: ${args.title}`,
|
|
62
|
+
`Options: ${args.options.join(", ")}`,
|
|
63
|
+
`Method: ${args.method ?? "single_choice"}`,
|
|
64
|
+
`Deadline: ${args.deadline_hours ?? 48} hours from now`,
|
|
65
|
+
];
|
|
66
|
+
if (args.participants?.length) {
|
|
67
|
+
lines.push(`Participants: ${args.participants.join(", ")}`);
|
|
68
|
+
}
|
|
69
|
+
lines.push(``, `Use check_decision with id "${data.id}" to see vote progress.`);
|
|
70
|
+
return text(lines.join("\n"));
|
|
71
|
+
}
|
|
72
|
+
export async function checkDecision(args, store) {
|
|
73
|
+
const apiKey = await store.get();
|
|
74
|
+
if (!apiKey)
|
|
75
|
+
return noKeyError();
|
|
76
|
+
const { ok, status, data } = await verdoFetch(`/zapier/decisions/${encodeURIComponent(args.id)}`, apiKey);
|
|
77
|
+
if (!ok)
|
|
78
|
+
return agentError("read the decision", status, data);
|
|
79
|
+
const d = data.decision;
|
|
80
|
+
if (!d)
|
|
81
|
+
return text("Decision data not available.", true);
|
|
82
|
+
return text(formatDecision(d));
|
|
83
|
+
}
|
|
84
|
+
export async function listDecisions(args, store) {
|
|
85
|
+
const apiKey = await store.get();
|
|
86
|
+
if (!apiKey)
|
|
87
|
+
return noKeyError();
|
|
88
|
+
const qs = args.query ? `?query=${encodeURIComponent(args.query)}` : "";
|
|
89
|
+
const { ok, status, data } = await verdoFetch(`/zapier/decisions/search${qs}`, apiKey);
|
|
90
|
+
if (!ok)
|
|
91
|
+
return agentError("list decisions", status, data);
|
|
92
|
+
const decisions = (data.decisions ?? []);
|
|
93
|
+
if (decisions.length === 0) {
|
|
94
|
+
return text(args.query ? `No decisions found matching "${args.query}".` : "No decisions in this workspace.");
|
|
95
|
+
}
|
|
96
|
+
const lines = [`${decisions.length} decision${decisions.length === 1 ? "" : "s"} found:`, ``];
|
|
97
|
+
for (const d of decisions) {
|
|
98
|
+
lines.push(`- [${d.status}] ${d.title} (id: ${d.id})`);
|
|
99
|
+
}
|
|
100
|
+
return text(lines.join("\n"));
|
|
101
|
+
}
|
|
102
|
+
export async function closeDecision(args, store) {
|
|
103
|
+
const apiKey = await store.get();
|
|
104
|
+
if (!apiKey)
|
|
105
|
+
return noKeyError();
|
|
106
|
+
const { ok, status, data } = await verdoFetch(`/zapier/decisions/${encodeURIComponent(args.id)}/close`, apiKey, {
|
|
107
|
+
method: "POST",
|
|
108
|
+
body: JSON.stringify(args.winner_option_id ? { winner_option_id: args.winner_option_id } : {}),
|
|
109
|
+
});
|
|
110
|
+
if (!ok)
|
|
111
|
+
return agentError("close the decision", status, data);
|
|
112
|
+
const d = data.decision;
|
|
113
|
+
if (!d)
|
|
114
|
+
return text("Decision closed.", false);
|
|
115
|
+
return text(`Decision closed.\n\n${formatDecision(d)}`);
|
|
116
|
+
}
|
|
117
|
+
export async function addParticipantsTool(args, store) {
|
|
118
|
+
const apiKey = await store.get();
|
|
119
|
+
if (!apiKey)
|
|
120
|
+
return noKeyError();
|
|
121
|
+
const { ok, status, data } = await verdoFetch(`/zapier/decisions/${encodeURIComponent(args.id)}/participants`, apiKey, { method: "POST", body: JSON.stringify({ emails: args.emails }) });
|
|
122
|
+
if (!ok)
|
|
123
|
+
return agentError("add participants", status, data);
|
|
124
|
+
return text(`Added ${data.added ?? args.emails.length} participant${data.added === 1 ? "" : "s"} to the decision.`);
|
|
125
|
+
}
|
|
126
|
+
// ---- Helpers ----
|
|
127
|
+
function formatDecision(d) {
|
|
128
|
+
const lines = [
|
|
129
|
+
`Decision: ${d.title}`,
|
|
130
|
+
`Status: ${d.status ?? d.lifecycle_status}`,
|
|
131
|
+
`Method: ${d.method}`,
|
|
132
|
+
`ID: ${d.id}`,
|
|
133
|
+
];
|
|
134
|
+
if (d.deadline)
|
|
135
|
+
lines.push(`Deadline: ${d.deadline}`);
|
|
136
|
+
if (d.winner)
|
|
137
|
+
lines.push(`Winner: ${d.winner.label ?? d.winner}`);
|
|
138
|
+
if (d.outcome_status)
|
|
139
|
+
lines.push(`Outcome: ${d.outcome_status}`);
|
|
140
|
+
const options = d.options;
|
|
141
|
+
if (options?.length) {
|
|
142
|
+
lines.push(``, `Options:`);
|
|
143
|
+
for (const o of options) {
|
|
144
|
+
const votes = typeof o.vote_count === "number" ? ` (${o.vote_count} vote${o.vote_count === 1 ? "" : "s"})` : "";
|
|
145
|
+
lines.push(` - ${o.label}${votes}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
const participants = d.participants;
|
|
149
|
+
if (participants?.length) {
|
|
150
|
+
lines.push(``, `Participants: ${participants.map((p) => p.email ?? p.name).join(", ")}`);
|
|
151
|
+
}
|
|
152
|
+
if (d.url)
|
|
153
|
+
lines.push(``, `Dashboard: ${d.url}`);
|
|
154
|
+
return lines.join("\n");
|
|
155
|
+
}
|
|
156
|
+
function noKeyError() {
|
|
157
|
+
return text([
|
|
158
|
+
"No Verdo API key found. Set one up:",
|
|
159
|
+
"",
|
|
160
|
+
"1. Go to verdo.ink/dashboard/settings > API Keys > Create",
|
|
161
|
+
"2. Copy the key (shown once)",
|
|
162
|
+
"3. Save it to ~/.verdo-mcp/api_key",
|
|
163
|
+
"",
|
|
164
|
+
"The file should contain just the API key, nothing else.",
|
|
165
|
+
].join("\n"), true);
|
|
166
|
+
}
|
|
167
|
+
// ---- Tool definitions ----
|
|
168
|
+
export function toolDefinitions() {
|
|
169
|
+
return [
|
|
170
|
+
{
|
|
171
|
+
name: "create_decision",
|
|
172
|
+
description: "Create a Verdo team decision. Returns a dashboard link and decision ID. Participants receive email notifications to vote. Supports single-choice, ranked-choice, approval, and dot voting methods.",
|
|
173
|
+
annotations: {
|
|
174
|
+
title: "Create Decision",
|
|
175
|
+
readOnlyHint: false,
|
|
176
|
+
destructiveHint: false,
|
|
177
|
+
idempotentHint: false,
|
|
178
|
+
openWorldHint: true,
|
|
179
|
+
},
|
|
180
|
+
inputSchema: {
|
|
181
|
+
type: "object",
|
|
182
|
+
required: ["title", "options"],
|
|
183
|
+
properties: {
|
|
184
|
+
title: { type: "string", maxLength: 140, description: "The decision question (max 140 characters)" },
|
|
185
|
+
options: {
|
|
186
|
+
type: "array",
|
|
187
|
+
minItems: 2,
|
|
188
|
+
maxItems: 10,
|
|
189
|
+
items: { type: "string" },
|
|
190
|
+
description: "2-10 options to vote on",
|
|
191
|
+
},
|
|
192
|
+
method: {
|
|
193
|
+
type: "string",
|
|
194
|
+
enum: ["single_choice", "ranked_choice", "approval", "dot_voting"],
|
|
195
|
+
description: "Voting method. Default: single_choice",
|
|
196
|
+
},
|
|
197
|
+
deadline_hours: {
|
|
198
|
+
type: "integer",
|
|
199
|
+
minimum: 1,
|
|
200
|
+
maximum: 720,
|
|
201
|
+
description: "Hours until the decision closes. Default 48, max 720 (30 days).",
|
|
202
|
+
},
|
|
203
|
+
authority_mode: {
|
|
204
|
+
type: "string",
|
|
205
|
+
enum: ["majority", "unanimous", "owner_decides", "approver"],
|
|
206
|
+
description: "How the winner is determined. Default: majority",
|
|
207
|
+
},
|
|
208
|
+
participants: {
|
|
209
|
+
type: "array",
|
|
210
|
+
items: { type: "string", format: "email" },
|
|
211
|
+
description: "Email addresses of people who should vote. They receive an email notification.",
|
|
212
|
+
},
|
|
213
|
+
anonymous: {
|
|
214
|
+
type: "boolean",
|
|
215
|
+
description: "Whether votes are anonymous. Default: false",
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: "check_decision",
|
|
222
|
+
description: "Check the status, votes, and outcome of a Verdo decision. Returns the full decision state including vote counts per option, participants, and winner (if decided).",
|
|
223
|
+
annotations: {
|
|
224
|
+
title: "Check Decision",
|
|
225
|
+
readOnlyHint: true,
|
|
226
|
+
destructiveHint: false,
|
|
227
|
+
idempotentHint: true,
|
|
228
|
+
openWorldHint: false,
|
|
229
|
+
},
|
|
230
|
+
inputSchema: {
|
|
231
|
+
type: "object",
|
|
232
|
+
required: ["id"],
|
|
233
|
+
properties: {
|
|
234
|
+
id: { type: "string", format: "uuid", description: "The decision ID from create_decision" },
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "list_decisions",
|
|
240
|
+
description: "List or search decisions in the workspace. Returns up to 25 decisions with their status and title. Use the query parameter to search by title.",
|
|
241
|
+
annotations: {
|
|
242
|
+
title: "List Decisions",
|
|
243
|
+
readOnlyHint: true,
|
|
244
|
+
destructiveHint: false,
|
|
245
|
+
idempotentHint: true,
|
|
246
|
+
openWorldHint: false,
|
|
247
|
+
},
|
|
248
|
+
inputSchema: {
|
|
249
|
+
type: "object",
|
|
250
|
+
properties: {
|
|
251
|
+
query: { type: "string", description: "Search term to filter decisions by title (optional)" },
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: "close_decision",
|
|
257
|
+
description: "Close a Verdo decision now, before its deadline. Optionally override the winner with a specific option ID. The decision transitions to 'decided' and participants are notified.",
|
|
258
|
+
annotations: {
|
|
259
|
+
title: "Close Decision",
|
|
260
|
+
readOnlyHint: false,
|
|
261
|
+
destructiveHint: true,
|
|
262
|
+
idempotentHint: true,
|
|
263
|
+
openWorldHint: false,
|
|
264
|
+
},
|
|
265
|
+
inputSchema: {
|
|
266
|
+
type: "object",
|
|
267
|
+
required: ["id"],
|
|
268
|
+
properties: {
|
|
269
|
+
id: { type: "string", format: "uuid", description: "The decision ID to close" },
|
|
270
|
+
winner_option_id: {
|
|
271
|
+
type: "string",
|
|
272
|
+
format: "uuid",
|
|
273
|
+
description: "Override the winner with this option ID (from check_decision). Omit to use the leading option.",
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: "add_participants",
|
|
280
|
+
description: "Add voters to an active Verdo decision by email. New participants receive an email notification to vote. Cannot add to a closed decision.",
|
|
281
|
+
annotations: {
|
|
282
|
+
title: "Add Participants",
|
|
283
|
+
readOnlyHint: false,
|
|
284
|
+
destructiveHint: false,
|
|
285
|
+
idempotentHint: true,
|
|
286
|
+
openWorldHint: true,
|
|
287
|
+
},
|
|
288
|
+
inputSchema: {
|
|
289
|
+
type: "object",
|
|
290
|
+
required: ["id", "emails"],
|
|
291
|
+
properties: {
|
|
292
|
+
id: { type: "string", format: "uuid", description: "The decision ID" },
|
|
293
|
+
emails: {
|
|
294
|
+
type: "array",
|
|
295
|
+
minItems: 1,
|
|
296
|
+
items: { type: "string", format: "email" },
|
|
297
|
+
description: "Email addresses of people to add as voters",
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
];
|
|
303
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "verdo-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "verdo-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Claude MCP server for Verdo team decisions",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"verdo-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=18"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"start": "node dist/index.js",
|
|
19
|
+
"test": "vitest run"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@modelcontextprotocol/sdk": "1.31.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "20.19.41",
|
|
26
|
+
"typescript": "5.6.3",
|
|
27
|
+
"vitest": "^4.1.10"
|
|
28
|
+
},
|
|
29
|
+
"keywords": ["mcp", "verdo", "team-decisions", "approvals", "slack"],
|
|
30
|
+
"license": "MIT"
|
|
31
|
+
}
|