Skip to main content

MCP server exposing Twitch SDK as tools for AI assistants

Project description

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twitch_mcp-0.2.0.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twitch_mcp-0.2.0-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

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

Hashes for twitch_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d26ae825e11fa7278db9d7c09ad2772999d2c53f6fbba586b0e9c37d77ecc2e2
MD5 d7c0797bd729be8571d412cee04d44b4
BLAKE2b-256 c08ce2015fcc6c4859041e4f2860cd6687237066d8172d70f7d011e0b70e65de

See more details on using hashes here.

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

Hashes for twitch_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24c6b13bb8ca4e56b210f5b42339dd02ea90945881a77d63902a0ad8b1872ed4
MD5 bac3fb992b98cd00e0e6aee2be01bf8e
BLAKE2b-256 d788f98270cf7b9959fa0b23720c47ab835413d11eec4e58ad38c40a79b6a61c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page