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.
Metadata
Release files for twitch-mcp 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| twitch_mcp-0.2.0.tar.gz | 29.2 kB | Without provenance | Details for twitch_mcp-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| twitch_mcp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for twitch_mcp-0.2.0-py3-none-any.whl |
Total release size: 73.5 kB
Release files / twitch_mcp-0.2.0.tar.gz
| Download URL | twitch_mcp-0.2.0.tar.gz |
|---|---|
| Size | 29.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d26ae825e11fa7278db9d7c09ad2772999d2c53f6fbba586b0e9c37d77ecc2e2
|
|
BLAKE2b-256 checksum How to use checksums |
c08ce2015fcc6c4859041e4f2860cd6687237066d8172d70f7d011e0b70e65de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.1 CPython/3.12.3 Linux/5.15.167.4-microsoft-standard-WSL2
|
Release files / twitch_mcp-0.2.0-py3-none-any.whl
| Download URL | twitch_mcp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 44.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24c6b13bb8ca4e56b210f5b42339dd02ea90945881a77d63902a0ad8b1872ed4
|
|
BLAKE2b-256 checksum How to use checksums |
d788f98270cf7b9959fa0b23720c47ab835413d11eec4e58ad38c40a79b6a61c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.1 CPython/3.12.3 Linux/5.15.167.4-microsoft-standard-WSL2
|
Security for twitch-mcp 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.