Skip to main content
Glama
hbd

MCP Chat

by hbd

MCP Chat

Using MCP (Model Context Protocol) servers for chat.

I was initially inspired to make this based upon an idea for a chat roulette style interaction using an MCP client like the Claude Mac app or the Claude Code. For simplicity's sake, this proof of concept just uses a simple in-memory room-based system that supports two users in a single room sending messages between each other.

MCP Chat Demo

What?

MCP is designed for AI assistants to call tools. This project abuses that design to let humans chat with each other through tool calls. A long polling tool is used to wait for messages from the recipient. This is not ideal. Ideally, we'd be using custom notifications, but the MCP clients that I'm working with and most MCP clients today do not support custom messages/notifications.

Related MCP server: MCP AI Chat LangChain

How it works

Run the MCP server in using the SHTTP transport:

# Terminal 1
uv sync
uv run fastmcp run mcp_chat/server.py --transport http

Connect to the MCP server using Claude Code, for example:

Note: See the demo gif for an example of using this with Claude Code

# Terminals 2 & 3
claude mcp add --transport http mcp-chat -s project -- http://localhost:8000/mcp
claude # Do this in 2 separate sessions

The magic: wait_for_message blocks until a message arrives. Real-time chat through long-polling.

Tools

  • join_room - Create/join a room

  • send_message - Send a message

  • wait_for_message - Wait for messages (blocks!)

  • leave_chat - Leave the room

Requirements

  • Python 3.11+

  • uv package manager

Future ideas

  • Random pairing (chat roulette style)

  • Custom notifications for async messaging

  • Multi-user rooms

  • Message history

Why?

Sunday project. Wanted to see if MCP could be bent into a chat protocol. Turns out it can.

License

MIT

Available Tools

4 tools
join_roomA

Join a specific chat room directly.

Creates a new session with a unique client_id and adds the user to the specified room. Useful for rejoining a room or creating private rooms.

IMPORTANT: After joining a room, prompt the user to choose whether they want to:

  • Wait for messages (call wait_for_message) - if they expect to receive first

  • Send a message (call send_message) - if they want to initiate conversation

This gives users control over the conversation flow rather than automatically blocking.

Args: room_id: The ID of the room to join display_name: Display name for the user (required)

Returns: Success status with client_id or error information

ParametersJSON Schema
NameRequiredDescriptionDefault
room_idYes
display_nameYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: that joining creates a new session with a unique client_id, adds the user to the room, and doesn't automatically block (giving users control over flow). It mentions the tool returns success status with client_id or error information. However, it doesn't cover potential side effects like rate limits, authentication needs, or what happens if the room doesn't exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections: purpose statement, behavioral details, usage guidance, and parameter explanations. Every sentence earns its place, though the IMPORTANT section is somewhat lengthy. The information is front-loaded with the core purpose in the first sentence. Minor deduction for some redundancy in explaining the workflow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (joining rooms with session creation), no annotations, no output schema, and 2 parameters, the description provides good coverage. It explains the purpose, usage context, parameters, and return values. However, it lacks details about error conditions, what 'success status' entails, and potential limitations or prerequisites for joining rooms.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for 2 parameters, the description compensates well by explaining both parameters in the Args section. It clarifies that room_id is 'The ID of the room to join' and display_name is 'Display name for the user (required)'. This adds meaningful context beyond the bare schema, though it doesn't provide format examples or constraints for either parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('join', 'creates', 'adds') and resources ('chat room', 'session', 'user'). It distinguishes from siblings by explaining this is for joining rooms directly, while siblings like send_message and wait_for_message are for subsequent actions. The first sentence 'Join a specific chat room directly' is precise and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool vs alternatives. It states it's 'useful for rejoining a room or creating private rooms' and includes an IMPORTANT section that explains what to do after joining (call wait_for_message or send_message). This clearly distinguishes it from sibling tools and provides context for the workflow.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

leave_chatC

Leave the current chat room.

Args: room_id: The ID of the chat room to leave client_id: Your client identifier (from enter_queue)

Returns: Success status

ParametersJSON Schema
NameRequiredDescriptionDefault
room_idYes
client_idYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the action but doesn't disclose what 'leaving' means (e.g., removes client from room, stops receiving messages, may be irreversible). No information on permissions, rate limits, or error conditions is included.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with a clear main sentence followed by structured parameter and return explanations. It's front-loaded with the core purpose, though the 'Args' and 'Returns' sections could be integrated more smoothly into natural language.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a mutation tool (leaving implies state change), the description is incomplete. It lacks details on return values beyond 'Success status', error handling, side effects, and how this interacts with sibling tools in the chat system context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains 'room_id' as 'The ID of the chat room to leave' and 'client_id' as 'Your client identifier (from enter_queue)', adding meaningful context beyond the schema's bare titles. However, it doesn't detail format requirements or constraints for these IDs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Leave') and resource ('current chat room'), making the purpose immediately understandable. It distinguishes from siblings like 'join_room' by specifying the opposite action. However, it doesn't explicitly mention what 'leaving' entails operationally.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., must be in the room first), consequences of leaving, or when to choose this over other tools like 'send_message' or 'wait_for_message'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

