Skip to main content

twitch-mcp

PyPI Python License: MIT

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:

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 chat
  • twitch_get_chatters - Get list of users in chat
  • twitch_send_announcement - Send an announcement
  • twitch_send_shoutout - Shoutout another broadcaster
  • twitch_get_chat_settings / twitch_update_chat_settings
  • twitch_get_user_emotes

Streams (3 tools)

  • twitch_get_streams - Get live streams
  • twitch_get_followed_streams - Get followed live streams
  • twitch_create_stream_marker - Create a stream marker

Channels (8 tools)

  • twitch_get_channel_info / twitch_modify_channel_info
  • twitch_get_channel_followers
  • twitch_get_vips / twitch_add_vip / twitch_remove_vip
  • twitch_get_channel_editors
  • twitch_get_followed_channels

Moderation (18 tools)

  • twitch_ban_user / twitch_unban_user
  • twitch_warn_user
  • twitch_delete_chat_messages
  • twitch_get_moderators / twitch_add_moderator / twitch_remove_moderator
  • twitch_get_banned_users
  • twitch_get_blocked_terms / twitch_add_blocked_term / twitch_remove_blocked_term
  • twitch_get_shield_mode_status / twitch_update_shield_mode
  • twitch_get_automod_settings / twitch_update_automod_settings
  • And more...

Polls & Predictions (6 tools)

  • twitch_create_poll / twitch_get_polls / twitch_end_poll
  • twitch_create_prediction / twitch_get_predictions / twitch_end_prediction

Channel Points (6 tools)

  • twitch_get_custom_rewards / twitch_create_custom_reward
  • twitch_update_custom_reward / twitch_delete_custom_reward
  • twitch_get_custom_reward_redemption / twitch_update_redemption_status

Clips (2 tools)

  • twitch_create_clip - Create a clip
  • twitch_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
  • 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)

Source distribution for twitch-mcp 0.2.0
File Size Uploaded
twitch_mcp-0.2.0.tar.gz 29.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for twitch-mcp 0.2.0
File Interpreter ABI Platform
twitch_mcp-0.2.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page