Cover image
Try Now
2025-01-21

Discord MCP Server pour l'intégration de Claude

3 years

Works with Finder

1

Github Watches

20

Github Forks

55

Github Stars

Discord MCP Server

A Model Context Protocol (MCP) server that enables LLMs to interact with Discord channels, allowing them to send and read messages through Discord's API. Using this server, LLMs like Claude can directly interact with Discord channels while maintaining user control and security.

Features

  • Send messages to Discord channels
  • Read recent messages from channels
  • Automatic server and channel discovery
  • Support for both channel names and IDs
  • Proper error handling and validation

Prerequisites

  • Node.js 16.x or higher
  • A Discord bot token
  • The bot must be invited to your server with proper permissions:
    • Read Messages/View Channels
    • Send Messages
    • Read Message History

Setup

  1. Clone this repository:
git clone https://github.com/yourusername/discordmcp.git
cd discordmcp
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory with your Discord bot token:
DISCORD_TOKEN=your_discord_bot_token_here
  1. Build the server:
npm run build

Usage with Claude for Desktop

  1. Open your Claude for Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the Discord MCP server configuration:

{
  "mcpServers": {
    "discord": {
      "command": "node",
      "args": ["path/to/discordmcp/build/index.js"],
      "env": {
        "DISCORD_TOKEN": "your_discord_bot_token_here"
      }
    }
  }
}
  1. Restart Claude for Desktop

Available Tools

send-message

Sends a message to a specified Discord channel.

Parameters:

  • server (optional): Server name or ID (required if bot is in multiple servers)
  • channel: Channel name (e.g., "general") or ID
  • message: Message content to send

Example:

{
  "channel": "general",
  "message": "Hello from MCP!"
}

read-messages

Reads recent messages from a specified Discord channel.

Parameters:

  • server (optional): Server name or ID (required if bot is in multiple servers)
  • channel: Channel name (e.g., "general") or ID
  • limit (optional): Number of messages to fetch (default: 50, max: 100)

Example:

{
  "channel": "general",
  "limit": 10
}

Development

  1. Install development dependencies:
npm install --save-dev typescript @types/node
  1. Start the server in development mode:
npm run dev

Testing

You can test the server using the MCP Inspector:

npx @modelcontextprotocol/inspector node build/index.js

Examples

Here are some example interactions you can try with Claude after setting up the Discord MCP server:

  1. "Can you read the last 5 messages from the general channel?"
  2. "Please send a message to the announcements channel saying 'Meeting starts in 10 minutes'"
  3. "What were the most recent messages in the development channel about the latest release?"

Claude will use the appropriate tools to interact with Discord while asking for your approval before sending any messages.

Security Considerations

  • The bot requires proper Discord permissions to function
  • All message sending operations require explicit user approval
  • Environment variables should be properly secured
  • Token should never be committed to version control
  • Channel access is limited to channels the bot has been given access to

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions:

  1. Check the GitHub Issues section
  2. Consult the MCP documentation at https://modelcontextprotocol.io
  3. Open a new issue with detailed reproduction steps

相关推荐

  • 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.

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

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

  • 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

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

  • av
  • Exécutez sans effort LLM Backends, API, Frontends et Services avec une seule commande.

  • 1Panel-dev
  • 🔥 1Panel fournit une interface Web intuitive et un serveur MCP pour gérer des sites Web, des fichiers, des conteneurs, des bases de données et des LLM sur un serveur Linux.

  • Mintplex-Labs
  • L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.

  • GeyserMC
  • Une bibliothèque de communication avec un client / serveur Minecraft.

  • awslabs
  • Serveurs AWS MCP - Serveurs MCP spécialisés qui apportent les meilleures pratiques AWS directement à votre flux de travail de développement

  • appcypher
  • Serveurs MCP géniaux - une liste organisée de serveurs de protocole de contexte de modèle

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.

    Reviews

    5 (1)
    Avatar
    user_dAVhmDTb
    2025-04-17

    I'm extremely impressed with discordmcp by v-3. This tool enhances my Discord experience by providing seamless integration and efficient multipurpose functionalities. The intuitive interface and robust performance make it an indispensable resource for managing multiple channels. I highly recommend checking out discordmcp on GitHub!