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CAClB,YAAa,oEACb,UAAW,CACP,cAAe,CACX,KAAM,SACN,YAAa,8EAIzB,yBAA4B,CACxB,YAAa,4DACb,UAAW,CACP,QAAS,CACL,KAAM,SACN,YAAa,+CAK7B,MAAO,CACH,oBAAuB,CACnB,YAAa,wEACb,YAAa,CACT,KAAM,SACN,WAAY,CACR,cAAe,CACX,KAAM,SACN,YAAa,iFAGrB,SAAU,CAAC,mBAGnB,kBAAqB,CACjB,YAAa,6DACb,YAAa,CACT,KAAM,SACN,WAAY,CACR,YAAa,CACT,KAAM,SACN,YAAa,mFAGrB,SAAU,CAAC,iBAGnB,sBAAyB,CACrB,YAAa,iDACb,YAAa,CACT,KAAM,SACN,WAAY,CACR,SAAU,CACN,KAAM,SACN,YAAa,0DAK7B,eAAkB,CACd,YAAa,uDACb,YAAa,CACT,KAAM,SACN,WAAY,CACR,MAAO,CACH,KAAM,SACN,YAAa,uFAGrB,SAAU,CAAC,WAGnB,sBAAyB,CACrB,YAAa,6CACb,YAAa,CACT,KAAM,SACN,WAAY,CACR,MAAO,CACH,KAAM,SACN,YAAa,8BAGrB,SAAU,CAAC,eAO/B,cAAc,GAEd,MAAM,EAAY,IAAI,qBACtB,QAAQ,sCACF,EAAO,QAAQ,GACrB,QAAQ,8BACZ,CACA,MAAO,GACH,SAAS,yBAA0B,GACnC,QAAQ,KAAK,EACjB,CACJ,CAEA,OAAO,OAAO,IACV,SAAS,0BAA2B,GACpC,QAAQ,KAAK,EAAE","file":"/npm/anime-js-mcp-server@1.0.0/build/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/anime-js-mcp-server@1.0.0/build/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#!/usr/bin/env node\n/**\n * Anime.js MCP Server\n *\n * A Model Context Protocol server for Anime.js animation library.\n * Provides AI assistants with access to Anime.js components, APIs, examples, and documentation.\n *\n * Usage:\n *   npx anime-js-mcp-server\n *   npx anime-js-mcp-server --github-api-key YOUR_TOKEN\n *   npx anime-js-mcp-server -g YOUR_TOKEN\n */\nimport { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { setupHandlers } from './handler.js';\nimport { axios } from './utils/axios.js';\nimport { logError, logInfo, logWarning } from './utils/logger.js';\n/**\n * Parse command line arguments\n */\nasync function parseArgs() {\n    const args = process.argv.slice(2);\n    // Help flag\n    if (args.includes('--help') || args.includes('-h')) {\n        console.log(`\r\nAnime.js MCP Server\r\n\r\nUsage:\r\n  npx anime-js-mcp-server [options]\r\n\r\nOptions:\r\n  --github-api-key, -g <token>    GitHub Personal Access Token for API access\r\n  --help, -h                      Show this help message\r\n  --version, -v                   Show version information\r\n\r\nExamples:\r\n  npx anime-js-mcp-server\r\n  npx anime-js-mcp-server --github-api-key ghp_your_token_here\r\n  npx anime-js-mcp-server -g ghp_your_token_here\r\n\r\nEnvironment Variables:\r\n  GITHUB_PERSONAL_ACCESS_TOKEN    Alternative way to provide GitHub token\r\n  LOG_LEVEL                       Log level (debug, info, warn, error) - default: info\r\n\r\nFor more information, visit: https://animejs.com\r\n`);\n        process.exit(0);\n    }\n    // Version flag\n    if (args.includes('--version') || args.includes('-v')) {\n        // Read version from package.json\n        try {\n            const fs = await import('fs');\n            const path = await import('path');\n            const { fileURLToPath } = await import('url');\n            const __filename = fileURLToPath(import.meta.url);\n            const __dirname = path.dirname(__filename);\n            const packagePath = path.join(__dirname, '..', 'package.json');\n            const packageContent = fs.readFileSync(packagePath, 'utf8');\n            const packageJson = JSON.parse(packageContent);\n            console.log(`anime-js-mcp-server v${packageJson.version}`);\n        }\n        catch (error) {\n            console.log('anime-js-mcp-server v1.0.0');\n        }\n        process.exit(0);\n    }\n    // GitHub API key\n    const githubApiKeyIndex = args.findIndex(arg => arg === '--github-api-key' || arg === '-g');\n    let githubApiKey = null;\n    if (githubApiKeyIndex !== -1 && args[githubApiKeyIndex + 1]) {\n        githubApiKey = args[githubApiKeyIndex + 1];\n    }\n    else if (process.env.GITHUB_PERSONAL_ACCESS_TOKEN) {\n        githubApiKey = process.env.GITHUB_PERSONAL_ACCESS_TOKEN;\n    }\n    return { githubApiKey };\n}\n/**\n * Main function to start the MCP server\n */\nasync function main() {\n    try {\n        logInfo('Starting Anime.js MCP Server...');\n        const { githubApiKey } = await parseArgs();\n        // Configure GitHub API key if provided\n        if (githubApiKey) {\n            axios.setGitHubApiKey(githubApiKey);\n            logInfo('GitHub API configured with token');\n        }\n        else {\n            logWarning('No GitHub API key provided. Rate limited to 60 requests/hour.');\n        }\n        // Initialize the MCP server with metadata and capabilities\n        // Following MCP SDK 1.16.0 best practices\n        const server = new Server({\n            name: \"anime-js-mcp-server\",\n            version: \"1.0.0\",\n        }, {\n            capabilities: {\n                resources: {\n                    \"get_anime_components\": {\n                        description: \"List of available Anime.js animation components and APIs\",\n                        uri: \"resource:get_anime_components\",\n                        contentType: \"text/plain\"\n                    }\n                },\n                prompts: {\n                    \"component_usage\": {\n                        description: \"Get usage examples for a specific Anime.js component or API\",\n                        arguments: {\n                            componentName: {\n                                type: \"string\",\n                                description: \"Name of the Anime.js component or API to get usage for\"\n                            }\n                        }\n                    },\n                    \"animation_tutorial\": {\n                        description: \"Get a step-by-step tutorial for creating animations with Anime.js\",\n                        arguments: {\n                            animationType: {\n                                type: \"string\",\n                                description: \"Type of animation (e.g., 'transform', 'timeline', 'stagger', 'morphing')\"\n                            }\n                        }\n                    },\n                    \"performance_optimization\": {\n                        description: \"Get performance optimization tips for Anime.js animations\",\n                        arguments: {\n                            useCase: {\n                                type: \"string\",\n                                description: \"Specific use case or performance concern\"\n                            }\n                        }\n                    }\n                },\n                tools: {\n                    \"get_anime_component\": {\n                        description: \"Get information and examples for a specific Anime.js component or API\",\n                        inputSchema: {\n                            type: \"object\",\n                            properties: {\n                                componentName: {\n                                    type: \"string\",\n                                    description: \"Name of the Anime.js component or API (e.g., 'anime', 'timeline', 'stagger')\"\n                                }\n                            },\n                            required: [\"componentName\"]\n                        }\n                    },\n                    \"get_anime_example\": {\n                        description: \"Get example code for a specific Anime.js animation pattern\",\n                        inputSchema: {\n                            type: \"object\",\n                            properties: {\n                                exampleType: {\n                                    type: \"string\",\n                                    description: \"Type of example (e.g., 'basic-transform', 'timeline-sequence', 'stagger-grid')\"\n                                }\n                            },\n                            required: [\"exampleType\"]\n                        }\n                    },\n                    \"list_anime_components\": {\n                        description: \"Get all available Anime.js components and APIs\",\n                        inputSchema: {\n                            type: \"object\",\n                            properties: {\n                                category: {\n                                    type: \"string\",\n                                    description: \"Filter by category (core, timeline, utilities, svg)\"\n                                }\n                            }\n                        }\n                    },\n                    \"get_anime_docs\": {\n                        description: \"Get documentation for Anime.js features and concepts\",\n                        inputSchema: {\n                            type: \"object\",\n                            properties: {\n                                topic: {\n                                    type: \"string\",\n                                    description: \"Documentation topic (e.g., 'getting-started', 'animation-controls', 'performance')\"\n                                }\n                            },\n                            required: [\"topic\"]\n                        }\n                    },\n                    \"search_anime_examples\": {\n                        description: \"Search Anime.js examples and code snippets\",\n                        inputSchema: {\n                            type: \"object\",\n                            properties: {\n                                query: {\n                                    type: \"string\",\n                                    description: \"Search query for examples\"\n                                }\n                            },\n                            required: [\"query\"]\n                        }\n                    }\n                }\n            }\n        });\n        // Set up request handlers and register components (tools, resources, etc.)\n        setupHandlers(server);\n        // Start server using stdio transport\n        const transport = new StdioServerTransport();\n        logInfo('Transport initialized: stdio');\n        await server.connect(transport);\n        logInfo('Server started successfully');\n    }\n    catch (error) {\n        logError('Failed to start server', error);\n        process.exit(1);\n    }\n}\n// Start the server\nmain().catch((error) => {\n    logError('Unhandled startup error', error);\n    process.exit(1);\n});\n"]}