discord.py-self
comprehensive Discord selfbot MCP server using discord.py-self
claude mcp add --transport stdio microck-discord.py-self-mcp python3 -m discord_py_self_mcp.main \
--env DISCORD_TOKEN="${DISCORD_TOKEN}"How to use
discord-py-self-mcp is a local MCP server that exposes a set of tools to control a Discord account via the selfbot library. It leverages the discord_py_self_mcp implementation to provide capabilities such as reading messages, sending messages, managing channels, handling friends and relationships, and interacting with messages, avatars, and presence. The server runs with stdio transport, meaning your MCP client launches it as a subprocess and passes secrets (like DISCORD_TOKEN) through environment variables. Use the included setup and configuration flow to generate an mcp.json configuration and then deploy it in your MCP client. The supported features map closely to the discord-py-self capabilities, including message operations (read, send, edit, delete), channel management (create, delete, list), voice actions (join/leave), friend management, presence updates, slash interactions (buttons and menus), thread operations, and profile edits.
How to install
Prerequisites:
- Python 3.10+
- uv (recommended) or pip
- Optional: system dependencies for voice support on Linux (libffi-dev/libffi-devel and python-dev)
Install using uv (recommended for Python users):
uv tool install git+https://github.com/Microck/discord.py-self-mcp.git
Install using pip/PyPI (alternative):
pip install git+https://github.com/Microck/discord.py-self-mcp.git
Then run the server (example):
DISCORD_TOKEN="your_discord_token_here" python3 -m discord_py_self_mcp.main
If you prefer using uv for a more managed workflow, you can also configure the MCP via the provided mcp.json examples and environment variables as shown in the README.
Additional notes
Tips and notes:
- The server uses a selfbot approach which acts as your user account; automating a user account is against Discord ToS. Use at your own risk.
- Ensure your environment provides DISCORD_TOKEN securely through the client env configuration (you can use ${DISCORD_TOKEN} for expansion).
- Voice support on Linux may require system packages (libffi-dev, python-dev) and PyNaCl; install as needed.
- If your MCP client does not expand ${DISCORD_TOKEN}, replace it with the literal token value in the mcp config.
- The npm wrapper exists as discord-selfbot-mcp, but this MCP server is the Python implementation (discord_py_self_mcp). The npm package is optional if you intend to use the Node.js wrapper.
- For setup and config generation, you can use the interactive setup scripts described in the README (discord-selfbot-mcp-setup for npm or python3 -m discord_py_self_mcp.setup for Python).
Related MCP Servers
MCP-Bridge
A middleware to provide an openAI compatible endpoint that can call MCP tools
mcp-google-ads
An MCP tool that connects Google Ads with Claude AI/Cursor and others, allowing you to analyze your advertising data through natural language conversations. This integration gives you access to campaign information, performance metrics, keyword analytics, and ad management—all through simple chat with Claude, Cursor or Windsurf.
mcp-rquest
A MCP server providing realistic browser-like HTTP request capabilities with accurate TLS/JA3/JA4 fingerprints for bypassing anti-bot measures. It also supports converting PDF and HTML documents to Markdown for easier processing by LLMs.
apple-mail
MCP server giving AI assistants full access to Apple Mail - read, search, compose, organize & analyze emails via natural language
asterisk
Asterisk Model Context Protocol (MCP) server.
django-admin
Expose Django admin models to MCP (Model Context Protocol) clients. Add a mixin to your ModelAdmin classes and let AI assistants like Claude perform CRUD operations, execute admin actions, and explore relationships—all respecting Django's permission system.