mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-15 21:00:42 -07:00
Mounts FastMCP at /mcp (Streamable HTTP) so Claude Code, Cursor, Windsurf, and the VS Code MCP extensions can call voicebox.speak, voicebox.transcribe, voicebox.list_captures, and voicebox.list_profiles against the running Voicebox server. Backend - new backend/mcp_server package (tools, middleware, profile resolve, pub/sub events); named mcp_server to avoid shadowing the installed mcp PyPI package FastMCP imports internally - app.py migrated from @app.on_event to lifespan= so FastMCP's session manager cohabits with Voicebox's startup/shutdown - new MCPClientBinding table + /mcp/bindings CRUD; ClientIdMiddleware reads X-Voicebox-Client-Id into a ContextVar and stamps last_seen_at - profile resolution precedence: explicit -> per-client binding -> capture_settings.default_playback_voice_id - POST /speak REST wrapper for non-MCP callers (shell, ACP, A2A) - GET /events/speak SSE broadcasts speak-start / speak-end so the pill surfaces agent-initiated speech - backend/mcp_shim proxy (plain httpx) for stdio-only MCP clients - PyInstaller spec updates + new --shim build target (~18 MB) Frontend - Settings -> MCP page with HTTP / stdio / claude-mcp-add copy snippets, default voice picker, per-client bindings table, connection status - useMCPBindings, useSpeakEvents hooks - CapturePill gains 'speaking' state; DictateWindow subscribes to SSE and emits dictate:show so the Rust side surfaces the pill window Native - tauri.conf.json externalBin now includes voicebox-mcp - show_dictate_window helper + dictate:show listener in main.rs - (also in this commit: InputMonitoringGate UX, hotkey_monitor tweaks, landing footer/navbar updates, new overview docs for captures / dictation / mcp-server / voice-personalities) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
45 lines
1.7 KiB
Python
45 lines
1.7 KiB
Python
"""Route registration for the voicebox API."""
|
|
|
|
from fastapi import FastAPI
|
|
|
|
|
|
def register_routers(app: FastAPI) -> None:
|
|
"""Include all domain routers on the application."""
|
|
from .health import router as health_router
|
|
from .profiles import router as profiles_router
|
|
from .channels import router as channels_router
|
|
from .generations import router as generations_router
|
|
from .history import router as history_router
|
|
from .transcription import router as transcription_router
|
|
from .llm import router as llm_router
|
|
from .captures import router as captures_router
|
|
from .stories import router as stories_router
|
|
from .effects import router as effects_router
|
|
from .audio import router as audio_router
|
|
from .models import router as models_router
|
|
from .settings import router as settings_router
|
|
from .tasks import router as tasks_router
|
|
from .cuda import router as cuda_router
|
|
from .speak import router as speak_router
|
|
from .mcp_bindings import router as mcp_bindings_router
|
|
from .events import router as events_router
|
|
|
|
app.include_router(health_router)
|
|
app.include_router(profiles_router)
|
|
app.include_router(channels_router)
|
|
app.include_router(generations_router)
|
|
app.include_router(history_router)
|
|
app.include_router(transcription_router)
|
|
app.include_router(llm_router)
|
|
app.include_router(captures_router)
|
|
app.include_router(stories_router)
|
|
app.include_router(effects_router)
|
|
app.include_router(audio_router)
|
|
app.include_router(models_router)
|
|
app.include_router(settings_router)
|
|
app.include_router(tasks_router)
|
|
app.include_router(cuda_router)
|
|
app.include_router(speak_router)
|
|
app.include_router(mcp_bindings_router)
|
|
app.include_router(events_router)
|