@anticeil/mcp 1.0.0 → 1.1.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 (2) hide show
  1. package/dist/index.js +632 -260
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ #!/usr/bin/env node
2
3
 
3
4
  "use strict";
4
5
 
@@ -6,280 +7,651 @@
6
7
  var import_server = require("@modelcontextprotocol/sdk/server/index.js");
7
8
  var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
8
9
  var import_types = require("@modelcontextprotocol/sdk/types.js");
9
- var import_sdk = require("@anticeil/sdk");
10
- var ANTICEIL_BASE_URL = process.env.ANTICEIL_BASE_URL || "https://app.anticeil.com";
10
+
11
+ // src/api.ts
12
+ var ANTICEIL_BASE_URL = (process.env.ANTICEIL_BASE_URL || "https://app.anticeil.com").replace(/\/+$/, "");
11
13
  var ANTICEIL_API_KEY = process.env.ANTICEIL_API_KEY || process.env.ANTICEIL_TOKEN || "";
12
- var client = new import_sdk.AnticeilClient({
13
- baseUrl: ANTICEIL_BASE_URL,
14
- apiKey: ANTICEIL_API_KEY,
15
- autoConnect: false
16
- });
17
- var server = new import_server.Server(
14
+ async function anticeilRequest(endpoint, options = {}) {
15
+ const path = endpoint.startsWith("/") ? endpoint : `/${endpoint}`;
16
+ const url = `${ANTICEIL_BASE_URL}${path}`;
17
+ const headers = new Headers(options.headers);
18
+ if (ANTICEIL_API_KEY) {
19
+ headers.set("Authorization", `Bearer ${ANTICEIL_API_KEY}`);
20
+ headers.set("X-Anticeil-Api-Key", ANTICEIL_API_KEY);
21
+ }
22
+ if (!headers.has("Content-Type")) {
23
+ headers.set("Content-Type", "application/json");
24
+ }
25
+ const res = await fetch(url, { ...options, headers });
26
+ if (!res.ok) {
27
+ const errorText = await res.text().catch(() => res.statusText);
28
+ throw new Error(`Anticeil API Error [${res.status}] ${path}: ${errorText}`);
29
+ }
30
+ const text = await res.text();
31
+ if (!text) return {};
32
+ try {
33
+ return JSON.parse(text);
34
+ } catch {
35
+ return text;
36
+ }
37
+ }
38
+ async function postWebhook(webhookUrl, payload) {
39
+ const res = await fetch(webhookUrl, {
40
+ method: "POST",
41
+ headers: { "Content-Type": "application/json" },
42
+ body: JSON.stringify(payload)
43
+ });
44
+ if (!res.ok) {
45
+ throw new Error(`Webhook Error [${res.status}]: ${await res.text()}`);
46
+ }
47
+ return { success: true };
48
+ }
49
+
50
+ // src/tools.ts
51
+ var json = (data) => JSON.stringify(data, null, 2);
52
+ var MCP_TOOLS = [
53
+ // ── 1. COLONIES (WORKSPACES) ──────────────────────────────────────────
18
54
  {
19
- name: "anticeil-mcp",
20
- version: "1.0.0"
55
+ name: "anticeil_list_colonies",
56
+ description: "List all colonies (servers/workspaces) accessible by the current Anticeil credentials.",
57
+ inputSchema: { type: "object", properties: {} },
58
+ handler: async () => anticeilRequest("/api/v1/community/hubs")
21
59
  },
22
60
  {
23
- capabilities: {
24
- tools: {}
61
+ name: "anticeil_create_colony",
62
+ description: "Create a new Anticeil colony (server/workspace).",
63
+ inputSchema: {
64
+ type: "object",
65
+ properties: {
66
+ name: { type: "string", description: "Colony display name." },
67
+ description: { type: "string", description: "Optional colony description." },
68
+ category: { type: "string", description: "Optional category slug (e.g. gaming, dev, education)." }
69
+ },
70
+ required: ["name"]
71
+ },
72
+ handler: async (args) => anticeilRequest("/api/v1/community/hubs", {
73
+ method: "POST",
74
+ body: json(args)
75
+ })
76
+ },
77
+ {
78
+ name: "anticeil_update_colony",
79
+ description: "Update an existing colony name, description, or icon.",
80
+ inputSchema: {
81
+ type: "object",
82
+ properties: {
83
+ colonyId: { type: "string", description: "Target colony ID." },
84
+ name: { type: "string" },
85
+ description: { type: "string" },
86
+ icon: { type: "string" }
87
+ },
88
+ required: ["colonyId"]
89
+ },
90
+ handler: async ({ colonyId, ...updates }) => anticeilRequest(`/api/v1/community/hubs/${colonyId}`, {
91
+ method: "PUT",
92
+ body: json(updates)
93
+ })
94
+ },
95
+ {
96
+ name: "anticeil_delete_colony",
97
+ description: "Delete a colony permanently.",
98
+ inputSchema: {
99
+ type: "object",
100
+ properties: { colonyId: { type: "string", description: "Target colony ID." } },
101
+ required: ["colonyId"]
102
+ },
103
+ handler: async ({ colonyId }) => anticeilRequest(`/api/v1/community/hubs/${colonyId}`, { method: "DELETE" })
104
+ },
105
+ {
106
+ name: "anticeil_set_privacy",
107
+ description: "Update the privacy, join method, and screening rules of a colony.",
108
+ inputSchema: {
109
+ type: "object",
110
+ properties: {
111
+ colonyId: { type: "string", description: "Target colony ID." },
112
+ isPrivate: { type: "boolean", description: "True for invite_only, false for discoverable." },
113
+ rulesEnabled: { type: "boolean", description: "Require screening rules acknowledgement." }
114
+ },
115
+ required: ["colonyId", "isPrivate"]
116
+ },
117
+ handler: async ({ colonyId, isPrivate, rulesEnabled = false }) => anticeilRequest(`/api/v1/colonies/${colonyId}/access`, {
118
+ method: "PUT",
119
+ body: json({
120
+ joinMethod: isPrivate ? "invite_only" : "discoverable",
121
+ visibility: isPrivate ? "private" : "public",
122
+ rulesEnabled
123
+ })
124
+ })
125
+ },
126
+ {
127
+ name: "anticeil_get_colony_insights",
128
+ description: "Fetch member growth, activity stats, and insights for a colony.",
129
+ inputSchema: {
130
+ type: "object",
131
+ properties: { colonyId: { type: "string", description: "Target colony ID." } },
132
+ required: ["colonyId"]
133
+ },
134
+ handler: async ({ colonyId }) => anticeilRequest(`/api/v1/colonies/${colonyId}/insights`)
135
+ },
136
+ // ── 2. CHANNELS ───────────────────────────────────────────────────────
137
+ {
138
+ name: "anticeil_list_channels",
139
+ description: "List all text, voice, kanban, and forum channels inside an Anticeil colony.",
140
+ inputSchema: {
141
+ type: "object",
142
+ properties: { colonyId: { type: "string", description: "Colony ID." } },
143
+ required: ["colonyId"]
144
+ },
145
+ handler: async ({ colonyId }) => anticeilRequest(`/api/v1/community/channels?colonyId=${encodeURIComponent(colonyId)}`)
146
+ },
147
+ {
148
+ name: "anticeil_create_channel",
149
+ description: "Create a new channel (text, voice, announcement, kanban, forum) in a colony.",
150
+ inputSchema: {
151
+ type: "object",
152
+ properties: {
153
+ colonyId: { type: "string" },
154
+ name: { type: "string" },
155
+ type: { type: "string", enum: ["text", "voice", "announcement", "kanban", "forum"] },
156
+ topic: { type: "string" },
157
+ categoryId: { type: "string" }
158
+ },
159
+ required: ["colonyId", "name"]
160
+ },
161
+ handler: async (args) => anticeilRequest("/api/v1/community/channels", {
162
+ method: "POST",
163
+ body: json({ type: "text", ...args })
164
+ })
165
+ },
166
+ {
167
+ name: "anticeil_update_channel",
168
+ description: "Rename or update topic/settings of an existing channel.",
169
+ inputSchema: {
170
+ type: "object",
171
+ properties: {
172
+ channelId: { type: "string" },
173
+ name: { type: "string" },
174
+ topic: { type: "string" }
175
+ },
176
+ required: ["channelId"]
177
+ },
178
+ handler: async ({ channelId, ...updates }) => anticeilRequest(`/api/v1/community/channels/${channelId}`, {
179
+ method: "PUT",
180
+ body: json(updates)
181
+ })
182
+ },
183
+ {
184
+ name: "anticeil_delete_channel",
185
+ description: "Delete a channel by ID.",
186
+ inputSchema: {
187
+ type: "object",
188
+ properties: { channelId: { type: "string" } },
189
+ required: ["channelId"]
190
+ },
191
+ handler: async ({ channelId }) => anticeilRequest(`/api/v1/community/channels/${channelId}`, { method: "DELETE" })
192
+ },
193
+ // ── 3. MESSAGES, THREADS, PINS & REACTIONS ────────────────────────────
194
+ {
195
+ name: "anticeil_get_messages",
196
+ description: "Fetch recent messages from an Anticeil channel or DM.",
197
+ inputSchema: {
198
+ type: "object",
199
+ properties: {
200
+ channelId: { type: "string" },
201
+ limit: { type: "number", description: "Max messages (default 30, max 100)." }
202
+ },
203
+ required: ["channelId"]
204
+ },
205
+ handler: async ({ channelId, limit = 30 }) => anticeilRequest(`/api/v1/community/channels/${channelId}/messages?limit=${limit}`)
206
+ },
207
+ {
208
+ name: "anticeil_send_message",
209
+ description: "Send a markdown message to an Anticeil channel or DM.",
210
+ inputSchema: {
211
+ type: "object",
212
+ properties: {
213
+ channelId: { type: "string" },
214
+ content: { type: "string" },
215
+ replyToId: { type: "string" }
216
+ },
217
+ required: ["channelId", "content"]
218
+ },
219
+ handler: async ({ channelId, content, replyToId }) => anticeilRequest(`/api/v1/community/channels/${channelId}/messages`, {
220
+ method: "POST",
221
+ body: json({ content, replyToId })
222
+ })
223
+ },
224
+ {
225
+ name: "anticeil_delete_message",
226
+ description: "Delete a message by ID.",
227
+ inputSchema: {
228
+ type: "object",
229
+ properties: { messageId: { type: "string" } },
230
+ required: ["messageId"]
231
+ },
232
+ handler: async ({ messageId }) => anticeilRequest(`/api/v1/community/messages/${messageId}`, { method: "DELETE" })
233
+ },
234
+ {
235
+ name: "anticeil_toggle_reaction",
236
+ description: "Add or toggle an emoji reaction on a message.",
237
+ inputSchema: {
238
+ type: "object",
239
+ properties: {
240
+ messageId: { type: "string" },
241
+ emoji: { type: "string", description: "Emoji character, e.g. \u{1F44D} or \u{1F680}." }
242
+ },
243
+ required: ["messageId", "emoji"]
244
+ },
245
+ handler: async ({ messageId, emoji }) => anticeilRequest(`/api/v1/community/messages/${messageId}/reactions`, {
246
+ method: "POST",
247
+ body: json({ emoji })
248
+ })
249
+ },
250
+ {
251
+ name: "anticeil_toggle_pin",
252
+ description: "Pin or unpin a message in a channel.",
253
+ inputSchema: {
254
+ type: "object",
255
+ properties: {
256
+ messageId: { type: "string" },
257
+ channelId: { type: "string" }
258
+ },
259
+ required: ["messageId"]
260
+ },
261
+ handler: async ({ messageId, channelId }) => anticeilRequest(`/api/v1/community/messages/${messageId}/pin`, {
262
+ method: "POST",
263
+ body: json({ channelId })
264
+ })
265
+ },
266
+ {
267
+ name: "anticeil_list_threads",
268
+ description: "List all discussion threads inside a channel.",
269
+ inputSchema: {
270
+ type: "object",
271
+ properties: { channelId: { type: "string" } },
272
+ required: ["channelId"]
273
+ },
274
+ handler: async ({ channelId }) => anticeilRequest(`/api/v1/community/channels/${channelId}/threads`)
275
+ },
276
+ {
277
+ name: "anticeil_create_thread",
278
+ description: "Create a new discussion thread inside a channel.",
279
+ inputSchema: {
280
+ type: "object",
281
+ properties: {
282
+ channelId: { type: "string" },
283
+ name: { type: "string", description: "Thread title." },
284
+ messageId: { type: "string", description: "Optional source message ID." }
285
+ },
286
+ required: ["channelId", "name"]
287
+ },
288
+ handler: async ({ channelId, name, messageId }) => anticeilRequest(`/api/v1/community/channels/${channelId}/threads`, {
289
+ method: "POST",
290
+ body: json({ name, messageId })
291
+ })
292
+ },
293
+ // ── 4. FRIENDS & MESSAGE REQUESTS ─────────────────────────────────────
294
+ {
295
+ name: "anticeil_list_friends",
296
+ description: "List all accepted friends and pending friend requests.",
297
+ inputSchema: { type: "object", properties: {} },
298
+ handler: async () => anticeilRequest("/api/v1/community/friends")
299
+ },
300
+ {
301
+ name: "anticeil_send_friend_request",
302
+ description: "Send a friend request to a user by username or email.",
303
+ inputSchema: {
304
+ type: "object",
305
+ properties: { target: { type: "string", description: "Username or user ID." } },
306
+ required: ["target"]
307
+ },
308
+ handler: async ({ target }) => anticeilRequest("/api/v1/community/friends/request", {
309
+ method: "POST",
310
+ body: json({ username: target, target })
311
+ })
312
+ },
313
+ {
314
+ name: "anticeil_list_message_requests",
315
+ description: "List incoming DM message requests.",
316
+ inputSchema: { type: "object", properties: {} },
317
+ handler: async () => anticeilRequest("/api/v1/community/message-requests")
318
+ },
319
+ {
320
+ name: "anticeil_respond_message_request",
321
+ description: "Accept, ignore, or mark an incoming DM message request as spam.",
322
+ inputSchema: {
323
+ type: "object",
324
+ properties: {
325
+ requestId: { type: "string" },
326
+ action: { type: "string", enum: ["accept", "ignore", "spam"] }
327
+ },
328
+ required: ["requestId", "action"]
329
+ },
330
+ handler: async ({ requestId, action }) => anticeilRequest(`/api/v1/community/message-requests/${requestId}/${action}`, {
331
+ method: "POST",
332
+ body: json({})
333
+ })
334
+ },
335
+ // ── 5. MEMBERS, ROLES, BANS & AUDIT LOGS ──────────────────────────────
336
+ {
337
+ name: "anticeil_list_members",
338
+ description: "List members in a colony or workspace.",
339
+ inputSchema: {
340
+ type: "object",
341
+ properties: { colonyId: { type: "string" } }
342
+ },
343
+ handler: async ({ colonyId }) => anticeilRequest(
344
+ colonyId ? `/api/v1/community/members?colonyId=${encodeURIComponent(colonyId)}` : "/api/v1/community/members"
345
+ )
346
+ },
347
+ {
348
+ name: "anticeil_list_roles",
349
+ description: "List all roles and permissions inside a colony.",
350
+ inputSchema: {
351
+ type: "object",
352
+ properties: { colonyId: { type: "string" } },
353
+ required: ["colonyId"]
354
+ },
355
+ handler: async ({ colonyId }) => anticeilRequest(`/api/v1/community/hubs/${colonyId}/roles`)
356
+ },
357
+ {
358
+ name: "anticeil_update_member_role",
359
+ description: "Assign or update a member role in a colony.",
360
+ inputSchema: {
361
+ type: "object",
362
+ properties: {
363
+ colonyId: { type: "string" },
364
+ userId: { type: "string" },
365
+ roleId: { type: "string" }
366
+ },
367
+ required: ["colonyId", "userId", "roleId"]
368
+ },
369
+ handler: async ({ colonyId, userId, roleId }) => anticeilRequest(`/api/v1/community/hubs/${colonyId}/members/${userId}/role`, {
370
+ method: "PUT",
371
+ body: json({ roleId })
372
+ })
373
+ },
374
+ {
375
+ name: "anticeil_manage_ban",
376
+ description: "Ban or unban a user in a colony.",
377
+ inputSchema: {
378
+ type: "object",
379
+ properties: {
380
+ colonyId: { type: "string" },
381
+ userId: { type: "string" },
382
+ action: { type: "string", enum: ["ban", "unban"] },
383
+ reason: { type: "string" }
384
+ },
385
+ required: ["colonyId", "userId", "action"]
386
+ },
387
+ handler: async ({ colonyId, userId, action, reason }) => action === "ban" ? anticeilRequest(`/api/v1/colonies/${colonyId}/bans`, {
388
+ method: "POST",
389
+ body: json({ userId, reason })
390
+ }) : anticeilRequest(`/api/v1/colonies/${colonyId}/bans/${userId}`, { method: "DELETE" })
391
+ },
392
+ {
393
+ name: "anticeil_get_audit_logs",
394
+ description: "Fetch moderation and administrative audit logs for a colony.",
395
+ inputSchema: {
396
+ type: "object",
397
+ properties: { colonyId: { type: "string" } },
398
+ required: ["colonyId"]
399
+ },
400
+ handler: async ({ colonyId }) => anticeilRequest(`/api/v1/colonies/${colonyId}/audit-logs`)
401
+ },
402
+ // ── 6. TASKS / KANBAN ASSIGNMENTS ─────────────────────────────────────
403
+ {
404
+ name: "anticeil_list_tasks",
405
+ description: "List all tasks/assignments across colonies or a specific Kanban channel.",
406
+ inputSchema: {
407
+ type: "object",
408
+ properties: {
409
+ colonyId: { type: "string" },
410
+ channelId: { type: "string" }
411
+ }
412
+ },
413
+ handler: async ({ colonyId, channelId }) => {
414
+ const params = new URLSearchParams();
415
+ if (colonyId) params.set("colonyId", colonyId);
416
+ if (channelId) params.set("channelId", channelId);
417
+ const qs = params.toString();
418
+ return anticeilRequest(`/api/v1/community/assignments${qs ? `?${qs}` : ""}`);
25
419
  }
26
- }
27
- );
28
- server.setRequestHandler(import_types.ListToolsRequestSchema, async () => {
29
- return {
30
- tools: [
31
- {
32
- name: "anticeil_list_colonies",
33
- description: "List all colonies (servers/workspaces) accessible by the current Anticeil credentials.",
34
- inputSchema: {
35
- type: "object",
36
- properties: {}
37
- }
420
+ },
421
+ {
422
+ name: "anticeil_create_task",
423
+ description: "Create a new task / Kanban assignment card.",
424
+ inputSchema: {
425
+ type: "object",
426
+ properties: {
427
+ title: { type: "string" },
428
+ description: { type: "string" },
429
+ columnId: { type: "string", enum: ["todo", "in_progress", "review", "done"] },
430
+ priority: { type: "string", enum: ["low", "medium", "high", "urgent"] },
431
+ colonyId: { type: "string" },
432
+ channelId: { type: "string" },
433
+ assigneeName: { type: "string" },
434
+ dueDate: { type: "string" }
38
435
  },
39
- {
40
- name: "anticeil_list_channels",
41
- description: "List all text and voice channels inside a specific Anticeil colony.",
42
- inputSchema: {
43
- type: "object",
44
- properties: {
45
- colonyId: {
46
- type: "string",
47
- description: "The unique ID or slug of the colony."
48
- }
49
- },
50
- required: ["colonyId"]
51
- }
436
+ required: ["title"]
437
+ },
438
+ handler: async (args) => anticeilRequest("/api/v1/community/assignments", {
439
+ method: "POST",
440
+ body: json({ columnId: "todo", priority: "medium", ...args })
441
+ })
442
+ },
443
+ {
444
+ name: "anticeil_update_task",
445
+ description: "Update a task title, priority, or move it between Kanban columns.",
446
+ inputSchema: {
447
+ type: "object",
448
+ properties: {
449
+ taskId: { type: "string" },
450
+ title: { type: "string" },
451
+ description: { type: "string" },
452
+ columnId: { type: "string", enum: ["todo", "in_progress", "review", "done"] },
453
+ priority: { type: "string", enum: ["low", "medium", "high", "urgent"] }
52
454
  },
53
- {
54
- name: "anticeil_send_message",
55
- description: "Send a message to an Anticeil text channel.",
56
- inputSchema: {
57
- type: "object",
58
- properties: {
59
- channelId: {
60
- type: "string",
61
- description: "The target channel ID."
62
- },
63
- content: {
64
- type: "string",
65
- description: "The markdown-formatted message content."
66
- },
67
- replyToId: {
68
- type: "string",
69
- description: "Optional parent message ID to reply to."
70
- }
71
- },
72
- required: ["channelId", "content"]
73
- }
455
+ required: ["taskId"]
456
+ },
457
+ handler: async ({ taskId, ...updates }) => anticeilRequest(`/api/v1/community/assignments/${taskId}`, {
458
+ method: "PUT",
459
+ body: json(updates)
460
+ })
461
+ },
462
+ {
463
+ name: "anticeil_delete_task",
464
+ description: "Delete a task / Kanban card by ID.",
465
+ inputSchema: {
466
+ type: "object",
467
+ properties: { taskId: { type: "string" } },
468
+ required: ["taskId"]
469
+ },
470
+ handler: async ({ taskId }) => anticeilRequest(`/api/v1/community/assignments/${taskId}`, { method: "DELETE" })
471
+ },
472
+ // ── 7. CALENDAR & COLONY EVENTS ───────────────────────────────────────
473
+ {
474
+ name: "anticeil_list_events",
475
+ description: "List scheduled calendar events and colony events.",
476
+ inputSchema: {
477
+ type: "object",
478
+ properties: { colonyId: { type: "string" } }
479
+ },
480
+ handler: async ({ colonyId }) => anticeilRequest(
481
+ colonyId ? `/api/v1/community/calendar/events?colonyId=${encodeURIComponent(colonyId)}` : "/api/v1/community/calendar/events"
482
+ )
483
+ },
484
+ {
485
+ name: "anticeil_create_event",
486
+ description: "Schedule a new calendar event or colony voice event.",
487
+ inputSchema: {
488
+ type: "object",
489
+ properties: {
490
+ title: { type: "string" },
491
+ description: { type: "string" },
492
+ startTime: { type: "string", description: "ISO 8601 datetime string." },
493
+ endTime: { type: "string", description: "ISO 8601 datetime string." },
494
+ colonyId: { type: "string" },
495
+ location: { type: "string" }
74
496
  },
75
- {
76
- name: "anticeil_get_messages",
77
- description: "Fetch recent messages from an Anticeil channel.",
78
- inputSchema: {
79
- type: "object",
80
- properties: {
81
- channelId: {
82
- type: "string",
83
- description: "The channel ID to fetch messages from."
84
- },
85
- limit: {
86
- type: "number",
87
- description: "Number of messages to retrieve (default: 30, max: 100)."
88
- }
89
- },
90
- required: ["channelId"]
91
- }
497
+ required: ["title", "startTime"]
498
+ },
499
+ handler: async (args) => anticeilRequest("/api/v1/community/calendar/events", {
500
+ method: "POST",
501
+ body: json(args)
502
+ })
503
+ },
504
+ {
505
+ name: "anticeil_update_event",
506
+ description: "Update an existing calendar event.",
507
+ inputSchema: {
508
+ type: "object",
509
+ properties: {
510
+ eventId: { type: "string" },
511
+ title: { type: "string" },
512
+ description: { type: "string" },
513
+ startTime: { type: "string" },
514
+ endTime: { type: "string" }
92
515
  },
93
- {
94
- name: "anticeil_set_privacy",
95
- description: "Update the privacy and visibility settings of a colony.",
96
- inputSchema: {
97
- type: "object",
98
- properties: {
99
- colonyId: {
100
- type: "string",
101
- description: "The colony ID."
102
- },
103
- isPrivate: {
104
- type: "boolean",
105
- description: "Whether the colony is restricted to invitees (invite_only) or public (discoverable)."
106
- },
107
- rulesEnabled: {
108
- type: "boolean",
109
- description: "Whether screening rules/guidelines must be acknowledged before joining."
110
- }
111
- },
112
- required: ["colonyId", "isPrivate"]
113
- }
516
+ required: ["eventId"]
517
+ },
518
+ handler: async ({ eventId, ...updates }) => anticeilRequest(`/api/v1/community/calendar/events/${eventId}`, {
519
+ method: "PUT",
520
+ body: json(updates)
521
+ })
522
+ },
523
+ {
524
+ name: "anticeil_delete_event",
525
+ description: "Cancel and delete a scheduled calendar event.",
526
+ inputSchema: {
527
+ type: "object",
528
+ properties: { eventId: { type: "string" } },
529
+ required: ["eventId"]
530
+ },
531
+ handler: async ({ eventId }) => anticeilRequest(`/api/v1/community/calendar/events/${eventId}`, { method: "DELETE" })
532
+ },
533
+ // ── 8. APPS, ACTIVITIES, WEBHOOKS & QUESTS ────────────────────────────
534
+ {
535
+ name: "anticeil_list_apps",
536
+ description: "List all available built-in and custom apps/activities in the Anticeil App Directory.",
537
+ inputSchema: { type: "object", properties: {} },
538
+ handler: async () => anticeilRequest("/api/v1/community/activities/catalog")
539
+ },
540
+ {
541
+ name: "anticeil_trigger_activity",
542
+ description: "Launch an embedded multiplayer app/activity (youtube, whiteboard, chess, tradingview, anticeil-flow, screenshare, or custom app ID) in a channel.",
543
+ inputSchema: {
544
+ type: "object",
545
+ properties: {
546
+ channelId: { type: "string", description: "Target voice or text channel ID." },
547
+ type: {
548
+ type: "string",
549
+ description: "Activity ID (e.g. youtube, excalidraw, chess, tradingview, anticeil-flow, screenshare, or custom app ID)."
550
+ },
551
+ title: { type: "string" }
114
552
  },
115
- {
116
- name: "anticeil_trigger_activity",
117
- description: "Launch an embedded multiplayer activity (Excalidraw, YouTube Watch Together, Chess) in a channel.",
118
- inputSchema: {
119
- type: "object",
120
- properties: {
121
- channelId: {
122
- type: "string",
123
- description: "The voice or text channel ID."
124
- },
125
- type: {
126
- type: "string",
127
- enum: ["excalidraw", "youtube", "chess"],
128
- description: "Type of activity to launch."
129
- },
130
- title: {
131
- type: "string",
132
- description: "Optional title or context for the session."
133
- }
134
- },
135
- required: ["channelId", "type"]
136
- }
553
+ required: ["channelId", "type"]
554
+ },
555
+ handler: async ({ channelId, type, title }) => anticeilRequest(`/api/channels/${channelId}/activity`, {
556
+ method: "POST",
557
+ body: json({ channelId, type, title })
558
+ })
559
+ },
560
+ {
561
+ name: "anticeil_install_colony_app",
562
+ description: "Install an application from the directory into a colony.",
563
+ inputSchema: {
564
+ type: "object",
565
+ properties: {
566
+ colonyId: { type: "string" },
567
+ appId: { type: "string" }
137
568
  },
138
- {
139
- name: "anticeil_post_webhook",
140
- description: "Post an automated notification or rich embed card via incoming webhook.",
141
- inputSchema: {
142
- type: "object",
143
- properties: {
144
- webhookUrl: {
145
- type: "string",
146
- description: "The webhook endpoint URL."
147
- },
148
- content: {
149
- type: "string",
150
- description: "Text message content."
151
- },
152
- username: {
153
- type: "string",
154
- description: "Custom bot or integration display name."
155
- },
156
- avatarUrl: {
157
- type: "string",
158
- description: "Custom bot avatar image URL."
159
- },
160
- embeds: {
161
- type: "array",
162
- items: {
163
- type: "object",
164
- properties: {
165
- title: { type: "string" },
166
- description: { type: "string" },
167
- color: { type: "string" },
168
- fields: {
169
- type: "array",
170
- items: {
171
- type: "object",
172
- properties: {
173
- name: { type: "string" },
174
- value: { type: "string" },
175
- inline: { type: "boolean" }
176
- },
177
- required: ["name", "value"]
178
- }
179
- }
180
- }
181
- },
182
- description: "List of rich embed cards."
183
- }
184
- },
185
- required: ["webhookUrl"]
186
- }
569
+ required: ["colonyId", "appId"]
570
+ },
571
+ handler: async ({ colonyId, appId }) => anticeilRequest(`/api/v1/colonies/${colonyId}/apps/${appId}/install`, {
572
+ method: "POST",
573
+ body: json({})
574
+ })
575
+ },
576
+ {
577
+ name: "anticeil_post_webhook",
578
+ description: "Post an automated notification or rich embed card via incoming webhook.",
579
+ inputSchema: {
580
+ type: "object",
581
+ properties: {
582
+ webhookUrl: { type: "string" },
583
+ content: { type: "string" },
584
+ username: { type: "string" },
585
+ avatarUrl: { type: "string" },
586
+ embeds: { type: "array", items: { type: "object" } }
587
+ },
588
+ required: ["webhookUrl"]
589
+ },
590
+ handler: async ({ webhookUrl, ...payload }) => postWebhook(webhookUrl, payload)
591
+ },
592
+ {
593
+ name: "anticeil_list_quests",
594
+ description: "List all active community quests and rewards.",
595
+ inputSchema: { type: "object", properties: {} },
596
+ handler: async () => anticeilRequest("/api/v1/community/quests")
597
+ },
598
+ {
599
+ name: "anticeil_manage_quest",
600
+ description: "Create, update, or delete a community quest.",
601
+ inputSchema: {
602
+ type: "object",
603
+ properties: {
604
+ action: { type: "string", enum: ["create", "update", "delete"] },
605
+ questId: { type: "string", description: "Required for update/delete." },
606
+ title: { type: "string" },
607
+ description: { type: "string" },
608
+ reward: { type: "string" }
609
+ },
610
+ required: ["action"]
611
+ },
612
+ handler: async ({ action, questId, ...body }) => {
613
+ if (action === "create") {
614
+ return anticeilRequest("/api/v1/community/quests", { method: "POST", body: json(body) });
187
615
  }
188
- ]
189
- };
190
- });
616
+ if (action === "update") {
617
+ return anticeilRequest(`/api/v1/community/quests/${questId}`, { method: "PUT", body: json(body) });
618
+ }
619
+ return anticeilRequest(`/api/v1/community/quests/${questId}`, { method: "DELETE" });
620
+ }
621
+ }
622
+ ];
623
+ var TOOL_HANDLERS = new Map(MCP_TOOLS.map((t) => [t.name, t.handler]));
624
+
625
+ // src/index.ts
626
+ var server = new import_server.Server(
627
+ {
628
+ name: "anticeil-mcp",
629
+ version: "1.1.0"
630
+ },
631
+ {
632
+ capabilities: {
633
+ tools: {}
634
+ }
635
+ }
636
+ );
637
+ server.setRequestHandler(import_types.ListToolsRequestSchema, async () => ({
638
+ tools: MCP_TOOLS.map(({ name, description, inputSchema }) => ({
639
+ name,
640
+ description,
641
+ inputSchema
642
+ }))
643
+ }));
191
644
  server.setRequestHandler(import_types.CallToolRequestSchema, async (req) => {
192
645
  const { name, arguments: args = {} } = req.params;
646
+ const handler = TOOL_HANDLERS.get(name);
647
+ if (!handler) {
648
+ throw new import_types.McpError(import_types.ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
649
+ }
193
650
  try {
194
- switch (name) {
195
- case "anticeil_list_colonies": {
196
- const colonies = await client.colonies.list();
197
- return {
198
- content: [{ type: "text", text: JSON.stringify(colonies, null, 2) }]
199
- };
200
- }
201
- case "anticeil_list_channels": {
202
- const { colonyId } = args;
203
- const channels = await client.channels.list(colonyId);
204
- return {
205
- content: [{ type: "text", text: JSON.stringify(channels, null, 2) }]
206
- };
207
- }
208
- case "anticeil_send_message": {
209
- const { channelId, content, replyToId } = args;
210
- const message = await client.messages.send(channelId, { content, replyToId });
211
- return {
212
- content: [
213
- {
214
- type: "text",
215
- text: `Message posted successfully:
216
- ${JSON.stringify(message, null, 2)}`
217
- }
218
- ]
219
- };
220
- }
221
- case "anticeil_get_messages": {
222
- const { channelId, limit = 30 } = args;
223
- const messages = await client.messages.list(channelId, limit);
224
- return {
225
- content: [{ type: "text", text: JSON.stringify(messages, null, 2) }]
226
- };
227
- }
228
- case "anticeil_set_privacy": {
229
- const { colonyId, isPrivate, rulesEnabled = false } = args;
230
- const updated = await client.colonies.setPrivacy(
231
- colonyId,
232
- isPrivate ? "invite_only" : "discoverable",
233
- { rulesEnabled }
234
- );
235
- return {
236
- content: [
237
- {
238
- type: "text",
239
- text: `Colony privacy updated successfully:
240
- ${JSON.stringify(updated, null, 2)}`
241
- }
242
- ]
243
- };
244
- }
245
- case "anticeil_trigger_activity": {
246
- const { channelId, type, title } = args;
247
- const activity = await client.activities.launch({
248
- channelId,
249
- type,
250
- title
251
- });
252
- return {
253
- content: [
254
- {
255
- type: "text",
256
- text: `Activity ${type} launched successfully:
257
- ${JSON.stringify(activity, null, 2)}`
258
- }
259
- ]
260
- };
261
- }
262
- case "anticeil_post_webhook": {
263
- const { webhookUrl, content, username, avatarUrl, embeds } = args;
264
- const res = await client.webhooks.send(webhookUrl, {
265
- content,
266
- username,
267
- avatarUrl,
268
- embeds
269
- });
270
- return {
271
- content: [
272
- {
273
- type: "text",
274
- text: `Webhook posted successfully:
275
- ${JSON.stringify(res, null, 2)}`
276
- }
277
- ]
278
- };
279
- }
280
- default:
281
- throw new import_types.McpError(import_types.ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
282
- }
651
+ const result = await handler(args);
652
+ return {
653
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
654
+ };
283
655
  } catch (err) {
284
656
  return {
285
657
  isError: true,
@@ -295,7 +667,7 @@ ${JSON.stringify(res, null, 2)}`
295
667
  async function main() {
296
668
  const transport = new import_stdio.StdioServerTransport();
297
669
  await server.connect(transport);
298
- console.error("Anticeil MCP Server running on stdio");
670
+ console.error(`Anticeil MCP Server running on stdio (${MCP_TOOLS.length} tools)`);
299
671
  }
300
672
  main().catch((err) => {
301
673
  console.error("Fatal error running Anticeil MCP Server:", err);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@anticeil/mcp",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Model Context Protocol (MCP) server for Anticeil Chat, Voice, Activities, and Bot Platform",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
- "anticeil-mcp": "./dist/index.js"
7
+ "anticeil-mcp": "dist/index.js"
8
8
  },
9
9
  "files": [
10
10
  "dist"
@@ -30,7 +30,7 @@
30
30
  "access": "public"
31
31
  },
32
32
  "dependencies": {
33
- "@anticeil/sdk": "^1.0.0",
33
+ "@anticeil/sdk": "^1.1.0",
34
34
  "@modelcontextprotocol/sdk": "^1.6.0",
35
35
  "socket.io-client": "^4.8.1"
36
36
  },