mit einem Klick
discord-cli
// Discord operations via CLI with daemon mode for fast execution. Send messages, read channels, list guilds and threads with persistent connection and auto-restart on code changes.
// Discord operations via CLI with daemon mode for fast execution. Send messages, read channels, list guilds and threads with persistent connection and auto-restart on code changes.
| name | discord-cli |
| description | Discord operations via CLI with daemon mode for fast execution. Send messages, read channels, list guilds and threads with persistent connection and auto-restart on code changes. |
Perform Discord operations via CLI commands with daemon mode for instant responses.
This skill uses a client-daemon architecture:
scripts/daemon.py): Maintains persistent Discord connection, auto-restarts on code changesscripts/dcli.py): Sends commands to daemon via Unix socketBenefits:
.env file exists in skill root with: DISCORD_TOKEN=your_token# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # Linux/Mac
# or: venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Create .env file (add your Discord Token)
echo "DISCORD_TOKEN=your_token_here" > .env
If virtual environment and dependencies are already installed, just activate the environment:
source venv/bin/activate # Linux/Mac
# or: venv\Scripts\activate # Windows
All commands are executed via local scripts/dcli.py:
This server also exposes dedicated MCP tools to run local discrawl commands:
run_discrawl (generic command runner)discrawl_doctordiscrawl_statusdiscrawl_syncdiscrawl_searchdiscrawl_messagesdiscrawl_mentionsBy default this MCP prefers a sibling fork build at ../discrawl-self/bin/discrawl, then falls back to discrawl in PATH.
Use DISCRAWL_BIN if you want to override that:
DISCRAWL_BIN=/absolute/path/to/discrawl
Example MCP payloads:
{"command":"status","config_path":"~/.discrawl/config.toml"}
{"guild":"1234567890","since":"2026-03-01T00:00:00Z","full":true,"config_path":"~/.discrawl/config.toml"}
# Check status
python3 scripts/dcli.py daemon status
# Start Daemon
python3 scripts/dcli.py daemon start
# Stop Daemon
python3 scripts/dcli.py daemon stop
# Restart Daemon
python3 scripts/dcli.py daemon restart
Note: The daemon auto-starts when you run any command if it's not already running.
python3 scripts/dcli.py send-message --channel CHANNEL_ID --content "Hello World"
python3 scripts/dcli.py delete-message --channel CHANNEL_ID --message MESSAGE_ID
python3 scripts/dcli.py pin-message --channel CHANNEL_ID --message MESSAGE_ID
# Create thread from message (in text channel)
python3 scripts/dcli.py create-thread --channel CHANNEL_ID --name "Thread Name" --message MESSAGE_ID
# Create thread in forum channel (with initial content)
python3 scripts/dcli.py create-thread --channel FORUM_CHANNEL_ID --name "Thread Name" --content "Initial post content"
python3 scripts/dcli.py read-messages --channel CHANNEL_ID --limit 20
# Read messages after specific time
python3 scripts/dcli.py read-messages --channel CHANNEL_ID --limit 20 --after "4h"
python3 scripts/dcli.py read-messages --channel CHANNEL_ID --after "2024-01-01T00:00:00"
python3 scripts/dcli.py list-guilds
python3 scripts/dcli.py list-channels --guild GUILD_ID
Note: list-channels may not return Forum Channels. To find a Forum Channel ID, use get-thread-info on any thread in that forum (see Working with Forum Channels).
python3 scripts/dcli.py list-guild-threads --guild GUILD_ID
# List threads active in last 24 hours (default)
python3 scripts/dcli.py list-recent-threads --guild GUILD_ID
# List threads active in last 4 hours
python3 scripts/dcli.py list-recent-threads --guild GUILD_ID --within 4
# Read messages from all threads active in last 4 hours
python3 scripts/dcli.py read-recent-threads --guild GUILD_ID --within 4
# Read max 10 messages per thread
python3 scripts/dcli.py read-recent-threads --guild GUILD_ID --within 4 --limit-per-thread 10
# Get current user info (supported in daemon mode)
python3 scripts/dcli.py user-info
# Specific user lookup is not currently supported in daemon mode
# Active threads only
python3 scripts/dcli.py list-threads --channel CHANNEL_ID
# Include archived threads
python3 scripts/dcli.py list-threads --channel CHANNEL_ID --archived
python3 scripts/dcli.py read-thread --thread THREAD_ID --limit 50
# Read messages after specific time
python3 scripts/dcli.py read-thread --thread THREAD_ID --after "4h"
python3 scripts/dcli.py get-thread-info --thread THREAD_ID
Useful for: Finding the parent channel (forum) ID of a thread via the Parent ID field.
# Archive thread
python3 scripts/dcli.py archive-thread --thread THREAD_ID
# Unarchive thread
python3 scripts/dcli.py archive-thread --thread THREAD_ID --unarchive
# Join thread
python3 scripts/dcli.py join-thread --thread THREAD_ID
# Leave thread
python3 scripts/dcli.py leave-thread --thread THREAD_ID
The skill reads DISCORD_TOKEN from .env file in the skill root directory.
Create a .env file:
DISCORD_TOKEN=your_discord_token_here
Commands that support --after parameter accept the following formats:
4h, 30m, 1d - Relative time (hours, minutes, days)2024-01-01T00:00:00 - ISO datetime1704067200 - Unix timestampImportant: Automating user accounts is against the Discord ToS. Use this at your own risk.
$XDG_RUNTIME_DIR/discord-py-self-mcp or ~/.local/state/discord-py-self-mcpForum Channels are special channels where all conversations happen in threads. To interact with them:
Since list-channels may not show Forum Channels, use this workaround:
# 1. List threads to find one in the forum you're looking for
python3 scripts/dcli.py list-guild-threads --guild GUILD_ID
# 2. Get the thread's info to find its parent (forum) channel ID
python3 scripts/dcli.py get-thread-info --thread THREAD_ID
# Output will show "Parent ID: <forum_channel_id>"
Forum channels require an initial message when creating a thread:
python3 scripts/dcli.py create-thread \
--channel FORUM_CHANNEL_ID \
--name "Thread Title" \
--content "This is the initial post content"
Daemon not responding?
# Check if daemon is running
python3 scripts/dcli.py daemon status
# Restart daemon
python3 scripts/dcli.py daemon restart
Socket errors?
# Clean up and restart
python3 scripts/dcli.py daemon stop
python3 scripts/dcli.py daemon start
Python not found? Ensure Python 3.10+ is installed and available in PATH.