Skip to main content
Glama

Twitch MCP Server

by mtane0412
video.ts1.37 kB
import { ApiClient } from '@twurple/api'; import { getUserByName, formatResponse } from '../../utils/twitch.js'; import { GraphQLService } from '../../services/gql.js'; export async function handleGetVideos( apiClient: ApiClient, args: { channelName: string; limit?: number } ) { const user = await getUserByName(apiClient, args.channelName); const videos = await apiClient.videos.getVideosByUser(user.id, { limit: args.limit }); return formatResponse({ total: videos.data.length, videos: videos.data.map(video => ({ id: video.id, title: video.title, description: video.description, url: video.url, thumbnailUrl: video.thumbnailUrl, viewCount: video.views, creationDate: video.creationDate, duration: video.duration, language: video.language, type: video.type, publishDate: video.publishDate, mutedSegments: video.mutedSegmentData, })), }); } export async function handleGetVideoComments( gqlService: GraphQLService, args: { videoId: string; limit?: number; cursor?: string } ) { const { comments, nextCursor } = await gqlService.getVideoComments( args.videoId, args.limit, args.cursor ); return formatResponse({ total: comments.length, comments, pagination: { hasNextPage: !!nextCursor, nextCursor: nextCursor } }); }

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