Configure the gateway
Connect messaging platforms and admit identities without granting Maia access prematurely.
The gateway connects Maia to Discord, Slack, Telegram, WhatsApp, Mattermost, Matrix, and other messaging platforms. Gateway admission and Maia governance are separate gates.
Understand the two identity gates
| Gate | Decision |
|---|---|
| Gateway admission | May this platform identity reach the Maia gateway? |
| Governance mapping | Which roles, teams, files, tools, and knowledge may this identity use? |
A newly admitted user who is not the bootstrap administrator remains Pending Governance. The user cannot send normal messages to Maia until an administrator creates a governance record with at least one role.
Choose a platform guide
Slack and Discord have dedicated setup guides in the documentation menu. Each guide covers app creation, credentials, platform permissions, allowlists, first-run testing, and both supported configuration paths.
- Connect Slack with Socket Mode, an
xoxb-bot token, and anxapp-app token. - Connect Discord with a bot application, gateway intents, and stable user or role IDs.
Configure with the dashboard or CLI
| Path | Use it when | Starting point |
|---|---|---|
| Dashboard | You want guided forms, secret-aware fields, status, and Start or Restart controls. | Run maia or maia dashboard, then open Gateway. |
| CLI | You are working in a terminal or administering a headless installation. | Run maia setup gateway, then test with maia gateway run. |
Configure a channel
- Open Maia's local dashboard and select Gateway.
- Select the platform and enter its bot credentials through the secret-aware fields.
- Add the first administrator identity and save. On a fresh installation, Maia can bootstrap only this first identity as an administrator.
- Start or restart the gateway.
- Send a private test message from the administrator account.
Governance uses keys such as discord:123456789 or slack:U123. Display names can change and must not be used as the authorization identity.
Configure Slack step by step
Slack is the recommended corporate starting point when your company already uses a Slack workspace. Socket Mode lets Maia connect outward over WebSocket, so you do not need to expose a public webhook endpoint.
- After installing Maia, generate its Slack app manifest:
The manifest includes Maia's required bot scopes, Socket Mode settings, event subscriptions, and slash commands.maia slack manifest --write - Open Slack API Apps, select Create New App, choose From an app manifest, select your workspace, and paste the generated manifest.
- Open OAuth & Permissions and verify these bot scopes:
chat:write,app_mentions:read,channels:history,channels:read,groups:history,im:history,im:read,im:write,users:read,files:read, andfiles:write. Addgroups:readif Maia must discover private channels. - Open Socket Mode, enable it, and create an app-level token with the
connections:writescope. Copy the token beginning withxapp-; Maia stores it asSLACK_APP_TOKEN. - Open Event Subscriptions and subscribe the bot to
message.im,message.channels,message.groups, andapp_mention. Missingmessage.channelsormessage.groupsis the usual reason a bot works in direct messages but not in channels. - Open App Home, enable the Messages Tab, and allow users to send messages from that tab. Without this setting, Slack can block direct messages even when the tokens and scopes are correct.
- Install the app to the workspace. Copy the Bot User OAuth Token beginning with
xoxb-; Maia stores it asSLACK_BOT_TOKEN. Reinstall the app whenever you change scopes, events, or slash commands. - In Slack, open each permitted person's profile, select the more-actions menu, and copy their member ID. Use IDs such as
U01ABC2DEF3, not display names. - Run the guided Maia setup and select Slack:
Enter themaia setup gatewayxoxb-bot token, thexapp-app token, and the allowed member IDs when prompted. - Start Maia in the foreground for the first test:
In each Slack channel where Maia must respond, runmaia gateway run/invite @Maia. Send Maia a direct message, then test an@mentionin an invited channel.
Manual Slack configuration
# <MAIA_HOME>/.env
SLACK_BOT_TOKEN=xoxb-...
SLACK_APP_TOKEN=xapp-...
SLACK_ALLOWED_USERS=U01ABC2DEF3,U09TEAMLEAD
SLACK_HOME_CHANNEL=C01234567890
The gateway starts without a Slack authentication error, Maia replies to an allowed administrator in a direct message, and Maia responds when mentioned in every channel where it was invited. Keep SLACK_ALLOWED_USERS narrow until you assign and test governance roles.
Configure Discord step by step
Discord uses a bot application. A working setup requires the correct gateway intents, an invite with the correct scopes and permissions, and stable user or role IDs for admission.
- Open the Discord Developer Portal, select New Application, name the application, and create it.
- Open Bot. Create or reset the bot token and copy it immediately. Store it only in Maia's secret-aware Gateway form or
<MAIA_HOME>/.env; never commit it to source control. - Still under Bot, enable Message Content Intent so Maia can read messages. Enable Server Members Intent so Maia can resolve members and use role-based admission. Save the changes.
- Open Installation and configure a Guild Install, or use the OAuth2 URL generator. Select the
botandapplications.commandsscopes. - Grant at least View Channels, Send Messages, Read Message History, Attach Files, and Send Messages in Threads. Add Embed Links and Add Reactions for Maia's full response experience.
- Open the generated install link, choose your server, and authorize the bot. You must have permission to manage that server. The bot can remain offline until the Maia gateway starts.
- In Discord, open User Settings > Advanced and enable Developer Mode. Right-click your username and select Copy User ID. Copy role and channel IDs the same way if you plan to use role admission or a home channel.
- Run the guided Maia setup and select Discord:
Enter the bot token and at least one allowed user ID. Use an allowed role ID only when every intended member of that role will receive Maia governance.maia setup gateway - Start Maia in the foreground for the first test:
Send the bot a direct message. In a server channel,maia gateway run@mentionMaia unless you deliberately configured that channel for free response.
Manual Discord configuration
# <MAIA_HOME>/.env
DISCORD_BOT_TOKEN=...
DISCORD_ALLOWED_USERS=284102345871466496,198765432109876543
# Or admit members by Discord role:
DISCORD_ALLOWED_ROLES=123456789012345678
DISCORD_HOME_CHANNEL=234567890123456789
# Optional behavior controls
DISCORD_REQUIRE_MENTION=true
DISCORD_FREE_RESPONSE_CHANNELS=234567890123456789
DISCORD_IGNORED_CHANNELS=345678901234567890
DISCORD_AUTO_THREAD=true
The bot appears online after the gateway starts, replies to an allowed administrator in a direct message, and answers an @mention in a server channel it can view. If it is online but silent, verify Message Content Intent first.
SLACK_ALLOWED_USERS, DISCORD_ALLOWED_USERS, and DISCORD_ALLOWED_ROLES only admit an identity to the gateway. On a fresh installation, Maia can bootstrap the first saved identity as admin. Every later human identity remains Pending Governance until an administrator assigns at least one role.
Add another user
- Add or pair the user's platform identity in Gateway.
- Follow the Pending Governance link shown for that identity.
- In Governance → People, assign at least one role and any required teams.
- Ask the user to send
/whoamito verify the mapping. - Test one allowed action and one action that should be denied.
Operate the gateway service
maia gateway status
maia gateway restart
maia logs --follow
Exact service-management commands can vary by platform. Use maia status and maia doctor when the gateway does not start.
Avoid shared bot credentials
If Maia and upstream Hermes run on the same machine, use distinct bot credentials. Configuring the same Discord, Telegram, or other bot in both gateways can produce competing or duplicate replies.