twitch-mcp-server
v1.1.3
Published
Twitch MCP Server - AI integration for Twitch chat
Maintainers
Readme
Twitch MCP Server
AI-powered tools for Twitch streamers. This package provides an easy way to connect AI assistants like Claude, Qwen Code, or LM Studio to your Twitch chat.
🚀 Quick Start
npx twitch-mcp-server --channel your_channel --auth oauth:your_token --client-id your_client_id --broadcaster-id your_broadcaster_idThat's it! No need to install Java, Maven, or clone repositories.
📋 Prerequisites
- Node.js 14 or later (comes with npx)
- Java 11 or later
⚙️ Configuration
Command Line Options
npx twitch-mcp-server \
--channel your_twitch_username \
--auth oauth:your_twitch_oauth_token \
--client-id your_twitch_client_id \
--broadcaster-id your_twitch_broadcaster_id \
[--show-connection-message] \
[--jar-path /path/to/custom/jar]Environment Variables
You can also configure using environment variables:
export TWITCH_CHANNEL=your_twitch_username
export TWITCH_AUTH=oauth:your_twitch_oauth_token
export TWITCH_CLIENT_ID=your_twitch_client_id
export TWITCH_BROADCASTER_ID=your_twitch_broadcaster_id
export TWITCH_SHOW_CONNECTION_MESSAGE=true
npx twitch-mcp-serverOptional JSON Config File
You can store settings in a JSON file and point to it via --config (or let the tool discover it at a standard path):
{
"channel": "your_twitch_username",
"auth": "oauth:your_twitch_oauth_token",
"clientId": "your_twitch_client_id",
"broadcasterId": "your_twitch_broadcaster_id",
"showConnectionMessage": true
}Default locations searched automatically when --config is not provided:
- Windows:
%APPDATA%/twitch-mcp/config.json - macOS:
~/Library/Application Support/twitch-mcp/config.json - Linux:
~/.config/twitch-mcp/config.json
Run with an explicit config file:
npx twitch-mcp-server --config ./twitch-mcp.config.jsonGetting Your Twitch Credentials
- Channel Name: Your Twitch username (e.g.,
ninja) - OAuth Token: Get from https://twitchtokengenerator.com/
- Click "Generate Token"
- Select required scopes:
chat:read- Read chat messageschat:edit- Send chat messageschannel:moderate- Timeout/ban userschannel:manage:broadcast- Change title/categoryclips:edit- Create clipschannel:manage:polls- Create pollschannel:manage:predictions- Create predictions
- Copy the "Access Token" (includes
oauth:prefix)
- Client ID: Also from twitchtokengenerator.com
- Broadcaster ID: Get from https://www.streamweasels.com/tools/convert-twitch-username-to-user-id/
🤖 Connect with AI Tools
Once running, connect with your preferred AI tool:
For Qwen Code (Recommended)
- Open Qwen Code settings
- Add this MCP configuration:
{ "mcpServers": { "twitch-mcp": { "command": "npx", "args": [ "twitch-mcp-server", "--config", "C:/Users/<you>/AppData/Roaming/twitch-mcp/config.json" ] } } }
For LM Studio
- Open LM Studio
- Go to Settings → Developer → MCP Settings
- Add this configuration:
{ "mcpServers": { "twitch-mcp": { "command": "npx", "args": [ "twitch-mcp-server", "--config", "/home/<you>/.config/twitch-mcp/config.json" ] } } }
🛠️ Features
- Chat Interaction: Send and read Twitch chat messages
- Moderation: Timeout/ban users based on chat behavior
- Stream Management: Update title, category, create clips
- Interactive Tools: Create polls and predictions
- Chat Analysis: Analyze recent chat activity and topics
📖 Usage Examples
Once connected to an AI tool, you can ask:
- "Send a message to my Twitch chat saying 'Hello viewers!'"
- "What are people talking about in my chat?"
- "Create a poll asking viewers what game to play next"
- "Timeout the user who's being toxic"
- "Update my stream title to 'Epic Gaming Session!'"
- "Create a clip of that awesome moment"
🐛 Troubleshooting
Common Issues
"Java not found" error:
- The tool will attempt to download Java automatically
- If that fails, manually install Java 11+ from https://adoptium.net/
"Connection refused" or "Authentication failed":
- Double-check your Twitch credentials
- Ensure your OAuth token has all required scopes
- Verify your broadcaster ID matches your channel
AI assistant can't see Twitch tools:
- Make sure the server is running
- Check that all 4 configuration values are correct
- Try restarting your AI application
📄 License
This project is open source and available under the MIT License.
🙏 Acknowledgments
Based on TomCools' Twitch MCP Server, expanded with additional Twitch integration features.
