Skip to main content
Glama
publish-safely.shโ€ข2.98 kB
#!/bin/bash echo "๐Ÿ”’ Discord MCP - Safe GitHub Publication Script" echo "==============================================" # Step 1: Critical Security Check echo "" echo "๐Ÿšจ STEP 1: CRITICAL SECURITY CHECK" if [ -f ".env" ]; then echo "โš ๏ธ .env file exists - checking for real tokens..." if grep -qE "MTM[A-Za-z0-9_-]{70,}" ".env" 2>/dev/null; then echo "โŒ Real Discord token found in .env file!" echo " You MUST regenerate your Discord bot token before publishing!" echo " Go to: https://discord.com/developers/applications" echo "" read -p "Have you regenerated your Discord token? (y/N): " token_regenerated if [[ $token_regenerated != "y" && $token_regenerated != "Y" ]]; then echo "๐Ÿ›‘ STOPPING: Please regenerate your token first!" exit 1 fi else echo "โœ… No real tokens found in .env file" fi fi # Step 2: Clean sensitive files echo "" echo "๐Ÿงน STEP 2: CLEANING SENSITIVE FILES" if [ -f "URGENT_TOKEN_SECURITY.md" ]; then rm URGENT_TOKEN_SECURITY.md echo "โœ… Removed security warning file" fi # Remove any remaining sensitive files find . -name "*.log" -delete 2>/dev/null || true echo "โœ… Cleaned up sensitive files" # Step 3: Verify .gitignore echo "" echo "๐Ÿ” STEP 3: VERIFYING .gitignore" if grep -q "\.env$" .gitignore; then echo "โœ… .env is properly ignored" else echo "โŒ .env is NOT in .gitignore!" exit 1 fi # Step 4: Check for real secrets in staged files (not templates) echo "" echo "๐Ÿ” STEP 4: SCANNING FOR REAL SECRETS" if git diff --cached | grep -qE "(MTM[A-Za-z0-9_-]{70,}|[A-Za-z0-9_-]{50,}\.[A-Za-z0-9_-]{6}\.[A-Za-z0-9_-]{25,})"; then echo "๐Ÿšจ ERROR: Real Discord tokens detected in staged changes!" git diff --cached | grep -E "(MTM[A-Za-z0-9_-]{70,}|[A-Za-z0-9_-]{50,}\.[A-Za-z0-9_-]{6}\.[A-Za-z0-9_-]{25,})" || true exit 1 else echo "โœ… No real secrets detected in staged changes" fi # Step 5: Build test echo "" echo "๐Ÿ—๏ธ STEP 5: BUILD TEST" if npm run build > /dev/null 2>&1; then echo "โœ… Build successful" else echo "โŒ Build failed! Fix errors before publishing." npm run build exit 1 fi # Step 6: Final confirmation echo "" echo "โœ… ALL SECURITY CHECKS PASSED!" echo "" echo "๐Ÿ“‹ FINAL CHECKLIST:" echo " โœ… No real tokens in code" echo " โœ… Sensitive files removed" echo " โœ… .gitignore configured" echo " โœ… No secrets in staged changes" echo " โœ… Build successful" echo "" echo "๐Ÿš€ Ready to publish to GitHub!" echo "" echo "Next steps:" echo "1. git add ." echo "2. git commit -m 'feat: secure Discord MCP server with comprehensive security setup'" echo "3. git push origin main" echo "" echo "๐Ÿ”’ After publishing, enable these GitHub features:" echo " - Branch protection rules" echo " - Required reviews for PRs" echo " - Secret scanning (GitHub Advanced Security)" echo " - Dependabot security updates"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/drvova/discord-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server