Skip to content

Latest commit

 

History

History
142 lines (100 loc) · 2.82 KB

File metadata and controls

142 lines (100 loc) · 2.82 KB

Quick Testing Guide

All commands to set up and test the MCP server.


Setup

cd /path/to/mcp
npm install
npm run build

1. Unit Tests (no API key)

npm test

Runs Jest: listTools, delete_transcript validation, createMcpServer.


2. Local HTTP Server

npm run start:http

Server at http://localhost:8080. API key comes from client headers. Keep running.


3. Connect Clients (HTTP)

Get API key from youtubetranscript.dev/dashboard/account.

Hosted MCP (no local server): https://mcp.youtubetranscript.dev

Claude Code:

claude mcp add --transport http ytscribe https://mcp.youtubetranscript.dev --header "x-api-token: YOUR_API_KEY"

Cursor.cursor/mcp.json:

{
  "mcpServers": {
    "ytscribe": {
      "url": "https://mcp.youtubetranscript.dev",
      "headers": { "x-api-token": "YOUR_API_KEY" }
    }
  }
}

Antigravity: URL https://mcp.youtubetranscript.dev, header x-api-token: YOUR_API_KEY

Local server: If running npm run start:http, use http://localhost:8080 instead.


4. E2E Tests (needs API key)

# Set API key first
export YTSM_API_KEY=your_key   # bash/mac
$env:YTSM_API_KEY="your_key"   # PowerShell

# Test all tools (transcribe, list, get, etc.)
npm run test:all

# Verify flows (account details, ASR, get_job)
npm run verify

# Integration test (listTools + list_transcripts + transcribe)
npm run test:integration

5. Docker

Build stdio image:

docker build -t youtube-transcript-mcp:latest .

Run stdio (for subprocess clients):

docker run -it --rm -e YTSM_API_KEY=your_key youtube-transcript-mcp:latest

Build HTTP image:

docker build -f Dockerfile.cloudrun -t youtube-transcript-mcp:http .

Run HTTP (for Cursor/Claude etc.):

docker run -p 8080:8080 youtube-transcript-mcp:http

Then connect clients to http://localhost:8080 with x-api-token header. (Or use hosted: https://mcp.youtubetranscript.dev — no Docker needed.)

Docker Compose (stdio):

YTSM_API_KEY=your_key docker compose run --rm mcp

Test Docker image:

YTSM_API_KEY=your_key npm run test:docker

6. Lint & Typecheck

npm run lint
npm run typecheck

Quick Reference

Command What it does
npm test Unit tests
npm run start:http Start HTTP server (localhost:8080)
npm run test:all E2E all tools (needs YTSM_API_KEY)
npm run verify E2E flow verification (needs YTSM_API_KEY)
npm run test:integration Integration test (needs YTSM_API_KEY)
npm run test:docker Test Docker stdio image (needs YTSM_API_KEY)

Tools: get_stats, transcribe_v2, list_transcripts, get_transcript, delete_transcript