Skip to main content
Glama

Twitch MCP Server

by mtane0412
stream.ts1.4 kB
import { ApiClient } from '@twurple/api'; import { getUserByName, formatResponse } from '../../utils/twitch.js'; export async function handleGetStreamInfo(apiClient: ApiClient, args: { channelName: string }) { const user = await getUserByName(apiClient, args.channelName); const stream = await apiClient.streams.getStreamByUserId(user.id); if (!stream) { return formatResponse({ status: 'offline', message: `${user.displayName} is currently offline`, lastOnline: null }); } return formatResponse({ status: 'online', title: stream.title, game: stream.gameName, viewers: stream.viewers, startedAt: stream.startDate, language: stream.language, thumbnailUrl: stream.thumbnailUrl, tags: stream.tags, }); } export async function handleGetStreams( apiClient: ApiClient, args: { game?: string; language?: string; limit?: number } ) { const streams = await apiClient.streams.getStreams({ game: args.game, language: args.language, limit: args.limit, }); return formatResponse( streams.data.map(stream => ({ userId: stream.userId, userName: stream.userName, title: stream.title, game: stream.gameName, viewers: stream.viewers, startedAt: stream.startDate, language: stream.language, thumbnailUrl: stream.thumbnailUrl, tags: stream.tags, })) ); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mtane0412/twitch-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server