Discord MCP

Discord MCP

Enables AI assistants to interact with Discord servers, including listing servers/channels, sending messages, and managing reaction-based opt-in campaigns.

Category
访问服务器

README

Discord MCP Server

⚠️ ALPHA SOFTWARE - This project is in early alpha development. Features may be incomplete or buggy. Use at your own risk.

A Model Context Protocol (MCP) server that provides Discord integration tools for AI assistants like Claude.

Current Version: 0.0.1-alpha1 (Local Development)

Project Status

  • 🔬 Phase: Local Development - Testing with MCP Inspector
  • 📋 Next: Alpha Release - Publish to PyPI for Claude Desktop testing
  • 🎯 Future: Beta & v1.0 - Feature-complete and stable

See specs/ROADMAP.md for version planning.

Overview

This MCP server enables AI assistants to interact with Discord servers through tools for:

  • Core Operations: List servers, channels, send messages
  • Campaign System: Reaction-based opt-in campaigns with reminders
  • 🚧 Future Features: Role management, member analytics, thread support, and more

Development Setup

Prerequisites

  1. Python 3.10+ with uv package manager
  2. Discord Bot: Create at Discord Developer Portal
  3. Node.js (for MCP Inspector)

Installation

# Clone repository
git clone https://github.com/yourusername/mcp-discord.git
cd mcp-discord

# Install with uv
uv pip install -e ".[dev]"

Configuration

Create a .env file:

DISCORD_TOKEN=your_discord_bot_token_here
MCP_DISCORD_DB_PATH=discord_mcp.db
LOG_LEVEL=INFO
DRY_RUN=false  # Set to true for testing without Discord API

Testing with MCP Inspector

The MCP Inspector lets you test tools locally before deploying.

1. Start the MCP Inspector

npx @modelcontextprotocol/inspector python -m discord_mcp

This will:

  • Start your Discord MCP server
  • Launch the MCP Inspector web UI
  • Open in your browser (usually http://localhost:5173)

2. Test Available Tools

In the inspector, you can test:

  • discord_list_servers - See all servers your bot is in
  • discord_list_channels - List channels in a server
  • discord_send_message - Send test messages
  • discord_create_campaign - Create reaction campaigns
  • And more...

3. Alternative: Direct Module Run

# Run server directly (for stdio transport)
python -m discord_mcp

# Run with development script
python dev.py server

# Run with inspector mode
python dev.py inspector

Claude Desktop Configuration (Alpha/Beta Only)

⚠️ Not ready yet - First test locally with inspector, then we'll publish to PyPI

Once published to PyPI, you can configure Claude Desktop:

Windows: Edit %APPDATA%\Claude\claude_desktop_config.json Mac: Edit ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "discord": {
      "command": "python",
      "args": ["-m", "discord_mcp"],
      "env": {
        "DISCORD_TOKEN": "your_token_here",
        "MCP_DISCORD_DB_PATH": "C:\\path\\to\\discord_mcp.db",
        "LOG_LEVEL": "INFO"
      }
    }
  }
}

Restart Claude Desktop to load the server.

Available Tools (v0.0.1-alpha)

Core Discord Tools

  • discord_list_servers - List all Discord servers
  • discord_list_channels - List channels with type filtering
  • discord_get_channel_info - Get detailed channel information
  • discord_bot_status - Check bot connection status
  • discord_get_recent_messages - Retrieve recent messages
  • discord_get_message - Get specific message by ID
  • discord_send_message - Send messages with reply support

Campaign & Reminder Tools

  • discord_create_campaign - Create reaction opt-in campaigns
  • discord_tally_optins - Track campaign participants
  • discord_list_optins - List opt-ins with pagination
  • discord_build_reminder - Build reminder messages
  • discord_send_reminder - Send reminders with rate limiting
  • discord_run_due_reminders - Process scheduled reminders

See specs/implemented/core_tools.md for detailed documentation.

Environment Variables

Variable Required Default Description
DISCORD_TOKEN Yes - Discord bot token
MCP_DISCORD_DB_PATH No discord_mcp.db SQLite database path
GUILD_ALLOWLIST No - Comma-separated server IDs to restrict access
LOG_LEVEL No INFO Logging level (DEBUG, INFO, WARNING, ERROR)
DRY_RUN No false Test mode without Discord API calls

Development Commands

# Run tests
uv run pytest

# Format code
uv run black src/ tests/
uv run isort src/ tests/

# Build package
uv build

# Run MCP inspector
npx @modelcontextprotocol/inspector python -m discord_mcp

Project Structure

discord-mcp/
├── src/discord_mcp/          # Main package
│   ├── server.py             # MCP server entry point
│   ├── __main__.py           # Module runner (python -m discord_mcp)
│   ├── config.py             # Configuration
│   ├── discord_client/       # Discord bot implementation
│   ├── database/             # SQLite models & repos
│   ├── tools/                # MCP tool implementations
│   └── server_registry/      # Legacy entity registry
├── tests/                    # Test suite
├── specs/                    # Documentation
│   ├── implemented/          # Current features
│   ├── future/               # Planned features
│   └── ROADMAP.md            # Version roadmap
├── pyproject.toml            # Package configuration
└── README.md                 # This file

Known Issues & Limitations

  • ⚠️ Alpha quality - Bugs expected
  • ⚠️ Limited features - Only basic tools implemented
  • ⚠️ No error recovery - Some edge cases not handled
  • ⚠️ Database migrations - Manual schema updates may be needed

See GitHub Issues for known bugs.

Contributing

This is an alpha project - contributions welcome but expect things to change!

  1. Test locally with MCP Inspector first
  2. Check specs/ROADMAP.md for planned features
  3. Open an issue to discuss changes
  4. Submit PR against develop branch

Release Stages

  • Now (Local): Testing with MCP Inspector only
  • Alpha (0.0.x): Published to PyPI, testing with Claude Desktop
  • Beta (0.1.x): Feature-complete, polishing bugs
  • Release (1.0.0): Stable, production-ready

License

MIT License - see LICENSE file.

Support


Remember: This is alpha software. Always test in a non-production Discord server first!

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选