send_messageA

Send a message to your chat partner.

IMPORTANT: After sending a message, you should immediately call wait_for_message to receive the response. This enables real-time conversation flow.

Typical usage:

  1. Call send_message to send your message

  2. Call wait_for_message to wait for the response

  3. Repeat

Args: room_id: The ID of the chat room message: The message to send client_id: Your client identifier (from enter_queue or join_room)

Returns: Success status or error information

ParametersJSON Schema
NameRequiredDescriptionDefault
room_idYes
messageYes
client_idYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior in a conversational context, including the need for immediate follow-up with 'wait_for_message' and the real-time conversation flow. It mentions what the tool returns ('Success status or error information'), though it doesn't specify authentication needs, rate limits, or error conditions in detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections: purpose statement, important usage note with workflow, typical usage steps, parameter explanations, and return information. Every sentence adds value - the workflow guidance is particularly helpful, and there's no redundant or unnecessary content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (3 parameters, no annotations, no output schema), the description provides substantial context: clear purpose, detailed usage workflow, parameter semantics, and return information. It effectively compensates for the lack of structured metadata. The only minor gap is not specifying exact return formats or error details, but the workflow guidance makes this quite complete for its purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage (no parameter descriptions in the schema), the description compensates by explaining all three parameters: 'room_id: The ID of the chat room', 'message: The message to send', and 'client_id: Your client identifier (from enter_queue or join_room)'. The 'client_id' explanation even references sibling tools, adding valuable context. This significantly enhances understanding beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Send a message') and target ('to your chat partner'), providing a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from potential sibling tools like 'join_room' or 'leave_chat' in terms of its messaging function versus room management functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance with a numbered sequence (1-3) and specifically instructs to 'immediately call wait_for_message to receive the response.' It clearly indicates when to use this tool ('to send your message') and what to do after ('call wait_for_message'), creating a clear workflow pattern.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wait_for_messageA

Wait for a message in the chat room (long-polling).

This tool blocks until a message is received or the timeout is reached. Use this after sending a message to wait for a response, or call it first to wait for an incoming message.

Conversation flow:

  • If you sent the last message: wait_for_message to get response

  • If you're waiting for first contact: wait_for_message before sending

  • After receiving a message: send_message to respond, then wait_for_message again

Args: room_id: The ID of the chat room to listen in client_id: Your client identifier (from enter_queue or join_room) timeout: Timeout in seconds (default: 60, max: 300)

Returns: On message: {"message": "text", "sender": "name", "timestamp": "...", "message_id": "..."} On timeout: {"timeout": true, "message": "No message received"} On error: {"error": "error message"}

ParametersJSON Schema
NameRequiredDescriptionDefault
room_idYes
client_idYes
timeoutNo

TDQS

A4.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the blocking/long-polling behavior, timeout handling, and different return scenarios (message, timeout, error). However, it doesn't mention potential side effects like resource consumption during blocking or whether multiple concurrent waits are allowed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized. It starts with the core purpose, provides usage guidelines, outlines conversation flow, details parameters, and specifies return values. Every section earns its place with no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (blocking behavior with timeout) and lack of annotations/output schema, the description provides complete context. It covers purpose, usage patterns, parameter semantics, and detailed return value specifications for all possible outcomes (message, timeout, error).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by explaining all three parameters: room_id ('The ID of the chat room to listen in'), client_id ('Your client identifier'), and timeout ('Timeout in seconds' with default and max values). This adds crucial meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('wait for a message', 'blocks until') and resource ('in the chat room'), distinguishing it from siblings like send_message (which sends) or join_room (which joins). It explicitly mentions long-polling behavior, which is a key differentiator.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool versus alternatives, including specific conversation flow scenarios: 'Use this after sending a message to wait for a response, or call it first to wait for an incoming message.' It also outlines a clear sequence with sibling tools in the conversation flow section.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updates
    • First observedjoin_room
    • First observedleave_chat
    • First observedsend_message
    • First observedwait_for_message

TDQS

A4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: join_room establishes a connection, send_message transmits messages, wait_for_message receives messages, and leave_chat terminates participation. The descriptions explicitly differentiate their roles in the chat workflow, eliminating any potential confusion.

Naming Consistency5/5

All tools follow a consistent verb_noun naming pattern (join_room, leave_chat, send_message, wait_for_message) with clear, descriptive verbs that match their actions. The naming is uniform and predictable across the entire set.

Tool Count5/5

Four tools is perfectly appropriate for a chat server's scope, covering the essential lifecycle: joining, sending, receiving, and leaving. Each tool earns its place without redundancy or gaps, making the set well-scoped and manageable.

Completeness5/5

The toolset provides complete coverage for a basic chat domain, enabling a full CRUD-like lifecycle: join (create session), send/read (update/retrieve messages), and leave (delete participation). There are no obvious gaps, and the descriptions guide agents through coherent conversation flows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hbd/mcp-chat'

If you have feedback or need assistance with the MCP directory API, please join our Discord server