xiaohongshu
xiaohongshu
discord-integration
Use when sending Discord messages or encountering bot permission errors - provides three-tier integration methods with automatic fallback (MCP → REST API → Gateway); prevents wasted time on OAuth scope issues
Full skill instructions
Comprehensive skill for working with Discord from Claude Code using multiple methods with automatic fallback.
Use this skill when the user wants to:
Trigger phrases:
Do NOT use this skill for:
~/.claude/discordmcp/.env~/Dev/tjr-suite/.envImportant: These are separate bots. Do not confuse their configurations.
Availability: After Claude Code full restart
Tools: mcp__discord__send-message, mcp__discord__read-messages
Pros:
Cons:
Availability: Always (if bot token configured)
Script: ~/.claude/discordmcp/send-test-message.js
Pros:
Cons:
Availability: Always Method: Direct curl to Discord API v10
Pros:
Cons:
ALWAYS follow this priority order - do NOT skip steps:
User requests Discord interaction
↓
STEP 1: Are MCP tools available? (mcp__discord__send-message)
YES → REQUIRED: Use MCP tools (Method 1)
NO ↓
↓
STEP 2: Can we use send-test-message.js? (file exists, token configured)
YES → REQUIRED: Use Gateway script (Method 2)
NO ↓
↓
STEP 3: Try REST API (Method 3) with warning about limitations
↓
FALLBACK LOGIC:
- If Method 1 fails → Immediately try Method 2
- If Method 2 fails → Try Method 3
- If Method 3 fails → Report error with troubleshooting steps
CRITICAL: You MUST attempt Method 1 (MCP) first, even if you think it won't work. Only fall back after confirming failure.
Before attempting any Discord interaction, determine which method is available:
Try MCP tools first:
// Attempt to use MCP tool
mcp__discord__send-message({
channel: "CHANNEL_ID",
message: "Test"
})
If you get "No such tool available" error → MCP not loaded
Fall back to Gateway script:
# Check if script exists
ls -la ~/.claude/discordmcp/send-test-message.js
# Check if token configured
grep DISCORD_TOKEN ~/.claude/discordmcp/.env
REST API as last resort (expect permission issues)
Send Message:
mcp__discord__send-message({
channel: "1420759585349697710", // Channel ID or name
message: "Your message here"
})
Read Messages:
mcp__discord__read-messages({
channel: "1420759585349697710",
limit: 10 // 1-100
})
Send Message:
cd ~/.claude/discordmcp
node send-test-message.js CHANNEL_ID "Optional custom message"
# Example:
node send-test-message.js 1420759585349697710 "Hello from Claude Code"
Custom Message: Create a modified version of the script or pass message as argument.
Send Message:
curl -X POST "https://discord.com/api/v10/channels/CHANNEL_ID/messages" \
-H "Authorization: Bot ${DISCORD_BOT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"content": "Your message"}'
Note: Will likely fail with "Missing Access" - see troubleshooting.
See troubleshooting section below for specific error codes and solutions.
If you encounter these situations, STOP and address them immediately:
❌ Skipping MCP method without trying first
mcp__discord__send-message before assuming it won't work❌ Not checking bot permissions before sending
❌ Retrying same failed method repeatedly
❌ Missing token/credentials setup
/users/@me endpoint❌ Not handling 403 Forbidden errors properly
❌ Using REST API when Gateway methods are available
Before marking Discord integration as complete, verify:
mcp__discord__send-message before other methods/users/@me endpoint returns valid bot info~/.claude/mcp.jsoncd ~/.claude/discordmcp && npm run build~/.claude/discordmcp/.envDISCORD_BOT_TOKEN environment variable setCause: Discord MCP server not loaded in Claude Code.
Solutions:
Verify MCP configuration exists:
grep -A 5 '"discord"' ~/.claude/mcp.json
Should show:
"discord": {
"type": "stdio",
"command": "node",
"args": ["/Users/USERNAME/.claude/discordmcp/build/index.js"]
}
Verify MCP server is built:
ls -la ~/.claude/discordmcp/build/index.js
Test MCP server manually:
cd ~/.claude/discordmcp
node build/index.js
Should see: "Discord bot is ready!" and "Discord MCP Server running on stdio"
Fully restart Claude Code:
If still not available, use Method 2 (Gateway script) instead.
Cause: Bot doesn't have permission to access that channel.
Solutions:
Verify bot is in the server:
curl -H "Authorization: Bot TOKEN" \
https://discord.com/api/v10/users/@me/guilds
Check channel-specific permissions:
Grant server-wide permissions:
If using REST API, switch to Gateway method (discord.js or MCP tools)
Cause: Bot is not in that Discord server.
Solutions:
Verify bot membership:
curl -H "Authorization: Bot TOKEN" \
https://discord.com/api/v10/users/@me/guilds
Invite bot to server using OAuth2 URL:
For Sombra (Local MCP):
https://discord.com/api/oauth2/authorize?client_id=1435274653126889544&permissions=69632&scope=bot
For GladOSv3 (tjr-suite):
https://discord.com/api/oauth2/authorize?client_id=1425850836277395506&permissions=69632&scope=bot
After inviting, wait a few seconds for bot to join
Verify the bot appears in server member list
Cause: Token invalid or bot permissions insufficient.
Solutions:
Verify token is correct:
curl -H "Authorization: Bot TOKEN" \
https://discord.com/api/v10/users/@me
Should return bot user info, not error.
Check token hasn't been regenerated:
Verify bot has proper Gateway intents:
Check .env file syntax:
cat ~/.claude/discordmcp/.env
No extra spaces, quotes, or newlines around token.
Cause: Invalid channel ID or bot can't see it.
Solutions:
Verify channel ID is correct:
Check bot can see the channel:
Try using channel name instead of ID (if using MCP tools):
mcp__discord__send-message({
channel: "bot-testing-grounds", // Name instead of ID
message: "Test"
})
Files:
~/.claude/discordmcp/.env~/.claude/mcp.json (lines 55-61)~/.claude/discordmcp/src/index.ts~/.claude/discordmcp/build/index.jsEnvironment Variables:
DISCORD_TOKEN=MTQzNTI3NDY1MzEyNjg4OTU0NA...
DISCORD_CLIENT_ID=1435274653126889544
DISCORD_GUILD_ID=745376918030909471
DISCORD_ENABLED=true
Rebuild after changes:
cd ~/.claude/discordmcp
npm run build
Files:
~/Dev/tjr-suite/.env~/Dev/tjr-suite/packages/app/src/services/discord/http://localhost:3000Environment Variables:
DISCORD_TOKEN=MTQyNTg1MDgzNjI3NzM5NTUwNg...
DISCORD_CLIENT_ID=1425850836277395506
DISCORD_GUILD_ID=745376918030909471
DISCORD_ENABLED=true
Note: GladOSv3 is always running as part of tjr-suite. Do not confuse with Sombra.
Nice Wolf Studio Server:
Minimum (for message sending):
Recommended:
Permission Integer: 69632 (includes all recommended)
Visit: https://discordapi.com/permissions.html
Enter desired permissions, copy the integer for OAuth2 URL.
When setting up or troubleshooting Discord integration:
/users/@me endpoint)/users/@me/guilds)curl -H "Authorization: Bot TOKEN" https://discord.com/api/v10/users/@me
curl -H "Authorization: Bot TOKEN" https://discord.com/api/v10/users/@me/guilds
cd ~/.claude/discordmcp && node build/index.js
cd ~/.claude/discordmcp && node send-test-message.js CHANNEL_ID "Message"
grep -A 5 '"discord"' ~/.claude/mcp.json
See examples.md in this skill directory for complete working examples.
~/.claude/discordmcp/SETUP_COMPLETE.md~/.claude/discordmcp/VALIDATION_REPORT.md~/.claude/discordmcp/send-test-message.jsREQUIRED NEXT STEPS:
OPTIONAL NEXT STEPS:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience