# Rocket.Chat MCP

> Rocket.Chat MCP Server connects your agent directly to the open-source team chat platform. Your AI client can now send, update, or delete messages in any channel, list private and public groups, find user details, and audit who's active across your entire workspace.

## Overview
- **Category:** talk-to-me
- **Price:** Free
- **Tags:** team-chat, open-source, secure-messaging, channel-management, collaboration-tools, user-directory

## Description

Yo, listen up. The **Rocket.Chat MCP Server** hooks your agent right into the open-source team chat platform. Your AI client can now do way more than just talk; it can actually *act* inside your workspace—managing messages, auditing user profiles, and mapping out every single group you're in.

When you connect this, your agent gains hands-on control over communications. It handles sending new messages to any channel or individual using `chat_post_message`, or it can send a message straight to a specific room when you know the unique ID—that’s what `chat_send_message` does. You're not limited to just talking, either; if someone sends out some garbage and you gotta fix it, your agent uses `chat_update_message` to change the visible text of an existing post. And if that message is pure trash? No sweat—it’ll use `chat_delete_message` to wipe it from a specific room ID.

Mapping out who's where and what channels exist is just as good. Your agent can list every public channel available across the entire workspace directory using `list_public_channels`. It knows all the private groups you belong to by listing their unique identifiers with `list_private_groups`. If you need the deep details on any specific chat room—the metadata, everything—you use `get_channel_info` for a given channel ID. For direct conversations, your agent checks and spits out a list of IDs representing every active one-on-one direct message room it's part of via `list_direct_messages`. 

Talking about people, the directory is wide open. Your agent can pull a comprehensive rundown of literally every user currently registered in the whole workspace with just `list_users`. If you need to know everything about one person—their roles, their profile details—it uses `get_user_info` for that specific user's unique ID.

Here’s how it works when your agent runs a complex task. You can tell your AI client: 'First, check the info for User X using `get_user_info`. Then, send an urgent message to the #alerts channel using `chat_post_message`, and finally, list every direct chat I'm in with `list_direct_messages`.' The agent executes that chain of commands natively. It doesn't just read; it writes, it edits, and it deletes within your live Rocket.Chat environment. You get full operational control over communications, user data, and group structure—all through simple instructions to your AI client.

## Tools

### chat_delete_message
Deletes a specific message from a given room ID, requiring both IDs for execution.

### chat_post_message
Sends a new message to a channel or user using their visible names as destinations.

### chat_send_message
Sends a new message directly to a specific room, requiring the destination room's unique ID.

### chat_update_message
Modifies the visible text content of an existing message within a chat thread.

### get_channel_info
Retrieves detailed metadata and information for one specific channel ID.

### get_user_info
Pulls comprehensive profile details, including roles, for a single user using their unique ID.

### list_direct_messages
Returns a list of IDs representing all active one-on-one direct message rooms you are part of.

### list_private_groups
Lists the unique identifiers for every private group (channel) that your user account belongs to.

### list_public_channels
Returns a list of all public channels available across the entire workspace directory.

### list_users
Retrieves a comprehensive list of every user currently registered in the overall workspace directory.

## Prompt Examples

**Prompt:** 
```
List all of my active direct messages.
```

**Response:** 
```
I checked your direct communications using `list_direct_messages` and retrieved 4 active room IDs. These IDs represent ongoing 1-on-1 private channels. Let me know if you would like me to list public channels or drop a message into one of these direct rooms.
```

**Prompt:** 
```
Send a welcome message to #general thanking the new members.
```

