# CometChat MCP MCP

> CometChat MCP lets your agent manage all aspects of real-time chat communication. You can list users and check their status, create new groups for teams, send messages to individuals or groups, and retrieve full message histories across platforms.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** chat-api, voice-chat, video-conferencing, user-management, group-messaging, real-time-communication

## Description

This connector gives your AI client control over a complete chat infrastructure, handling everything from one-on-one chats to large group announcements. Instead of navigating complex dashboards to find who's online or checking old conversations, you just ask your agent. It manages user accounts, allowing you to list people and even deactivate them if they leave the company. You can also build new team structures by creating groups or finding existing ones using natural language commands. Plus, you get access to full message history for any thread, letting you debug problems or review past decisions instantly. Getting this integrated into your workflow via Vinkius lets your agent do all of that without ever needing a human in the loop.

## Tools

### create_group
Creates a new chat group within CometChat, allowing you to define its initial members and privacy settings.

### create_user
Registers a completely new user account in the system with basic profile details.

### deactivate_user
Suspends an existing user's account, keeping their data intact without allowing them to log in or send messages.

### delete_user
Permanently removes a user record from the system. Use this only when absolutely necessary for compliance.

### get_group_details
Pulls specific information about one defined group, including its member list and type of chat.

### get_user
Retrieves a full profile summary for an individual user, showing their status and activity history.

### list_groups
Returns a comprehensive list of all chat groups that currently exist in the CometChat environment.

### list_messages
Fetches paginated conversation history, allowing you to review past messages for a specific user or group.

### list_users
Retrieves an initial list of all registered users, showing basic details like their username and current online status.

### send_message
Sends a defined text message to either a single user or as a broadcast across a designated group chat.

## Prompt Examples

**Prompt:** 
```
Show me the first 20 users in CometChat.
```

**Response:** 
```
Here are the first 20 users:
1. 'alice' — Alice Johnson (online)
2. 'bob' — Bob Smith (offline, last seen 2h ago)
3. 'carlos' — Carlos López (online)
...
Would you like to check message history for any user?
```

**Prompt:** 
```
Create a public group named 'Marketing Team' with GUID 'marketing-team'.
```

**Response:** 
```
Group created successfully!
- Name: Marketing Team
- GUID: marketing-team
- Type: Public
- Members: 0
Would you like to add members to this group?
```

**Prompt:** 
```
Retrieve the conversation history between users 'alice' and 'bob'.
```

**Response:** 
```
Fetched 50 messages between Alice and Bob. The latest message from Alice is: 'I will send the reports tomorrow.' Sent at 10:45 AM today.
```

## Capabilities

### Manage user identities
Create new accounts, retrieve detailed profiles about existing users, or deactivate accounts instead of permanently deleting them.

### Structure and control groups
Programmatically create specific chat groups or pull a list of all available group structures for reference.

### Send real-time messages
Send text updates directly to any specified user or broadcast them across an entire defined group.

### Search message history
Pull conversation threads and search through past messages between specific users or within a given chat group.

### Handle user records
Retrieve lists of all registered users to check who is active, online, or needs attention.

## Use Cases

### Investigating user onboarding issues
A new PM notices that some beta testers can't access a feature. They ask their agent to run `list_users` first, then use `get_user` on specific accounts to check if the profile data is complete and active.

### Archiving old project communications
The legal team needs a record of discussions from a dissolved committee. They ask their agent to run `list_groups` to find the old group, then use `list_messages` to pull all historical data for review.

### Setting up a new departmental channel
A department head needs to start a temporary working group. They ask their agent to run `create_group`, defining the name and initial members, which is far faster than clicking through settings.

### Handling departing employees
HR requires immediate account action for an ex-employee. The manager asks their agent to use `deactivate_user` on that employee's ID, ensuring the account is locked without losing historical data.

## Benefits

- You instantly check user status and activity. Instead of manually viewing a dashboard to see who is online, calling `list_users` gives you immediate, actionable data about your entire user base.
- Never lose context during an audit. Need to know what was said last month? Use `list_messages` to pull conversation histories for any group or pair of users with a simple command.
- Build and modify team structure on the fly. You can use `create_group` to set up temporary project channels, then use `get_group_details` to verify its members without opening the app.
- Improve support efficiency by managing accounts directly. Instead of emailing IT, your agent runs `deactivate_user` or `delete_user` when an employee leaves, keeping records clean and compliance simple.
- Streamline communication flow. When a piece of information needs to go out immediately, you use `send_message`, ensuring the right message reaches all necessary users instantly.

## How It Works

The bottom line is: you use natural language commands to perform complex chat actions without writing any code.

1. Provide your App ID, Region, and API Key from the CometChat dashboard.
2. Connect this MCP to your agent through Vinkius on your preferred AI client.
3. Tell your agent what you need. For example, 'Send a message about the meeting prep to the Marketing Team group.'

## Frequently Asked Questions

**How do I find out who is online using the CometChat MCP?**
You use `list_users` to retrieve a list of registered users, which includes their current status (online or offline) in real-time.

**Can I send a message to only one specific user via the CometChat MCP?**
Yes. You use `send_message` and target that single user's ID, bypassing any group channel altogether.

**What if I need to change a group name or type?**
This MCP focuses on core messaging functions. To modify structural details like names, you’ll likely need direct API access, but you can use `get_group_details` to verify the current structure.

**Is it safe to permanently delete a user with CometChat? **
We recommend using `deactivate_user` first. This locks the account and preserves all data, making it safer for compliance than immediately running `delete_user`.

**What credentials are needed to use the `list_users` tool with CometChat?**
You need your App ID, Region, and API Key from the CometChat dashboard. Your AI client passes these credentials securely when connecting to the MCP; this ensures your agent has authorized access to all user data.

**How do I manage my existing chat groups using the `list_groups` tool?**
The `list_groups` function retrieves a comprehensive list of every group GUID and details. This allows your agent to map out the entire communication structure before you use the `create_group` tool.

**When should I use `deactivate_user` instead of permanently deleting a user?**
You should use `deactivate_user` if there's any chance you might need the account data later. Deactivation keeps all user records intact for compliance, unlike permanent deletion via `delete_user`.

**What happens if I try to retrieve too much message history using `list_messages`?**
The underlying CometChat API has built-in rate limits that the MCP helps manage. For large batch operations, your agent should implement exponential backoff logic to prevent hitting usage caps.

**How do I get my CometChat API credentials?**
Log in to the CometChat dashboard at app.cometchat.com. Your App ID, Region, and API Key are displayed on the app overview page.

**What is the difference between UID and GUID?**
UID (User ID) is the unique identifier for a user. GUID (Group ID) is the unique identifier for a group. Both are used to target specific resources in the API.

**Can I send files with this integration?**
The current version supports text messages. File and media sending may be added in future updates.