npm.io
0.1.2 • Published yesterdayCLI

@mulmobridge/discord

Licence
MIT
Version
0.1.2
Deps
4
Size
11 kB
Vulns
0
Weekly
0

@mulmobridge/discord

Experimental — please test and report issues.

Discord bridge for MulmoClaude. The bot responds to messages in channels it has access to.

Setup

1. Create a Discord Application

  1. Go to discord.com/developers/applicationsNew Application
  2. Name it (e.g. "MulmoClaude")
2. Create the Bot
  1. Bot tab → Add Bot
  2. Copy the Token (this is your DISCORD_BOT_TOKEN)
  3. Enable Message Content Intent under Privileged Gateway Intents
3. Invite the bot to your server

OAuth2URL Generator:

  • Scopes: bot
  • Permissions: Send Messages, Read Message History

Copy the generated URL and open it in your browser to invite the bot.

4. Run the bridge
# With mock server (testing)
npx @mulmobridge/mock-server &
DISCORD_BOT_TOKEN=... \
MULMOCLAUDE_AUTH_TOKEN=mock-test-token \
npx @mulmobridge/discord

# With real MulmoClaude
DISCORD_BOT_TOKEN=... \
npx @mulmobridge/discord

Environment Variables

Variable Required Description
DISCORD_BOT_TOKEN Yes Bot token from Developer Portal
DISCORD_ALLOWED_CHANNELS No CSV of channel IDs to restrict (empty = all)
MULMOCLAUDE_API_URL No Default http://localhost:3001
MULMOCLAUDE_AUTH_TOKEN No Bearer token (auto-read from workspace)
DISCORD_BRIDGE_DEFAULT_ROLE No Role id to seed new bridge sessions with (e.g. coder, general). Applied ONLY when a discord session first appears — once the user switches role via /role <id> the session's own role wins. Unknown role ids silently fall back to the server's default with a warn log.
BRIDGE_DEFAULT_ROLE No Same as above but shared across every bridge. Transport-specific DISCORD_BRIDGE_DEFAULT_ROLE wins when both are set.
Auth token persistence across server restarts

The MulmoClaude server regenerates a fresh bearer token on every startup and writes it to ~/mulmoclaude/.session-token. The bridge reads that file once at launch and keeps the token in memory — so if the server restarts while the bridge is running, the bridge keeps using the old token and every API call returns 401, silently.

Fix: set MULMOCLAUDE_AUTH_TOKEN to the same long random value on both the server and the bridge. The server uses it verbatim instead of regenerating, so the token survives restarts and the bridge stays authenticated.

# Server (one-time setup — same value across restarts)
MULMOCLAUDE_AUTH_TOKEN=long-random-string yarn dev

# Bridge (separate process / machine — same value)
MULMOCLAUDE_AUTH_TOKEN=long-random-string \
  <bridge-specific-envs> \
  npx <this-package>@latest

Recommended: at least 32 characters of random data (the server logs a warning at startup for shorter values).

Ecosystem

Part of the @mulmobridge/* package family.

Shared libraries:

Bridges (one npm package per platform):

License

MIT