UNPKG

anilist-mcp

Version:

AniList MCP server for accessing AniList API data

21 lines (20 loc) 755 B
import { ANILIST_TOKEN_HEADER } from "./constants.js"; export function requireAuth(anilistToken) { if (!anilistToken || anilistToken.trim().length === 0) { return { isAuthorized: false, errorResponse: { content: [ { type: "text", text: `Error: This operation requires authentication. For Streamable HTTP transport mode, please provide an AniList API token via header '${ANILIST_TOKEN_HEADER}'. For STDIO transport mode, set the ANILIST_TOKEN environment variable before starting the server.`, }, ], isError: true, }, }; } return { isAuthorized: true }; }