
maol-1997/discord-self-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
An MCP (Model Context Protocol) server that allows AIs to access Discord using selfbot to read messages, manage channels, get user information, and more.
Обзор
An MCP (Model Context Protocol) server that allows AIs to access Discord using selfbot to read messages, manage channels, get user information, and more. You don't need to install anything. Simply configure your MCP client with: The Discord token is passed as an environment variable from your MCP client. use local .env files. 1. Open Discord in your browser 2. Press F12 to open developer tools 3. Go to the "Console" tab 4. Paste the following code and press Enter: 5. Your token will be automatically copied to the clipboard 1. Open Discord in your browser 2. Press F12 to open developer tools 3. Go to the "Network" tab 4. Look for any request to Discord's API 5. In the headers, look for "Authorization" - channelId (string, required): The Discord channel ID to read messages from - limit (number, optional): Number of messages to fetch (default: 50, max: 100) Search for messages in a Discord channel by content, author, or date range.
README
Показан фрагмент оригинального README. Открыть оригинал.
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-mcp
Then 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 path
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 content
Установка
npx -y discord-self-mcpКонфигурация
{
"mcpServers": {
"discord": {
"command": "npx",
"args": ["-y", "discord-self-mcp"],
"env": {
"DISCORD_TOKEN": "your_discord_token_here"
}
}
}
}