Skip to main content
Glama

Twitch MCP Server

by mtane0412
twitch.ts889 B
import { ApiClient } from '@twurple/api'; import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js'; export async function getUserByName(apiClient: ApiClient, channelName: string) { const user = await apiClient.users.getUserByName(channelName); if (!user) { throw new McpError(ErrorCode.InvalidParams, `Channel "${channelName}" not found`); } return user; } export function formatResponse(data: any) { return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; } export function handleApiError(error: unknown): never { if (error instanceof McpError) { throw error; } console.error('[Twitch API Error]', error); const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred'; throw new McpError(ErrorCode.InternalError, `Twitch API error: ${errorMessage}`); }

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