Cover image
Try Now
2025-03-27

3 years

Works with Finder

3

Github Watches

0

Github Forks

1

Github Stars

Discord MCP Bot - Server Component

A Discord bot server that integrates with Mastra's MCP Bot component to provide intelligent assistance and answer questions about Mastra.ai.

Overview

This Discord bot server works with the Mastra MCP component to:

  • Handle Discord interactions and message routing
  • Manage bot commands and permissions
  • Provide Discord-specific functionality like threads and DMs
  • Interface with the Mastra component for intelligent responses

Prerequisites

Getting Started

  1. Clone the repository:

    git clone https://github.com/mastra-ai/discord-mcp-server
    cd discord-mcp-server
    
  2. Install dependencies:

    npm install
    
  3. 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
    
  4. Run the server:

    npm start
    

Setting Up a Discord Bot

  1. Create a Discord application:

    • Go to Discord Developer Portal
    • Click "New Application" and give it a name
    • Navigate to the "Bot" tab and click "Add Bot"
  2. Configure bot permissions:

    • Under "Privileged Gateway Intents", enable:
      • Message Content Intent
      • Server Members Intent
      • Direct Message Intent
  3. Get your bot token:

    • In the Bot tab, click "Reset Token" or "Copy" to get your bot token
    • Add this token to your .env file as DISCORD_BOT_TOKEN
  4. Invite the bot to your server:

    • Go to the "OAuth2" tab, then "URL Generator"
    • Select "bot" under scopes
    • Select required permissions:
      • Read Messages/View Channels
      • Send Messages
      • Read Message History
    • Copy the generated URL and open it in your browser
    • Select your server and authorize the bot

Features

  • Direct Message Support: Users can DM the bot to ask questions
  • Slash Commands: Uses Discord's slash commands to interact with the bot
    • /ask: Ask the bot a question
    • /cleardm: Clear the bot messages in the user's DMs
  • Threads: Uses Discord's threads to provide a better user experience
  • Integration: Seamless integration with the Mastra MCP component

Project Structure

  • api/index.ts: Main bot implementation and Discord client setup
  • scripts/register-commands.ts: Register the bot commands
  • scripts/delete-commands.ts: Delete the bot commands
  • scripts/list-commands.ts: List the bot commands

Implementation Notes

The server is built with:

  • Discord.js for Discord integration
  • TypeScript for type safety and better development experience
  • Integration with Mastra MCP component for intelligent responses

For production deployment, consider:

  • Setting up proper logging
  • Implementing rate limiting
  • Adding monitoring and error tracking
  • Setting up a process manager (PM2, etc.)

Related Projects

  • discord-mcp-bot: Handles Mastra-specific functionality and intelligent responses

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • huahuayu
  • Une passerelle API unifiée pour intégrer plusieurs API d'explorateur de blockchain de type étherscan avec la prise en charge du protocole de contexte modèle (MCP) pour les assistants d'IA.

  • deemkeen
  • Contrôlez votre MBOT2 avec un combo d'alimentation: MQTT + MCP + LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Protocole de connecteur de message) 服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 , 支持员工信息查询和消息发送等功能。

  • pontusab
  • La communauté du curseur et de la planche à voile, recherchez des règles et des MCP

    Reviews

    1 (1)
    Avatar
    user_nMlJ0u0Z
    2025-04-15

    Scraperis_scraper developed by Ai-Quill is an outstanding tool for web scraping tasks. The interface is user-friendly, making it easy for both beginners and experts to navigate and utilize its robust features. The support and documentation provided are exceptional, ensuring that any issues are swiftly resolved. Highly recommend it! Check it out here: https://mcp.so/server/scraperis_scraper/Ai-Quill.