MCP server exposing Twitch SDK as tools for AI assistants
Project description
twitch-mcp
MCP server exposing 110+ Twitch API tools for AI assistants
Turn your AI assistant into a Twitch streamer's best friend. This MCP server exposes the full Twitch Helix API as tools that Claude Code, Cursor, and other MCP-compatible assistants can use.
Features
- 110+ Twitch Tools - Full API coverage: chat, streams, moderation, polls, predictions, and more
- Real-time EventSub - Subscribe to live Twitch events via WebSocket
- Pydantic Validation - Type-safe requests with automatic validation
- Works with Any MCP Client - Claude Code, Cursor, or any MCP-compatible assistant
Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ AI Assistant │────▶│ twitch-mcp │────▶│ Twitch API │
│ (Claude Code) │ │ (MCP Server) │ │ (Helix) │
└─────────────────┘ └────────┬────────┘ └─────────────────┘
│
┌────────▼────────┐
│ twitch-sdk │
│ (Pydantic SDK) │
└─────────────────┘
Quick Start
1. Install
pip install twitch-mcp
2. Setup Credentials
Create ~/.twitch-secrets/.env:
mkdir -p ~/.twitch-secrets
cat > ~/.twitch-secrets/.env << 'EOF'
TWITCH_CLIENT_ID=your_client_id
TWITCH_CLIENT_SECRET=your_client_secret
TWITCH_ACCESS_TOKEN=your_access_token
TWITCH_REFRESH_TOKEN=your_refresh_token
EOF
Get credentials from:
- Client ID/Secret: Twitch Developer Console
- Access/Refresh Tokens: Use Twitch CLI or an OAuth app
3. Configure Claude Code
Add to ~/.claude/mcp.json:
{
"mcpServers": {
"twitch": {
"command": "twitch-mcp"
}
}
}
4. Restart Claude Code
Run /mcp to verify the twitch server is connected.
Usage Examples
Once configured, ask your AI assistant:
| Task | Example Prompt |
|---|---|
| Chat | "Send 'Hello everyone!' to my chat" |
| Moderation | "Ban user spammer123 for 1 hour" |
| Polls | "Create a poll: What game next? Options: Minecraft, Fortnite, Valorant" |
| Predictions | "Start a prediction: Will we beat the boss?" |
| Stream Info | "Update my stream title to 'Late Night Coding'" |
| Clips | "Create a clip of the last 30 seconds" |
| Raids | "Raid xQc's channel" |
| Shoutouts | "Give a shoutout to ninja" |
Available Tools
Chat (7 tools)
twitch_send_chat_message- Send a message to chattwitch_get_chatters- Get list of users in chattwitch_send_announcement- Send an announcementtwitch_send_shoutout- Shoutout another broadcastertwitch_get_chat_settings/twitch_update_chat_settingstwitch_get_user_emotes
Streams (3 tools)
twitch_get_streams- Get live streamstwitch_get_followed_streams- Get followed live streamstwitch_create_stream_marker- Create a stream marker
Channels (8 tools)
twitch_get_channel_info/twitch_modify_channel_infotwitch_get_channel_followerstwitch_get_vips/twitch_add_vip/twitch_remove_viptwitch_get_channel_editorstwitch_get_followed_channels
Moderation (18 tools)
twitch_ban_user/twitch_unban_usertwitch_warn_usertwitch_delete_chat_messagestwitch_get_moderators/twitch_add_moderator/twitch_remove_moderatortwitch_get_banned_userstwitch_get_blocked_terms/twitch_add_blocked_term/twitch_remove_blocked_termtwitch_get_shield_mode_status/twitch_update_shield_modetwitch_get_automod_settings/twitch_update_automod_settings- And more...
Polls & Predictions (6 tools)
twitch_create_poll/twitch_get_polls/twitch_end_polltwitch_create_prediction/twitch_get_predictions/twitch_end_prediction
Channel Points (6 tools)
twitch_get_custom_rewards/twitch_create_custom_rewardtwitch_update_custom_reward/twitch_delete_custom_rewardtwitch_get_custom_reward_redemption/twitch_update_redemption_status
Clips (2 tools)
twitch_create_clip- Create a cliptwitch_get_clips- Get clips
And 60+ More Tools
- Ads - Commercial breaks, ad scheduling
- Analytics - Extension and game analytics
- Bits - Leaderboard, cheermotes
- Charity - Campaign info, donations
- EventSub - Real-time subscriptions
- Games - Game info, top games
- Goals - Creator goals
- Guest Star - Session management
- Hype Train - Event info
- Raids - Start/cancel raids
- Schedule - Stream scheduling
- Search - Find channels and categories
- Subscriptions - Subscriber info
- Teams - Team info
- Users - User profiles, blocks
- Videos - VOD management
- Whispers - Direct messages
EventSub Listener
For real-time events, use the included EventSub listener:
eventsub-listen
This creates a WebSocket connection to Twitch and can forward events to your application.
Development
# Clone the repo
git clone https://github.com/ldraney/twitch-mcp
cd twitch-mcp
# Install dependencies
poetry install
# Run tests
poetry run pytest
# Run the server
poetry run twitch-mcp
Related Projects
- twitch-sdk - The underlying Twitch API SDK with Pydantic validation
- twitch-client - OAuth layer with automatic token refresh
License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twitch_mcp-0.2.0.tar.gz.
File metadata
- Download URL: twitch_mcp-0.2.0.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.1 CPython/3.12.3 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d26ae825e11fa7278db9d7c09ad2772999d2c53f6fbba586b0e9c37d77ecc2e2
|
|
| MD5 |
d7c0797bd729be8571d412cee04d44b4
|
|
| BLAKE2b-256 |
c08ce2015fcc6c4859041e4f2860cd6687237066d8172d70f7d011e0b70e65de
|
File details
Details for the file twitch_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: twitch_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 44.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.1 CPython/3.12.3 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24c6b13bb8ca4e56b210f5b42339dd02ea90945881a77d63902a0ad8b1872ed4
|
|
| MD5 |
bac3fb992b98cd00e0e6aee2be01bf8e
|
|
| BLAKE2b-256 |
d788f98270cf7b9959fa0b23720c47ab835413d11eec4e58ad38c40a79b6a61c
|