MCP Handlers

MCP (Model Context Protocol) handlers for AI agent integration.

Handlers

Utility handlers for the scitex-audio MCP server.

async scitex_audio._mcp.handlers.announce_context_handler(include_full_path: bool = False) dict[source]

Announce current working directory and git branch.

async scitex_audio._mcp.handlers.check_audio_status_handler() dict[source]

Check WSL audio connectivity and available playback methods.

async scitex_audio._mcp.handlers.clear_audio_cache_handler(max_age_hours: float = 24) dict[source]

Clear audio cache.

async scitex_audio._mcp.handlers.generate_audio_handler(text: str, backend: str | None = None, voice: str | None = None, output_path: str | None = None, return_base64: bool = False) dict[source]

Generate audio file without playing.

async scitex_audio._mcp.handlers.list_audio_files_handler(limit: int = 20) dict[source]

List generated audio files.

async scitex_audio._mcp.handlers.list_backends_handler() dict[source]

List available TTS backends.

async scitex_audio._mcp.handlers.list_voices_handler(backend: str = 'gtts') dict[source]

List available voices for a backend.

async scitex_audio._mcp.handlers.play_audio_handler(path: str) dict[source]

Play an audio file.

async scitex_audio._mcp.handlers.speak_handler(text: str, backend: str | None = None, voice: str | None = None, rate: int = 150, speed: float = 1.5, play: bool = True, save: bool = False, output_path: str | None = None, fallback: bool = True, agent_id: str | None = None, wait: bool = True, signature: bool = False, num_threads: int | None = None) dict[source]

Convert text to speech with fallback.

Parameters:
  • save – If True and output_path is None, auto-generate a timestamped path.

  • output_path – Explicit path to save the audio file (overrides save flag).

  • signature – If True, prepend hostname/project/branch to text.

  • num_threads – CPU thread count for LuxTTS backend (None=default).

async scitex_audio._mcp.handlers.speech_queue_status_handler() dict[source]

Get current speech queue status.

Speak Handlers

Speak handlers for scitex.audio MCP server.

Provides speak_local_handler and speak_relay_handler for explicit control over audio playback location (server vs relay).

async scitex_audio._mcp.speak_handlers.speak_local_handler(text: str, backend: str | None = None, voice: str | None = None, rate: int = 150, speed: float = 1.5, play: bool = True, save: bool = False, fallback: bool = True, agent_id: str | None = None, signature: bool = False) dict[source]

Play audio on the LOCAL/SERVER machine.

Use when running Claude Code directly on your local machine. Audio plays on the machine where the MCP server is running.

Returns success=False if: - SCITEX_AUDIO_MODE=remote (should use relay instead) - Audio sink is SUSPENDED (no output device) - Playback was requested but failed

async scitex_audio._mcp.speak_handlers.speak_relay_handler(text: str, backend: str | None = None, voice: str | None = None, rate: int = 150, speed: float = 1.5, play: bool = True, save: bool = False, fallback: bool = True, agent_id: str | None = None) dict[source]

Forward speech to RELAY server for remote playback.

Use when running on a remote server and want audio on your local machine. Returns detailed error with setup instructions if relay unavailable.