@jine9323/server-twelvelabs-video
v1.0.1
Published
MCP server that connects to TwelveLabs video indexing and search APIs.
Readme
TwelveLabs Video MCP Server
An example MCP server that integrates with TwelveLabs to provide:
- create_index: Create a new video index
- upload_videos: Upload (YouTube) videos to the specified index
- search_videos: Perform text-based searches across an index
- generate_text: Generate text (transcript/summary) from a selected video
Features
- Uses @modelcontextprotocol/sdk to implement MCP
- Four MCP tools:
create_index,upload_videos,search_videos,generate_text - Connects to TwelveLabs via their REST API. (Mock endpoints in this example)
- Communicates over
stdiotransport by default, but can be adapted to SSE or other transport
Getting Started
Prerequisites
- Node.js >= 16
- A valid TwelveLabs API key
- Docker (optional, for containerized deployment)
Installation
npm install
Set up environment
Export the environment variable TWELVELABS_API_KEY:
bash
Copy
Edit
export TWELVELABS_API_KEY="YOUR_TWELVELABS_API_KEY"
Running
bash
Copy
Edit
npm run build
npm start
This will start the MCP server listening on stdio. You can connect from an MCP client (e.g. Claude Desktop, or custom client).
Docker Build & Run
bash
Copy
Edit
docker build -t mcp/twelvelabs-video .
docker run -it --rm -e TWELVELABS_API_KEY=YOUR_KEY_HERE mcp/twelvelabs-video
Using in Claude Desktop
Update claude_desktop_config.json:
json
Copy
Edit
{
"mcpServers": {
"twelvelabs-video": {
"command": "npx",
"args": [
"-y",
"@mcp/server-twelvelabs-video"
],
"env": {
"TWELVELABS_API_KEY": "YOUR_KEY_HERE"
}
}
}
}
Restart Claude Desktop. You should see the four tools in the "Tools" panel:
create_index
upload_videos
search_videos
generate_text
Use them in conversation or let Claude automatically call them when needed.
Notes
The calls in index.ts are examples; adapt them to the real TwelveLabs endpoints.
For advanced usage (batch indexing, different languages, callbacks), see TwelveLabs Docs.
This server structure can be easily extended to add prompts, resources, or user authentication.
markdown
Copy
Edit
---
위 예시 코드를 참고하여 실제 TwelveLabs API에 맞춰 엔드포인트나 JSON 스키마를 수정하면 됩니다. (유효한 API Key, 응답 포맷 등)
- **index.ts**에는 MCP Server의 핵심 로직이 들어있습니다.
- **Dockerfile**로 컨테이너 빌드를 할 수 있고,
- **package.json**, **tsconfig.json**은 TypeScript 프로젝트 설정과 의존성 관리를 위한 파일입니다.
- **README.md**에는 사용법과 설정 방법을 정리해두었습니다.
이것으로, MCP Server를 작성하여 TwelveLabs 영상 인덱싱/검색 기능을 노출하는 간단한 예시를 마칩니다. 필요한 부분(실제 요청/응답 형식 등)은 TwelveLabs 공식 문서를 참고해 맞춰주세요.