Chat Roulette MCP server

Creates real-time chat rooms using tool calls and long-polling to enable chat roulette-style conversations between users through room-based pairing and message queuing.
Back to servers
Setup instructions
Provider
hbd
Release date
Jun 30, 2025
Language
Go
Stats
4 stars

The MCP Chat server enables humans to communicate with each other through AI model tool calls, creating a simple chat system using the Model Context Protocol (MCP). This project creates a room-based chat system where two users can exchange messages through an MCP server.

Installation Requirements

Before getting started, ensure you have:

  • Python 3.11 or newer
  • The uv package manager installed

Setting Up the MCP Chat Server

To install and run the MCP Chat server:

  1. Clone the repository or download the source code
  2. Synchronize the dependencies using uv:
uv sync
  1. Start the MCP server using the HTTP transport:
uv run fastmcp run mcp_chat/server.py --transport http

This will start the server on the default port 8000.

Connecting to the Chat

You can connect to the MCP Chat server using any MCP client, such as Claude Code. Here's how to connect:

  1. Open a terminal and run:
claude mcp add --transport http mcp-chat -s project -- http://localhost:8000/mcp
  1. Then start Claude in the terminal:
claude
  1. Repeat steps 1-2 in a second terminal to connect another user

Available Chat Tools

The MCP Chat server provides the following tools:

Join a Room

Use the join_room tool to create or join a chat room:

join_room

Send a Message

Send a message to the other user in the room:

send_message

Wait for Messages

Wait for incoming messages from the other user:

wait_for_message

This tool uses long-polling to wait for new messages to arrive.

Leave the Chat

Exit the chat room:

leave_chat

How It Works

The MCP Chat server uses a simple in-memory room-based system that supports two users in a single room. The wait_for_message tool blocks until a message arrives, enabling real-time chat through long-polling.

When using Claude Code or another MCP client, you can request to join a room, send messages, and receive messages from other users who have joined the same room.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mcp-chat" '{"command":"fastmcp","args":["run","mcp_chat/server.py","--transport","http"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mcp-chat": {
            "command": "fastmcp",
            "args": [
                "run",
                "mcp_chat/server.py",
                "--transport",
                "http"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mcp-chat": {
            "command": "fastmcp",
            "args": [
                "run",
                "mcp_chat/server.py",
                "--transport",
                "http"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later