**Response:** 
```
Done. I invoked the `chat_post_message` tool assigning `#general` as the destination. The room successfully received the message: 'Welcome to all the new members! Glad to have you here.' Let me know if you would like me to modify or erase it.
```

**Prompt:** 
```
Find and get the user info for the ID abCD123.
```

**Response:** 
```
I utilized the `get_user_info` tool passing the specific ID. The resulting payload revealed this belongs to user 'Richard', logged as active, carrying an 'Admin' organizational role within your servers. I can list their joined groups next if you want.
```

## Capabilities

### Manage Channel Communications
The agent can post new messages using `chat_post_message` or send directed messages via `chat_send_message`. It can also update existing text with `chat_update_message` or remove messages entirely using `chat_delete_message`.

### Audit User Profiles
The agent lists all users in the workspace directory (`list_users`) and retrieves detailed profile data for any specific user ID using `get_user_info`.

### Map Group Structures
You can list every public channel available (`list_public_channels`), or map out all private groups you belong to (`list_private_groups`). Specific room details come from `get_channel_info`.

### View Direct Contacts
The agent checks and lists every active one-on-one direct message channel associated with your user account using `list_direct_messages`.

## Use Cases

### The Onboarding Announcement
A Team Lead has new hires and needs to announce them across three departments. Instead of jumping into each channel, they ask their agent: "Send a welcome message to #sales and thank the new team members." The agent calls `chat_post_message` for every target channel ID, executing the announcement in bulk.

### The Colleague Lookup
A Support Agent needs to know if a user mentioned by a client is an Admin. They run: "Find out what role abCD123 has." The agent calls `get_user_info`, and the resulting data immediately confirms their 'Admin' status, allowing the agent to escalate correctly.

### The Cleanup Crew
An Ops Engineer notices an old thread with sensitive info. They ask: "Delete that message from the #project-alpha channel." The agent uses `chat_delete_message`, requiring only the room ID and the specific message ID, ensuring no one sees it anymore.

### Mapping Private Comms
A Project Manager needs to know every small working group that exists. They ask their agent: "List all my private groups." The agent calls `list_private_groups`, providing a complete map of every restricted 1-on-1 or team chat they're involved in.

## Benefits

- Run full chat audits without clicking through tabs. Use `list_public_channels` followed by `get_channel_info` to map out the entire conversation structure in minutes.
- Stop hunting for user details. Passing a single ID to `get_user_info` gives your agent their role, status, and profile data immediately.
- Control the message flow exactly. Need to correct an announcement? Use `chat_update_message`. If it's garbage, use `chat_delete_message`.
- Handle team announcements programmatically. Instead of posting manually, tell your agent to run `chat_post_message` in `#general` and tag the right people.
- Keep track of private conversations easily. Run `list_direct_messages` to see every one-on-one chat room without manual navigation.

## How It Works

The bottom line is that once configured with your authentication tokens, your agent can treat Rocket.Chat like another data source it runs commands against.

1. Install the module in your MCP connectivity environment.
2. Go to your Rocket.Chat profile and generate a Personal Access Token (Auth Token).
3. Input your `Rocket.Chat URL`, User ID, and Auth Token into the connection form.

## Frequently Asked Questions

**How do I list all public channels using chat_post_message?**
You don't use `chat_post_message` to list them. You must first run the `list_public_channels` tool. This returns a list of channel IDs and names, which you can then reference in subsequent commands.

**What is the difference between chat_send_message and chat_post_message?**
`chat_send_message` requires a specific room ID. `chat_post_message` allows you to send messages using simple, human-readable names for the channel or user, which is generally easier.

**Can I find out what group a user belongs to?**
You can list all private groups your account belongs to with `list_private_groups`. However, if you need details on *who* is in that group, you must call `get_channel_info` using the specific group ID.

**How accurate is get_user_info for roles?**
The data retrieved by `get_user_info` provides detailed information about the user's assigned roles and status within your Rocket.Chat workspace, giving you an accurate view of their permissions.

**What credentials does the `list_users` tool need to run?**
It requires a Personal Access Token and your Rocket.Chat URL for proper authentication. These details let your agent read user data securely, ensuring it has the right permissions to list everyone in the workspace.

**What happens if `chat_update_message` fails?**
You must provide both a valid message ID and room ID. If either is wrong or the message was deleted, the API returns an error code. Your agent can then flag this failure and prompt you for corrected IDs.

**How much detail does `get_channel_info` give?**
It pulls comprehensive metadata about a specific channel. You get details like the creation date, current member count, and if it's public or private. It gives you context way beyond just reading messages.

**Are there rate limits when using `chat_send_message`?**
Yes, the API enforces standard rate limits to prevent overuse. If your agent sends too many messages in quick succession, it will receive a 429 error and needs to wait before trying again.

**Can the assistant create new channels or invite new users to the Rocket.Chat workspace?**
No. This tool package is primarily focused on organic text-based communication, message manipulation (sending, modifying, deleting), and environment querying (listing what already exists). The generative capability to create workspace structural entities like 'new channels' or provisioning administrative user accounts is deactivated for baseline security in this module.

**How does `chat_post_message` differ from `chat_send_message`?**
`chat_send_message` uses a unique alphanumeric `Room ID` (e.g. 'cxyz123') to target an exact space unambiguously. Meanwhile, `chat_post_message` is designed to be human-readable, allowing your assistant to route messages to named destinations like '#general', '#dev-team', or directly to a user like '@johndoe'.

**Can the AI edit or delete messages sent by other users?**
Only if the authenticated account has the required admin or moderator permissions in the target channel. The AI inherits the same role-based restrictions as the user whose token is configured.