# YTPipe Setup Instructions
## π Quick Setup (5 Minutes)
### 1. Add to Claude Code MCP Settings
**Option A: Automatic** (Recommended)
```bash
# Merge configuration into Claude Code settings
python3 << 'PYEOF'
import json
from pathlib import Path
# Read ytpipe config
with open('mcp_config.json') as f:
ytpipe_config = json.load(f)
# Read existing Claude Code settings
settings_path = Path.home() / '.claude' / 'mcp_settings.json'
if settings_path.exists():
with open(settings_path) as f:
settings = json.load(f)
else:
settings = {"mcpServers": {}}
# Merge ytpipe configuration
settings['mcpServers'].update(ytpipe_config['mcpServers'])
# Save updated settings
with open(settings_path, 'w') as f:
json.dump(settings, f, indent=2)
print(f"β
Added ytpipe to {settings_path}")
print(f"π§ Total MCP servers: {len(settings['mcpServers'])}")
PYEOF
```
**Option B: Manual**
Add this to `~/.claude/mcp_settings.json`:
```json
{
"mcpServers": {
"ytpipe": {
"command": "python3",
"args": ["-m", "ytpipe.mcp.server"],
"cwd": "/Users/lech/PROJECTS_all/PROJECT_ytpipe"
}
}
}
```
### 2. Restart Claude Code
```bash
# Restart Claude Code to load new MCP server
# MCP servers are loaded on startup
```
### 3. Test It Works
In Claude Code, try:
```
User: "Show me the ytpipe tools"
Claude: *lists all 12 ytpipe tools*
User: "Process this YouTube video: https://youtube.com/watch?v=dQw4w9WgXcQ"
Claude: *calls ytpipe_process_video*
Claude: "β
Video processed! Generated 1 chunk with embeddings..."
```
---
## π― Available Commands
### From Claude Code (Natural Language)
**Process Video**:
```
"Process this YouTube video: [URL]"
"Download and analyze this video: [URL]"
```
**Search Content**:
```
"Search the video dQw4w9WgXcQ for mentions of 'love'"
"Find all chunks about 'music' in video [ID]"
```
**Get Insights**:
```
"Optimize SEO for video [ID]"
"Show me the topic timeline for video [ID]"
"Give me a quality report for video [ID]"
```
**Semantic Search**:
```
"Find chunks similar to chunk 0 in video [ID]"
"What's most similar to this chunk: [chunk_id]"
```
---
## π οΈ Direct Tool Calls (Advanced)
If you want to call tools directly:
```python
# From Python
from ytpipe.mcp.server import ytpipe_process_video
result = await ytpipe_process_video(
url="https://youtube.com/watch?v=VIDEO_ID"
)
```
```bash
# From MCP Protocol
echo '{
"method": "tools/call",
"params": {
"name": "ytpipe_process_video",
"arguments": {
"url": "https://youtube.com/watch?v=VIDEO_ID"
}
}
}' | python -m ytpipe.mcp.server
```
---
## π Tool Reference
### Pipeline Tools (Full Control)
| Tool | Description | Use When |
|------|-------------|----------|
| `ytpipe_process_video` | Full 8-phase pipeline | Processing new video |
| `ytpipe_download` | Download only | Just need audio |
| `ytpipe_transcribe` | Transcribe audio file | Have audio already |
| `ytpipe_embed` | Generate embedding | Custom embedding needs |
### Query Tools (Content Access)
| Tool | Description | Use When |
|------|-------------|----------|
| `ytpipe_search` | Full-text search | Finding keywords |
| `ytpipe_find_similar` | Vector similarity | Finding related content |
| `ytpipe_get_chunk` | Get specific chunk | Need exact chunk |
| `ytpipe_get_metadata` | Get video info | Need metadata only |
### Analytics Tools (Intelligence)
| Tool | Description | Use When |
|------|-------------|----------|
| `ytpipe_seo_optimize` | SEO recommendations | Optimizing titles/tags |
| `ytpipe_quality_report` | Quality analysis | Assessing content |
| `ytpipe_topic_timeline` | Topic evolution | Understanding flow |
| `ytpipe_benchmark` | Performance metrics | Comparing videos |
---
## π§ Troubleshooting
### MCP Server Won't Start
```bash
# Check Python path
which python3
# Test imports
python3 -c "from ytpipe.mcp.server import mcp; print('β
OK')"
# Check for errors
python3 -m ytpipe.mcp.server 2>&1 | head -20
```
### Tools Not Showing in Claude Code
1. Check `~/.claude/mcp_settings.json` has ytpipe entry
2. Restart Claude Code completely
3. Check logs: `~/.claude/logs/`
### Processing Fails
```bash
# Check dependencies
cd PROJECT_ytpipe
source venv/bin/activate
pip list | grep -E "yt-dlp|whisper|sentence|faiss"
# Test manually
python3 -c "
from ytpipe.core.pipeline import Pipeline
import asyncio
result = asyncio.run(Pipeline().process('https://youtube.com/watch?v=dQw4w9WgXcQ'))
print(result.success)
"
```
---
## π Tips
### Performance
- Use `whisper_model="tiny"` for 3x faster processing
- Use `backend="faiss"` for fastest vector operations
- Process shorter videos first (<10 min)
### Quality
- Use `whisper_model="large"` for best transcription
- Higher `chunk_size` = fewer, longer chunks
- Higher `chunk_overlap` = better context
### Integration
- ytpipe works with any MCP client (not just Claude Code)
- Tools are composable (chain multiple calls)
- All results are JSON-serializable dicts
---
**Setup Time**: ~2 minutes
**First Video Processing**: ~15 seconds
**Status**: β
**READY TO USE!**