- Home
- MCP servers
- MCP Chat
MCP Chat
- python
5
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can run an MCP-based chat server that lets two humans exchange messages through the MCP transport. This setup uses a simple in-memory, room-based approach with long-polling to deliver messages, enabling a straightforward chat experience powered by MCP clients.
How to use
Connect to the chat server from an MCP client to begin chatting. Run the server, then use the MCP-enabled client to join or create a chat room and exchange messages. The flow relies on long-polling to wait for new messages, so the recipient’s message appears when it arrives, without requiring a constant WebSocket connection.
Typical usage involves two separate client sessions that join the same chat room. Each participant sends a message, and the other participant receives it through the wait-for-message mechanism. This creates a simple, real-time-feeling chat across MCP clients.
How to install
Prerequisites you need before installing this MCP chat server:
-
Python 3.11 or newer
-
uv package manager
Follow these steps to install and run the server:
# Terminal 1
uv sync
uv run fastmcp run mcp_chat/server.py --transport http
# Terminals 2 & 3
claude mcp add --transport http mcp-chat -s project -- http://localhost:8000/mcp
claude
The command in Terminal 1 starts the MCP chat server with HTTP transport. The two Claude Code sessions in Terminals 2 and 3 connect to the server using the provided URL and set up a shared chat space.
## Additional notes
Key functions you will use in the chat server are:
- `join_room` to create or join a chat room
- `send_message` to send a message to the room
- `wait_for_message` to wait for incoming messages (this call blocks until a message arrives)
- `leave_chat` to exit the room
## Available tools
### join\_room
Create or join a chat room to start or participate in a conversation.
### send\_message
Send a message to the current chat room.
### wait\_for\_message
Wait for incoming messages; this call blocks until a message is delivered.
### leave\_chat
Leave the current chat room to end or exit the chat session.