npm package: @striderlabs/mcp-twitch
Description: MCP server for Twitch — let AI agents search streams, manage channels, moderate chat, and interact with the Twitch platform
Author: Strider Labs
Latest version: 0.1.0

# @striderlabs/mcp-twitch

[![npm](https://img.shields.io/npm/v/@striderlabs/mcp-twitch)](https://www.npmjs.com/package/@striderlabs/mcp-twitch)
[![MCP](https://img.shields.io/badge/MCP-compatible-blueviolet)](https://modelcontextprotocol.io)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

**Twitch streaming platform connector for personal AI agents.** Search streams, manage channels, moderate chat, create clips, browse VODs, manage predictions, and more — all via the [Model Context Protocol](https://modelcontextprotocol.io).

## Features

- **Search** — streams, channels, games/categories, clips
- **Channel info** — details, schedule, followers
- **Live streams** — get followed live streams, top streams by category
- **Moderation** — ban, timeout, unban users; delete chat messages; list banned users
- **Clips** — create clips from live streams, browse clips by channel or game
- **VODs** — browse past broadcasts, highlights, and uploads
- **Subscriptions** — list subscribers, check subscription status
- **Predictions** — create, view, resolve, lock, or cancel channel predictions
- **Channel Points** — list custom rewards and redemptions

## Installation

```bash
npm install -g @striderlabs/mcp-twitch
```

Or use directly with `npx`:

```bash
npx @striderlabs/mcp-twitch
```

## MCP Client Configuration

### Claude Desktop

Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "twitch": {
      "command": "npx",
      "args": ["-y", "@striderlabs/mcp-twitch"]
    }
  }
}
```

### Generic MCP client

```json
{
  "mcpServers": {
    "twitch": {
      "command": "striderlabs-mcp-twitch"
    }
  }
}
```

## Setup: Twitch API Credentials

You need a **Client ID** and **OAuth access token** from Twitch.

### 1. Create a Twitch app

1. Go to [dev.twitch.tv/console](https://dev.twitch.tv/console)
2. Click **Register Your Application**
3. Set OAuth Redirect URL to `http://localhost`
4. Copy your **Client ID**

### 2. Generate an access token

Use the [Twitch Token Generator](https://twitchtokengenerator.com) or the [Twitch CLI](https://dev.twitch.tv/docs/cli) to generate a user access token with the scopes you need.

**Recommended scopes:**

| Scope | Required for |
|-------|-------------|
| `user:read:follows` | `twitch_get_followed_channels`, `twitch_get_followed_streams` |
| `moderator:manage:banned_users` | `twitch_ban_user`, `twitch_timeout_user`, `twitch_unban_user` |
| `moderator:manage:chat_messages` | `twitch_delete_chat_message` |
| `moderator:read:banned_users` | `twitch_get_banned_users` |
| `channel:read:subscriptions` | `twitch_get_subscriptions`, `twitch_check_subscription` |
| `channel:read:predictions` | `twitch_get_predictions` |
| `channel:manage:predictions` | `twitch_create_prediction`, `twitch_end_prediction` |
| `channel:read:redemptions` | `twitch_get_channel_rewards`, `twitch_get_reward_redemptions` |
| `channel:manage:broadcast` | `twitch_create_clip` |

### 3. Configure the connector

Once the MCP server is running, use the `twitch_configure` tool:

```
twitch_configure(
  client_id: "your_client_id",
  access_token: "your_access_token",
  user_id: "your_numeric_user_id",        // optional but recommended
  broadcaster_login: "your_twitch_login"  // optional
)
```

Credentials are stored at `~/.strider/twitch/config.json`.

To find your numeric user ID, use `twitch_get_user(login: "your_login")` after configuring.

## Available Tools

| Tool | Description |
|------|-------------|
| `twitch_configure` | Save API credentials |
| `twitch_get_config` | View current config (token masked) |
| `twitch_get_user` | Get user info by login or ID |
| `twitch_search_channels` | Search channels by name |
| `twitch_search_categories` | Search game/category names |
| `twitch_get_streams` | Get live streams (filter by channel, game, language) |
| `twitch_get_followed_streams` | Get live streams from followed channels |
| `twitch_get_channel` | Get channel details (title, category, language) |
| `twitch_get_channel_schedule` | Get upcoming stream schedule |
| `twitch_get_followed_channels` | List followed channels |
| `twitch_follow_channel` | Follow a channel *(API removed by Twitch)* |
| `twitch_unfollow_channel` | Unfollow a channel *(API removed by Twitch)* |
| `twitch_get_top_categories` | Top games/categories by viewer count |
| `twitch_get_category` | Get category by ID or name |
| `twitch_get_clips` | Browse clips by channel, game, or ID |
| `twitch_create_clip` | Create a clip from a live stream |
| `twitch_get_videos` | Browse VODs (archives, highlights, uploads) |
| `twitch_ban_user` | Permanently ban a user |
| `twitch_timeout_user` | Timeout a user for N seconds |
| `twitch_unban_user` | Remove a ban or timeout |
| `twitch_delete_chat_message` | Delete a chat message |
| `twitch_get_banned_users` | List banned/timed-out users |
| `twitch_get_subscriptions` | List channel subscribers |
| `twitch_check_subscription` | Check if a user is subscribed |
| `twitch_get_predictions` | List channel predictions |
| `twitch_create_prediction` | Create a new prediction |
| `twitch_end_prediction` | Resolve, lock, or cancel a prediction |
| `twitch_get_channel_rewards` | List custom channel point rewards |
| `twitch_get_reward_redemptions` | List redemptions for a reward |

## Usage Examples

**Find live streams for a game:**
```
twitch_search_categories(query: "Minecraft")
twitch_get_streams(game_id: "27471", first: 10)
```

**Check what followed channels are live:**
```
twitch_get_followed_streams(first: 20)
```

**Create a clip from a live stream:**
```
twitch_create_clip(broadcaster_id: "12345678")
```

**Run a channel prediction:**
```
twitch_create_prediction(
  broadcaster_id: "12345678",
  title: "Will I win this match?",
  outcomes: ["Yes", "No"],
  prediction_window: 120
)
```

**Moderate a chat:**
```
twitch_timeout_user(broadcaster_id: "12345678", user_id: "99887766", duration: 600, reason: "Spam")
twitch_ban_user(broadcaster_id: "12345678", user_id: "99887766", reason: "Repeated violations")
```

## Configuration

Credentials are stored at `~/.strider/twitch/config.json`:

```json
{
  "client_id": "your_client_id",
  "access_token": "your_access_token",
  "user_id": "123456789",
  "broadcaster_login": "your_login"
}
```

## Known Limitations

- **Follow/Unfollow**: Twitch removed these endpoints from the Helix API in August 2023. The tools exist but return an informative error.
- **Chat reading**: Real-time chat requires WebSocket (IRC/EventSub), not supported in this REST-based connector.
- **Token refresh**: Access tokens expire. You'll need to re-run `twitch_configure` with a fresh token when they do.

## Development

```bash
git clone https://github.com/striderlabs/mcp-twitch
cd mcp-twitch
npm install
npm run build
node dist/index.js
```

## License

MIT — Strider Labs