Add HTTP service, MCP adapter, systemd autostart; fix bugs and docs

- chatterbox_cli_v4.py: cooperative stop/interrupt via threading.Event;
  fix force_split_sentence (word boundary instead of mid-word cut);
  fix synthesize_streaming normalization order (split before preprocess)
- tts_service.py: FastAPI service with job queue, model cache, worker thread;
  LAN-accessible on 0.0.0.0:9999; audio_device default None (auto)
- mcp_adapter.py: MCP adapter (stdio + streamable-http) wrapping REST API;
  update docstring and default TTS_URL to port 9999
- requirements.txt: add fastapi, uvicorn, httpx, mcp
- README.md, BEDIENUNGSANLEITUNG.md: document service, MCP, AI integrations
  (Claude, Ollama, Open WebUI, llama.cpp, Home Assistant), systemd autostart
- CLAUDE.md: reflect current architecture (service + adapter now implemented)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-05-16 10:19:00 +02:00
commit d1971049ce
7 changed files with 494 additions and 146 deletions

View file

@ -2,7 +2,7 @@
"""
Chatterbox TTS MCP-Adapter
Setzt einen laufenden tts_service.py voraus (Standard: http://127.0.0.1:8000).
Setzt einen laufenden tts_service.py voraus (Standard: http://127.0.0.1:9999).
Start (streamable-http, Port 8001 für beliebige MCP-Clients):
python mcp_adapter.py
@ -10,18 +10,13 @@ Start (streamable-http, Port 8001 für beliebige MCP-Clients):
Start (stdio für Claude Code / Claude Desktop):
python mcp_adapter.py --stdio
Claude Code Konfiguration (.claude/settings.json):
{
"mcpServers": {
"chatterbox-tts": {
"command": "python",
"args": ["/home/dschlueter/chatterbox-tts-cli/mcp_adapter.py", "--stdio"]
}
}
}
Claude Code (bereits konfiguriert via `claude mcp add --scope user`):
claude mcp add --scope user chatterbox-tts \
/home/dschlueter/miniforge3/envs/chatterbox/bin/python \
/home/dschlueter/chatterbox-tts-cli/mcp_adapter.py --stdio
Umgebungsvariable TTS_URL überschreibt die Service-Adresse:
TTS_URL=http://192.168.1.10:8000 python mcp_adapter.py --stdio
TTS_URL=http://192.168.1.10:9999 python mcp_adapter.py --stdio
"""
from __future__ import annotations
@ -31,7 +26,7 @@ import os
import httpx
from mcp.server.fastmcp import FastMCP
TTS_URL = os.environ.get("TTS_URL", "http://127.0.0.1:8000").rstrip("/")
TTS_URL = os.environ.get("TTS_URL", "http://127.0.0.1:9999").rstrip("/")
mcp = FastMCP(
"Chatterbox TTS",