Discord Self MCP
Enables AI agents to interact with Discord via a selfbot, including reading and searching messages, sending messages and replies, listing guilds and channels, and retrieving user and guild member information.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Discord Self MCP Read the last 20 messages from channel 112233445566778899"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Discord Self MCP
An MCP (Model Context Protocol) server that allows AIs to access Discord using selfbot to read messages, manage channels, get user information, and more.
Installation and Usage
Option 1: Direct use with npx (no installation)
You don't need to install anything. Simply configure your MCP client with:
{
"mcpServers": {
"discord": {
"command": "npx",
"args": ["-y", "discord-self-mcp"],
"env": {
"DISCORD_TOKEN": "your_discord_token_here"
}
}
}
}Option 2: Global installation
npm install -g discord-self-mcpThen configure your MCP client:
{
"mcpServers": {
"discord": {
"command": "discord-self-mcp",
"env": {
"DISCORD_TOKEN": "your_discord_token_here"
}
}
}
}Option 3: Local development
# Clone the repository
git clone [repo-url]
cd discord-self-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Configure in your MCP client with the local pathRelated MCP server: discord-user-connector
Discord Token Configuration
The Discord token is passed as an environment variable from your MCP client. DO NOT use local .env files.
How to get your Discord token:
Method 1: Using Console Script (Recommended)
Open Discord in your browser
Press F12 to open developer tools
Go to the "Console" tab
Paste the following code and press Enter:
window.webpackChunkdiscord_app.push([
[Symbol()],
{},
(req) => {
if (!req.c) return
for (let m of Object.values(req.c)) {
try {
if (!m.exports || m.exports === window) continue
if (m.exports?.getToken) return copy(m.exports.getToken())
for (let ex in m.exports) {
if (
m.exports?.[ex]?.getToken &&
m.exports[ex][Symbol.toStringTag] !== 'IntlMessagesProxy'
)
return copy(m.exports[ex].getToken())
}
} catch {}
}
},
])
window.webpackChunkdiscord_app.pop()
console.log('%cWorked!', 'font-size: 50px')
console.log(`%cYou now have your token in the clipboard!`, 'font-size: 16px')Your token will be automatically copied to the clipboard
Method 2: Manual Network Inspection
Open Discord in your browser
Press F12 to open developer tools
Go to the "Network" tab
Look for any request to Discord's API
In the headers, look for "Authorization"
Available Tools
š§ Message Management
mcp_discord_read_channel
Read messages from a Discord channel.
Parameters:
channelId(string, required): The Discord channel ID to read messages fromlimit(number, optional): Number of messages to fetch (default: 50, max: 100)
mcp_discord_search_messages
Search for messages in a Discord channel by content, author, or date range.
Parameters:
channelId(string, required): The Discord channel ID to search messages inquery(string, optional): Text to search for in message contentauthorId(string, optional): Optional: Filter by author IDlimit(number, optional): Number of messages to search through (default: 100, max: 500)before(string, optional): Optional: Search messages before this message IDafter(string, optional): Optional: Search messages after this message ID
mcp_discord_send_message
Send a message to a specific Discord channel.
Parameters:
channelId(string, required): The Discord channel ID to send the message tocontent(string, required): The message content to sendreplyToMessageId(string, optional): Optional: Message ID to reply to
š° Guild and Channel Management
mcp_discord_list_channels
List all accessible channels for the current user.
Parameters:
guildId(string, optional): Optional: Filter channels by guild ID
mcp_discord_list_guilds
List all guilds (servers) the user is in.
Parameters:
None required
š„ User Management
mcp_discord_get_user_info
Get information about the logged-in user.
Parameters:
None required
mcp_discord_list_guild_members
List members of a specific Discord guild/server.
Parameters:
guildId(string, required): The Discord guild ID to list members fromlimit(number, optional): Number of members to fetch (default: 100, max: 1000)includeRoles(boolean, optional): Whether to include role information for each member
Usage Examples in Claude
Once configured, you can use commands like:
Server Management
- "List my Discord servers"
- "Show all channels from server [ID]"
- "How many members does server [ID] have?"Message Reading
- "Read the last 20 messages from channel [ID]"
- "Search for messages containing 'meeting' in channel [ID]"
- "Show messages from user [ID] in channel [ID]"Interaction
- "Send a message to channel [ID] saying 'Hello world'"
- "Reply to message [ID] with 'Thanks for the information'"User Information
- "Show my Discord information"
- "List members of server [ID] with their roles"Features
ā Message reading with advanced filters
ā Message searching by content, author, and date
ā Message sending with reply support
ā Server management and channel listing
ā User information and member management
ā Robust error handling
ā Complete parameter validation
ā Relative time formatting (e.g., "2 hours ago")
ā Support for attachments and embeds
Project Structure
src/
āāā index.ts # Main MCP server
āāā types.ts # TypeScript type definitions
āāā tool-definitions.ts # MCP tool schemas
āāā message-handlers.ts # Message handling functions
āāā guild-handlers.ts # Guild/server handling functions
āāā user-handlers.ts # User handling functions
āāā utils.ts # Common utilitiesWarning
This project uses selfbot, which goes against Discord's terms of service. Use it at your own risk and only for educational or personal purposes.
Contributing
Contributions are welcome! Please:
Fork the project
Create a feature branch (
git checkout -b feature/new-functionality)Commit your changes (
git commit -am 'feat: add new functionality')Push to the branch (
git push origin feature/new-functionality)Open a Pull Request
Available Tools
7 toolsget_user_infoB
Get information about the logged-in user
Inputs: no named parameters.
list_channelsB
List all accessible channels for the current user
Inputs: guildId.
list_guild_membersC
List members of a specific Discord guild/server
Inputs: guildId (required), limit, includeRoles.
list_guildsA
List all guilds (servers) the user is in
Inputs: no named parameters.
read_channelC
Read messages from a Discord channel
Inputs: channelId (required), limit.
search_messagesB
Search for messages in a Discord channel by content, author, or date range
Inputs: channelId (required), after, limit, query, +2 more.
send_messageC
Send a message to a specific Discord channel
Inputs: content (required), channelId (required), replyToMessageId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 7 tools
Each tool has a clearly distinct resource+action target: listing (guilds, channels, members), reading (read_channel), searching, sending, and user info. read_channel and search_messages both return messages, but the descriptions make the filtering role of search_messages explicit, so misselection risk is low.
All seven tools follow a consistent snake_case verb_noun pattern (list_guilds, list_channels, list_guild_members, send_message, read_channel, get_user_info, search_messages). No camelCase or vague-verb outliers.
Seven tools is well within the 3-15 sweet spot and matches the modest scope of a personal Discord client. Every tool maps to a distinct operation with no filler.
The surface covers browsing and sending, but there is no edit_message or delete_message, so a sent message can never be corrected or removed, and no direct-message capability despite being a self-user client. Fetching a single message by ID or listing DM channels are also notable gaps.
Maintenance
Related MCP Connectors
Discord MCP server for ChatGPT, Claude and any AI agent: list servers and channels, read channel messages, search messages, send message, reply to message, send DM, read mentions and assign role in your own Discord account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Discord yourself; Cotlet does not store your password and you need no Discord API key. About the official Discord API: Yes, Discord has an official API for bots and OAuth2 apps, but it acts as a bot that a server manager adds, not as you, and Discord has no official MCP server for it (checked 5 Nov 2026). The MCP server on Discord's docs site only searches documentation. Setup and FAQ: https://cotlet.dev/integrations/discord-api-mcp-server
Connect a Discord bot (bot token from the developer portal) to read/send messages, list guilds and c
The AI admin for Discord: manage channels, roles, members, moderation and automations.
Build Discord communities with AI: roles, channels, modules, automations and reviewed announcements.
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables LLMs to read and send Discord messages, list servers and channels, and monitor unread messages via a selfbot that uses a user token (violates Discord ToS).825 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to access and interact with a Discord user account via the Discord client API, allowing them to read servers, channels, DMs, mentions, and message history, and optionally send messages and perform other actions.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with a Discord account to read channels, send and manage messages, handle DMs and reactions, search messages, and update status.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with the Discord platform, including servers, members, roles, channels, categories, forum posts, messages, reactions, and webhooks. It supports logging in a bot, reading and searching messages, and creating, editing, or deleting Discord resources through natural language.1,560 npmMIT