The myMCP Slack integration enables seamless communication between your game world and Slack workspace, providing:
- Real-time game notifications in Slack channels
- Interactive slash commands for game control
- Smart dashboards with player statistics and activity charts
- Bidirectional chat between Slack and the game AI
- Team collaboration features for multiplayer gaming
┌─────────────────┐ ┌──────────────────┐ ┌─────────────┐
│ Slack Users │◄─────►│ Slack Integration│◄─────►│ Game Engine │
└─────────────────┘ └──────────────────┘ └─────────────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Redis │ │ EventBroadcaster│
│ Pub/Sub │◄─────────│ Service │
└─────────────┘ └─────────────┘
The integration broadcasts these game events to Slack:
- Chat Messages: Player and AI conversations
- Quest Updates: Quest starts, completions, and step progress
- Achievements: Level ups and special accomplishments
- Player Movement: Location changes (when broadcast-enabled)
- Score Changes: Points earned or lost
Available commands via /mymcp:
/mymcp help- Display available commands/mymcp status [player]- View player status/mymcp leaderboard- Show top 10 players/mymcp quest list- List available quests/mymcp chat <message>- Send message to game
Auto-updating dashboard includes:
- Total and active player counts
- 24-hour activity chart
- Real-time updates every 5 minutes
- Visual player engagement metrics
Automated daily reports at 9 AM featuring:
- 24-hour active player count
- Total combined score
- Top player highlights
- Engagement metrics
The EventBroadcaster service publishes game events to Redis channels:
// Event channels
- game:chat
- game:quest:started
- game:quest:completed
- game:player:levelup
- game:player:achievement
- game:player:location
- game:state:updateThe integration uses:
- Slack Bolt SDK for app framework
- Socket Mode for real-time events
- Web API for message posting
- Block Kit for rich formatting
Slack users are mapped to game players using:
- Format:
slack-{userId} - Automatic player creation on first interaction
- Persistent player state across sessions
cd packages/slack-integration
npm installCreate a new Slack app at api.slack.com/apps with:
OAuth Scopes:
chat:writechat:write.publiccommandsim:historyim:readim:writechannels:historychannels:read
Features:
- Socket Mode enabled
- Slash commands configured
- Event subscriptions active
Create .env file:
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_APP_TOKEN=xapp-your-app-token
SLACK_SIGNING_SECRET=your-signing-secret
SLACK_DEFAULT_CHANNEL=#mymcp-game
SLACK_DASHBOARD_CHANNEL=#mymcp-dashboard
REDIS_URL=redis://localhost:6379
ENGINE_URL=http://localhost:3000# Development
npm run dev
# Production
npm run build && npm startTeam Lead: /mymcp quest list
Bot: 📜 Available Quests:
- Council of Three Realms
- Dungeon Keeper's Vigil
- Cryptomancer's Seal
Team Lead: /mymcp chat Let's tackle the Council quest together!
Bot: Excellent choice! The Council of Three Realms requires coordination...
Team Member: /mymcp status
Bot: Level: Apprentice | Score: 150 | Location: Town
The dashboard channel shows:
📊 myMCP Live Dashboard
Total Players: 25
Active Now: 12
[Activity Chart]
Last updated: Dec 28 at 3:45 PM
🏆 Alice earned a new achievement!
Realm Uniter
Successfully coordinated the Council of Three Realms
🎉 Bob leveled up!
Previous Level: Novice
New Level: Apprentice
Configure different Slack channels for different events:
this.eventChannels = {
'game:quest:completed': '#achievements',
'game:player:levelup': '#achievements',
'game:chat': '#game-chat'
};Built-in rate limiting prevents spam:
- 1 message per second per event type
- Dashboard updates every 5 minutes
- Respects Slack API limits
Works seamlessly with multiplayer setup:
- Receives events from all game engines
- Consolidates player data across instances
- Maintains consistent state
-
Bot not responding
- Verify bot is invited to channels
- Check Socket Mode is enabled
- Confirm tokens are correct
-
Missing events
- Ensure Redis is running
- Check engine EventBroadcaster is active
- Verify Redis connection string
-
Dashboard not updating
- Check dashboard channel permissions
- Verify scheduled tasks are running
- Look for errors in console logs
Enable debug logging:
DEBUG=slack:*-
Channel Organization
- Use dedicated channels for different purposes
- Set appropriate notification levels
- Archive old game channels
-
Security
- Rotate tokens regularly
- Use environment variables
- Limit bot permissions
-
Performance
- Monitor Redis memory usage
- Implement event filtering if needed
- Use channel-specific broadcasting
Planned features include:
- Discord integration
- Microsoft Teams support
- Custom notification rules
- Advanced analytics dashboards
- Voice command support
- Mobile app notifications
class SlackIntegration {
constructor(config: SlackConfig)
async start(): Promise<void>
async stop(): Promise<void>
}interface SlackConfig {
botToken: string
appToken: string
signingSecret: string
defaultChannel: string
dashboardChannel?: string
redisUrl?: string
engineUrl?: string
}To add new features:
- Add event types to EventBroadcaster
- Subscribe to events in SlackIntegration
- Create handler methods
- Update documentation
For issues or questions:
- Check setup guide in
SETUP.md - Review console logs
- Verify Slack app configuration
- Test Redis connectivity