{"openapi":"3.0.3","info":{"title":"MCP Server API","description":"Model Context Protocol server providing unified tool interface for LLMs\nto interact with Haiven infrastructure.\n\nThe MCP Server exposes 23 tools across 12 namespaces for system monitoring,\nDocker management, file operations, code execution, and **audio processing**.\n\n**LiteLLM Integration (Langfuse Observability):**\n- All LLM calls are routed through LiteLLM (`http://litellm:4000`)\n- Full tracing and analytics via Langfuse at `ai-ops.haiven.site`\n- Unified cost tracking across all clients\n- Access to all 33 LiteLLM models including TTS/STT\n\n**Audio Capabilities (Embedded Whisper STT):**\n- Speech-to-text transcription via `/v1/audio/transcriptions`\n- Audio translation to English via `/v1/audio/translations`\n- OpenAI-compatible audio API format\n- GPU-accelerated (Whisper large-v3 on GPU 0)\n\nNote: The standalone faster-whisper service has been deprecated and\nits functionality is now embedded in this MCP server.\n","version":"1.2.0","contact":{"name":"Haiven Infrastructure"}},"servers":[{"url":"http://mcp-server:8765","description":"Docker internal"},{"url":"https://mcp.haiven.site","description":"Production (via Traefik)"}],"paths":{"/health":{"get":{"summary":"Health check","description":"Returns service health status and uptime","operationId":"getHealth","tags":["Health"],"responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"},"example":{"status":"healthy","service":"mcp-server","version":"1.0.0","uptime_seconds":12345}}}}}}},"/tools":{"get":{"summary":"List available tools","description":"Returns all available MCP tools with their schemas","operationId":"listTools","tags":["Tools"],"responses":{"200":{"description":"List of available tools","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolsResponse"}}}}}}},"/mcp":{"post":{"summary":"Execute MCP tool","description":"Main MCP protocol endpoint for tool execution","operationId":"executeTool","tags":["MCP"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPRequest"},"examples":{"statusDocker":{"summary":"Get Docker container status","value":{"method":"tools/call","params":{"name":"status/docker","arguments":{}}}},"filesRead":{"summary":"Read a file","value":{"method":"tools/call","params":{"name":"files/read","arguments":{"path":"/mnt/apps/docker/ai/llama-swap/docker-compose.yml"}}}},"dockerLogs":{"summary":"Get container logs","value":{"method":"tools/call","params":{"name":"docker/logs","arguments":{"container_name":"mcp-server","lines":50}}}}}}}},"responses":{"200":{"description":"Tool execution result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Tool not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Backend error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"HealthResponse":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","unhealthy"]},"service":{"type":"string"},"version":{"type":"string"},"uptime_seconds":{"type":"integer"}}},"ToolsResponse":{"type":"object","properties":{"tools":{"type":"array","items":{"$ref":"#/components/schemas/Tool"}}}},"Tool":{"type":"object","properties":{"name":{"type":"string","description":"Tool identifier (namespace/action format)","example":"status/docker"},"description":{"type":"string"},"inputSchema":{"type":"object","description":"JSON Schema for tool arguments"}}},"MCPRequest":{"type":"object","required":["method","params"],"properties":{"method":{"type":"string","enum":["tools/call"]},"params":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Tool name to execute"},"arguments":{"type":"object","description":"Tool-specific arguments"}}}}},"MCPResponse":{"type":"object","properties":{"content":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","image","error"]},"text":{"type":"string"}}}}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}}},"/v1/audio/transcriptions":{"post":{"summary":"Transcribe audio to text","description":"OpenAI-compatible audio transcription endpoint using embedded faster-whisper.\nSupports multiple audio formats and response types.\n\n**Note:** This replaces the deprecated faster-whisper service.\n","operationId":"transcribeAudio","tags":["Audio"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Audio file (mp3, wav, m4a, flac, ogg, webm)"},"model":{"type":"string","default":"whisper-1","description":"Model to use (whisper-1 maps to large-v3)"},"language":{"type":"string","description":"ISO 639-1 language code (auto-detected if omitted)"},"response_format":{"type":"string","enum":["json","verbose_json","text","srt","vtt"],"default":"json"},"temperature":{"type":"number","default":0,"description":"Sampling temperature (0 = greedy)"}}}}}},"responses":{"200":{"description":"Transcription result","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"Transcribed text"},"language":{"type":"string"},"duration":{"type":"number"},"segments":{"type":"array","items":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"text":{"type":"string"}}}}}}}}}}}},"/v1/audio/translations":{"post":{"summary":"Translate audio to English","description":"Transcribes and translates audio to English text.\nUses the same embedded faster-whisper engine.\n","operationId":"translateAudio","tags":["Audio"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"model":{"type":"string","default":"whisper-1"},"response_format":{"type":"string","enum":["json","verbose_json","text","srt","vtt"],"default":"json"}}}}}},"responses":{"200":{"description":"Translation result","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"}}}}}}}}}},"tags":[{"name":"Health","description":"Service health endpoints"},{"name":"Tools","description":"Tool discovery"},{"name":"MCP","description":"Model Context Protocol operations"},{"name":"Audio","description":"Speech-to-text transcription and translation (embedded Whisper)"}]}