#!/usr/bin/env node /** * TwelveLabs MCP Server — Main Entry Point * * ─── What is an MCP server? ────────────────────────────────────────────────── * * MCP (Model Context Protocol) is a standard that lets an LLM call "tools" * that live in an external process. Instead of hardcoding API calls inside the * LLM host (like Claude.ai), MCP separates the tool implementations into a * standalone server process that Claude talks to over a simple protocol. * * The flow: * Claude (client) ──stdio──► TwelveLabs MCP Server (this file) ──HTTPS──► ElevenLabs API * * Claude sends a JSON message like: * { method: "tools/call", params: { name: "twelvelabs_get_agent", arguments: { agent_id: "..." } } } * * The MCP server receives it, calls ElevenLabs, and streams back: * { content: [{ type: "text", text: "Agent: Tonari-Tutor-v1.2 ..." }] } * * ─── Transport: stdio ──────────────────────────────────────────────────────── * * We use stdio transport — meaning Claude's host process (e.g. Claude Desktop) * spawns this Node.js process as a child and communicates via stdin/stdout. * That's why you'll see console.error() instead of console.log() for logging: * stdout is reserved for the MCP protocol messages; anything we log must go to * stderr to avoid corrupting the protocol stream. * * ─── Tool registration ─────────────────────────────────────────────────────── * * Each tool is defined in a separate file under src/tools/. We call * register*Tools(server) here to attach them all to the McpServer instance. * McpServer then handles the protocol machinery (list_tools, call_tool, etc.) * automatically — we never write raw protocol handlers. */ export {};