Fluxer MCP
by Adiker
README.md
# Fluxer MCP
A local [Model Context Protocol](https://modelcontextprotocol.io/) server for [Fluxer](https://fluxer.com/). It gives an MCP client access to a Fluxer account over the public HTTP API and, on demand, a Gateway session for live events and LiveKit voice/video.
This is an independent integration inspired by [discord.py-self-mcp](https://github.com/Microck/discord.py-self-mcp). It is **not a fork, an official Fluxer product, or a drop-in replacement**: the platforms, token types, tools, arguments, and behavior differ.
## Quick start
Linux, Python 3.10+, and [uv](https://docs.astral.sh/uv/) are recommended. Clone the repository and install its dependencies:
```bash
git clone https://github.com/Adiker/fluxer-mcp.git
cd fluxer-mcp
uv sync
```
Store a Fluxer session token locally with owner-only permissions (the input is hidden):
```bash
install -d -m 700 ~/.config/fluxer-mcp
read -rsp 'Fluxer token: ' fluxer_token
printf '\n'
umask 077
printf '%s' "$fluxer_token" > ~/.config/fluxer-mcp/token
unset fluxer_token
```
Add the server to Codex, replacing the path with the absolute path of your checkout:
```bash
codex mcp add fluxer -- /absolute/path/to/fluxer-mcp/.venv/bin/fluxer-mcp
```
Restart your MCP client and ask it to call `get_user_info` and `list_guilds`. The server communicates using **stdio**; its standard output is reserved for MCP. For pip installation, other clients, token types, prerequisites, troubleshooting, and an agent-oriented installation guide, see [INSTALL.md](INSTALL.md).
> A user session token grants access to the account, including private conversations and actions. Use it only with software you trust, do not paste it into a chat, and never commit it. The server may modify data or send messages if an MCP client calls a write tool. Review the permissions and instructions given to your assistant.
## Features
The server currently registers 68 MCP tools. Returned data is Fluxer's JSON unless a tool description says otherwise. The tool list and exact input schemas are available through MCP `tools/list`.
| Category | Tools |
| --- | --- |
| Account and communities | `get_user_info`, `list_guilds`, `get_guild`, `edit_profile`, `set_status` |
| Channels | `list_channels`, `list_guild_channels`, `get_channel`, `create_channel`, `delete_channel` |
| Messages and files | `send_message`, `read_messages`, `list_messages`, `get_message`, `search_messages`, `edit_message`, `delete_message`, `get_message_attachments`, `send_file` |
| Reactions and pins | `add_reaction`, `remove_reaction`, `list_reaction_users`, `list_pins`, `pin_message`, `unpin_message` |
| Direct messages and mentions | `list_private_channels`, `list_dm_channels`, `open_dm`, `list_pings`, `mark_message_read` |
| Friends | `list_friends`, `send_friend_request`, `remove_friend` |
| Threads | `create_thread`, `list_active_threads`, `search_threads`, `list_archived_threads`, `read_thread_messages`, `send_thread_message` |
| Roles and members | `list_roles`, `get_role`, `create_role`, `edit_role`, `delete_role`, `set_role_permissions`, `list_members`, `add_role`, `remove_role`, `kick_member`, `ban_member`, `unban_member` |
| Permissions and invites | `get_channel_permissions`, `set_channel_permissions`, `remove_channel_permissions`, `list_invites`, `create_invite`, `delete_invite` |
| Gateway and events | `start_gateway`, `gateway_status`, `get_gateway_events`, `stop_gateway` |
| Voice, camera, screen | `join_voice_channel`, `join_private_call`, `leave_voice_channel`, `start_camera`, `stop_camera`, `start_screen_share`, `stop_screen_share` |
## Live events and notifications
Call `start_gateway` to open a Gateway session. `get_gateway_events` consumes up to 200 buffered events and can wait up to 30 seconds; the queue is in memory and discards the oldest events when full. The server attempts to resume a disconnected session, but delivery is not guaranteed. Events are only available while the MCP server process is running. Gateway access depends on Fluxer's permissions and subscriptions.
`start_gateway(desktop_notifications=true)` also uses `notify-send` for new messages from other accounts, without displaying message content. It requires a working Linux desktop notification service. MCP events are polled with `get_gateway_events`; they are not automatically inserted into a Codex chat. Call `stop_gateway` to disconnect and clear the session.
## Voice and video
`join_voice_channel` joins a community voice channel using LiveKit; `join_private_call` targets an existing DM or group DM. The microphone is **off by default**. Setting `microphone=true` publishes the default microphone; `speakers=false` disables audio reception. Joining a private call may be visible to its recipients. `leave_voice_channel` ends this server's connection.
After joining, `start_camera` publishes a Linux `/dev/videoN` device; `start_screen_share` opens the XDG desktop portal so the user can choose a screen or window on Wayland. The corresponding stop tools release the devices. File uploads use `send_file`, have a local limit of 25 MiB, and are subject to Fluxer permissions and account limits. Outgoing text disables mention notifications by default.
**Current limitations:**
- Only the hosted `fluxer.com` instance is supported; discovered API and Gateway hosts are validated. Self-hosted instances are not configurable.
- P2P calls, screen-share audio, displaying received video, attachments over 25 MiB, and Discord-specific interactions are not implemented.
- Private calls and encrypted calls have not been verified end to end with the official Fluxer client. A LiveKit encryption test with a supplied key passed between two MCP sessions. Fluxer [says](https://docs.fluxer.com/voice/) its current room key is server-generated, so this is not end-to-end encryption.
- Guild-wide `list_active_threads` is bot-only; use `search_threads` for a channel with a user session. `get_channel_permissions` returns raw overwrites, not calculated effective permissions.
- All mutating tools are subject to Fluxer's account restrictions and permissions. Tool availability does not guarantee every operation works for your account.
## Verification
```bash
uv run python -m unittest discover -s tests -v
```
The automated tests use mocks and do not send messages or modify a Fluxer account. On a private test community, the current implementation was also checked for account/channel/message reads, a real file upload, Gateway events and resume, a two-session LiveKit audio transfer, and a real Wayland screen-share frame received by a second MCP session. Real microphone audio, a physical camera, private calls, P2P and official-client encrypted media were not verified.
## Project layout
- `src/fluxer_mcp/server.py`: HTTP tools and MCP entry point.
- `src/fluxer_mcp/realtime.py`: Gateway, event queue, and LiveKit session.
- `src/fluxer_mcp/video.py`: camera and screen track publication.
- `src/fluxer_mcp/screencast.py`: XDG ScreenCast/PipeWire portal.
- `tests/`: offline tests for protocol, routing, validation and cleanup.
See the [Fluxer API documentation](https://docs.fluxer.com/) for platform-specific behavior and [INSTALL.md](INSTALL.md) for setup. Contributions and issue reports are welcome; never include tokens, signed URLs, private messages, or personal account data in an issue.
## License
[MIT](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues