mcp-chat-connect 1.1.8 → 1.2.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/index.js +83 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -316,6 +316,43 @@ function getTools() {
316
316
  description: 'Check your current MCP Chat connection status.',
317
317
  inputSchema: { type: 'object', properties: {} },
318
318
  },
319
+ {
320
+ name: 'mcp_chat_create_channel',
321
+ description: 'Create a new MCP Chat channel. You become the admin.',
322
+ inputSchema: {
323
+ type: 'object',
324
+ properties: {
325
+ name: { type: 'string', description: 'Channel name' },
326
+ description: { type: 'string', description: 'Channel description' },
327
+ member_ids: { type: 'array', items: { type: 'number' }, description: 'User IDs to add as members' },
328
+ },
329
+ required: ['name'],
330
+ },
331
+ },
332
+ {
333
+ name: 'mcp_chat_add_member',
334
+ description: 'Add a user to a channel (requires channel admin). Specify user by ID or email.',
335
+ inputSchema: {
336
+ type: 'object',
337
+ properties: {
338
+ channel_id: { type: 'number', description: 'Channel ID (defaults to connected channel)' },
339
+ user_id: { type: 'number', description: 'User ID to add' },
340
+ email: { type: 'string', description: 'Email of user to add (alternative to user_id)' },
341
+ },
342
+ },
343
+ },
344
+ {
345
+ name: 'mcp_chat_modify_channel',
346
+ description: 'Update a channel name and/or description (requires channel admin).',
347
+ inputSchema: {
348
+ type: 'object',
349
+ properties: {
350
+ channel_id: { type: 'number', description: 'Channel ID (defaults to connected channel)' },
351
+ name: { type: 'string', description: 'New channel name' },
352
+ description: { type: 'string', description: 'New channel description' },
353
+ },
354
+ },
355
+ },
319
356
  ];
320
357
  }
321
358
 
@@ -435,6 +472,52 @@ async function handleToolCall(name, args) {
435
472
  return { content: [{ type: 'text', text: `Connected to #${sessionState.channelName} as ${sessionState.userName}\nWebSocket: ${wsStatus}` }] };
436
473
  }
437
474
 
475
+ case 'mcp_chat_create_channel': {
476
+ if (!sessionState.token) {
477
+ return { content: [{ type: 'text', text: 'Not authenticated. Run mcp_chat_connect first.' }], isError: true };
478
+ }
479
+ const channelName = String(args.name || '').trim();
480
+ if (!channelName) return { content: [{ type: 'text', text: 'Channel name is required.' }], isError: true };
481
+ const result = await apiCall('create_channel', {
482
+ name: channelName,
483
+ description: args.description || null,
484
+ member_ids: args.member_ids || [],
485
+ }, sessionState.token);
486
+ if (result.error) return { content: [{ type: 'text', text: `Error: ${result.error}` }], isError: true };
487
+ return { content: [{ type: 'text', text: `Channel #${result.channel.name} created (ID: ${result.channel.id})${result.channel.description ? ` -- ${result.channel.description}` : ''}` }] };
488
+ }
489
+
490
+ case 'mcp_chat_add_member': {
491
+ if (!sessionState.token) {
492
+ return { content: [{ type: 'text', text: 'Not authenticated. Run mcp_chat_connect first.' }], isError: true };
493
+ }
494
+ const channelId = args.channel_id || sessionState.channelId;
495
+ if (!channelId) return { content: [{ type: 'text', text: 'No channel specified and not connected to one.' }], isError: true };
496
+ if (!args.user_id && !args.email) return { content: [{ type: 'text', text: 'Provide user_id or email.' }], isError: true };
497
+ const result = await apiCall('add_channel_member', {
498
+ channel_id: channelId,
499
+ user_id: args.user_id || undefined,
500
+ email: args.email || undefined,
501
+ }, sessionState.token);
502
+ if (result.error) return { content: [{ type: 'text', text: `Error: ${result.error}` }], isError: true };
503
+ return { content: [{ type: 'text', text: result.message }] };
504
+ }
505
+
506
+ case 'mcp_chat_modify_channel': {
507
+ if (!sessionState.token) {
508
+ return { content: [{ type: 'text', text: 'Not authenticated. Run mcp_chat_connect first.' }], isError: true };
509
+ }
510
+ const channelId = args.channel_id || sessionState.channelId;
511
+ if (!channelId) return { content: [{ type: 'text', text: 'No channel specified and not connected to one.' }], isError: true };
512
+ const result = await apiCall('modify_channel', {
513
+ channel_id: channelId,
514
+ name: args.name || undefined,
515
+ description: args.description !== undefined ? args.description : undefined,
516
+ }, sessionState.token);
517
+ if (result.error) return { content: [{ type: 'text', text: `Error: ${result.error}` }], isError: true };
518
+ return { content: [{ type: 'text', text: `Channel updated: #${result.channel.name}${result.channel.description ? ` -- ${result.channel.description}` : ''}` }] };
519
+ }
520
+
438
521
  default:
439
522
  return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
440
523
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-chat-connect",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "MCP server with channels support for connecting Claude Code sessions to MCP Chat -- real-time team messaging for AI-assisted development",
5
5
  "main": "index.js",
6
6
  "bin": {