Kokoro Text to Speech (TTS) MCP Server
This MCP server converts text to speech using the Kokoro TTS model, generating MP3 files with optional upload to AWS S3. It exposes a single tool that...
119 cmd = ['ffmpeg', '-y', '-i', wav_file, '-codec:a', 'libmp3lame', '-qscale:a', '2', mp3_file]
120 subprocess.run(cmd, check=True, capture_output=True, text=True)// Exploitable only if MCP is exposed to untrusted prompts and the attacker can control the `filename` parameter.
84 # Use macOS 'say' command or other system TTS
85 cmd = ['say', '-o', wav_file, text]
86 subprocess.run(cmd, check=True, capture_output=True, text=True)// Exploitable only if MCP is exposed to untrusted prompts and the fallback TTS method is triggered (e.g., when Kokoro is unavailable).
425 parser.add_argument("--s3-access-key",
426 help="Override S3 access key ID")
427 parser.add_argument("--s3-secret-key",
428 help="Override S3 secret access key")// Local-only MCP, requires compromised LLM or local access to exploit.
47 base_filename = os.path.splitext(output_file)[0]
48 wav_file = os.path.join(output_dir, f"{base_filename}.wav")
49 mp3_file = os.path.join(output_dir, output_file)// Exploitable only if MCP is exposed to untrusted prompts and the `filename` parameter is not properly sanitized upstream.
479 if args.debug or os.environ.get('DEBUG') == 'true' or os.environ.get('DEBUG') == '1':
480 print("Debug mode enabled")
481 print("Environment variables:")
482 for var in ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_S3_BUCKET_NAME', 'AWS_S3_REGION', 'AWS_S3_FOLDER', 'AWS_S3_ENDPOINT_URL']:
483 if os.environ.get(var):
484 print(f" {var}: {'*' * 10 if 'KEY' in var or 'SECRET' in var else os.environ.get(var)}")// Local-only MCP, requires compromised LLM or local access to exploit.
295 text = request_data.get('text', '')
296 voice = request_data.get('voice', os.environ.get('TTS_VOICE', 'af_heart'))
297 speed = float(request_data.get('speed', 1.0))
298 lang = request_data.get('lang', 'en-us')
299 filename = request_data.get('filename', None)
300 upload_to_s3_flag = request_data.get('upload_to_s3', True)
301
302 if not text:
303 return {"success": False, "error": "No text provided"}// Exploitable only if MCP is exposed to untrusted prompts.