A Discord bot server that integrates with Mastra's MCP Bot component to provide intelligent assistance and answer questions about Mastra.ai through direct messages and slash commands.
A Discord bot server that integrates with Mastra's MCP Bot component to provide intelligent assistance and answer questions about Mastra.ai.
This Discord bot server works with the Mastra MCP component to:
Clone the repository:
git clone https://github.com/mastra-ai/discord-mcp-server cd discord-mcp-server
Install dependencies:
npm install
Create a .env
file with your Discord credentials:
DISCORD_BOT_TOKEN=your_discord_bot_token
DISCORD_CLIENT_ID=your_discord_client_id
DISCORD_PUBLIC_KEY=your_discord_public_key
MASTRA_URL=your_mastra_url
Run the server:
npm start
Create a Discord application:
Configure bot permissions:
Get your bot token:
.env
file as DISCORD_BOT_TOKEN
Invite the bot to your server:
/ask
: Ask the bot a question/cleardm
: Clear the bot messages in the user's DMsapi/index.ts
: Main bot implementation and Discord client setupscripts/register-commands.ts
: Register the bot commandsscripts/delete-commands.ts
: Delete the bot commandsscripts/list-commands.ts
: List the bot commandsThe server is built with:
For production deployment, consider:
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!