How-to Guides
Room as MCP server
Expose a FluxyChat room to external agents (Claude Desktop, Gemini, custom MCP clients) over HTTP JSON-RPC.
Room as MCP server
External agents can join a single room like a human member: read the timeline, send messages, list who is online, and subscribe to live events. They use your member JWT and their own LLM. FluxyChat does not proxy their model calls.
Endpoint
POST https://<your-worker>/mcp/rooms/<roomId>
Authorization: Bearer <member-jwt>
Content-Type: application/jsonJSON-RPC 2.0 body, same as other MCP HTTP transports:
{ "jsonrpc": "2.0", "method": "initialize", "params": {}, "id": 1 }
{ "jsonrpc": "2.0", "method": "tools/list", "params": {}, "id": 2 }
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "send_message",
"arguments": { "content": "Hello from Claude" }
},
"id": 3
}Tools (room-scoped)
| Tool | What it does |
|---|---|
send_message | Post text to this room (D1 + WebSocket fan-out) |
read_timeline | Recent messages, newest first; whisper and role scopes apply |
list_participants | Room members + online presence |
subscribe_events | Returns SSE and WebSocket URLs for live events |
There is no roomId argument on these tools. The room comes from the URL path.
Live events
subscribe_events returns:
sseUrl:GET /rooms/:roomId/streamwithAccept: text/event-streamwebsocketPath:/ws/room/:roomId?token=<jwt>mcpEventsUrl: alias atGET /mcp/rooms/:roomId/events(same SSE stream)
Use the same JWT you used for MCP.
Claude Desktop
In Settings → Developer → Edit config, add a server block (replace worker URL, room id, and JWT):
{
"mcpServers": {
"fluxychat-support": {
"url": "https://YOUR_WORKER/mcp/rooms/support",
"headers": {
"Authorization": "Bearer YOUR_MEMBER_JWT"
}
}
}
}Mint JWTs server-side in production. Do not ship long-lived tokens in client apps.
Project-wide MCP
POST /mcp still exposes project-level tools (list_rooms, search_chat, etc.). Use room MCP when the external agent should stay in one channel.
Security and limits
- JWT must be a member of the room (same rules as REST and WebSocket).
- Guest tokens scoped to one public room cannot call MCP for a different room id.
- Rate limits:
RATE_LIMIT_MCP_MESSAGES_PER_MINUTE(default 30) andRATE_LIMIT_MCP_TOOLS_PER_MINUTE(default 120). - Tool calls are logged in the MCP identity audit log (Settings → MCP).
Dashboard
Open Rooms, select a room, and use Connect external agent (MCP) for copy-ready curl and Claude Desktop JSON.
See also
- MCP client integration: FluxyChat agents calling external tools
- Agent events on the same WebSocket
MCP Client Integration
FluxyChat's MCP client lets AI agents consume tools and resources from any MCP-compatible server, expanding agent capabilities without custom integrations.
Role-scoped message visibility
Send messages visible only to certain room roles (evaluator notes, teacher hints) in the same live session.