twitch-chat-mcp
Twitch-Claude MCP Server: A Message Control Protocol server that bridges Claude AI with Twitch chat. Enables AI to observe, analyze, and interact with Twitch streams in real-time. Configurable observation duration with smart channel detection and summarization capabilities.
GitHubスター
0
ユーザー評価
未評価
フォーク
0
イシュー
0
閲覧数
0
お気に入り
0
Twitch Chat MCP Server
A Message Control Protocol (MCP) server that connects Claude desktop with Twitch chat, allowing Claude to read and interact with Twitch chat.
Features
- Connect with Claude desktop via HTTP API
- Authenticate with Twitch API (browser-based OAuth flow)
- Observe Twitch chat in specified channels
- Send messages to Twitch chat
- Parse user queries to determine relevant Twitch channels
- Provide summaries of chat activity
Project Structure
docs/- Documentationarchitecture.md- System architecturedecisions.md- Decision logchallenges.md- Implementation challenges
src/- Source codemcp/- MCP server componentstwitch/- Twitch integration componentsclaude/- Claude integration componentstools/- Tool definitions for Claude
tests/- Test suiteconfig/- Configuration filespublic/- Web UI for authenticationllm/- LLM-related filesseed_prompt.md- Original development prompt
Setup
Create a Twitch application in the Twitch Developer Console
- Set the OAuth Redirect URL to
http://localhost:3000/auth/twitch/callback - Note your Client ID
- Set the OAuth Redirect URL to
Install dependencies:
npm installCopy the example environment file and fill in your Twitch app details:
cp .env.example .envThen edit
.envwith at least your Twitch Client ID:TWITCH_CLIENT_ID=your_client_id_from_twitch_dev_consoleBuild the project:
npm run buildStart the server:
npm startOpen your browser and go to
http://localhost:3000Click "Login with Twitch" to authenticate the application
Authentication
The application supports two ways to authenticate with Twitch:
1. Browser-based OAuth Flow (Recommended)
- Start the server
- Visit
http://localhost:3000in your browser - Click "Login with Twitch"
- Follow the Twitch authentication process
- After successful authentication, the token will be stored in the session
2. Manual Token Configuration
If you prefer to set up manually:
- Get an OAuth token from Twitch Token Generator
- Make sure to request
chat:readandchat:writescopes
- Make sure to request
- Add the token to your
.envfile:TWITCH_OAUTH_TOKEN=oauth:your_token_here TWITCH_USERNAME=your_bot_username
Development
Run in development mode with automatic reloading:
npm run dev
Run linting:
npm run lint
Run tests:
npm test
API Endpoints
Authentication
GET /auth/twitch/login # Redirects to Twitch for authorization
GET /auth/twitch/status # Returns current authentication status
GET /auth/twitch/logout # Logs out and clears the session
Tool Definitions
GET /tools/definitions
Returns the available tools and their parameter definitions.
Tool Execution
POST /tools/execute
Execute a tool with the specified parameters.
Example:
{
"name": "observe_twitch_chat",
"parameters": {
"channel": "xqc",
"duration": 60000
}
}
Claude Integration
To use this server with Claude, configure Claude to use the following tool definition:
{
"tools": [
{
"name": "observe_twitch_chat",
"description": "Observe Twitch chat in a specific channel for a configurable duration",
"input_schema": {
"type": "object",
"properties": {
"channel": {
"type": "string",
"description": "The Twitch channel to observe (without the # prefix)"
},
"duration": {
"type": "integer",
"description": "Duration to observe in milliseconds (default: 60000 = 1 minute)"
}
},
"required": ["channel"]
}
},
{
"name": "send_twitch_message",
"description": "Send a message to a Twitch channel",
"input_schema": {
"type": "object",
"properties": {
"channel": {
"type": "string",
"description": "The Twitch channel to send a message to (without the # prefix)"
},
"message": {
"type": "string",
"description": "The message to send to the channel"
}
},
"required": ["channel", "message"]
}
}
]
}
License
MIT