Skip to main content
Glama
Kokoro Text to Speech MCP Server

Kokoro Text to Speech MCP Server

by mberg

Kokoro 텍스트 음성 변환(TTS) MCP 서버

S3에 업로드할 수 있는 옵션이 있는 .mp3 파일을 생성하는 Kokoro 텍스트 음성 변환 MCP 서버입니다.

사용처: https://huggingface.co/spaces/hexgrad/Kokoro-TTS

Related MCP server: MCP Voice Soundboard

구성

MCP 구성에 다음을 추가하세요. 원하는 값으로 업데이트하세요.

지엑스피1

ffmmeg 설치

.wav 파일을 .mp3 파일로 변환하려면 이것이 필요합니다.

맥의 경우:

brew install ffmpeg

로컬에서 실행하려면 .env 파일에 다음 내용을 추가하세요. env.example을 참고하여 .env 파일에 복사한 후 원하는 값으로 수정하세요.

지원되는 환경 변수

  • AWS_ACCESS_KEY_ID : AWS 액세스 키 ID

  • AWS_SECRET_ACCESS_KEY : AWS 비밀 액세스 키

  • AWS_S3_BUCKET_NAME : S3 버킷 이름

  • AWS_S3_REGION : S3 지역(예: us-east-1)

  • AWS_S3_FOLDER : S3 버킷 내의 폴더 경로

  • AWS_S3_ENDPOINT_URL : S3 호환 스토리지에 대한 선택적 사용자 지정 엔드포인트 URL

  • MCP_HOST : 서버를 바인딩할 호스트(기본값: 0.0.0.0)

  • MCP_PORT : 수신할 포트(기본값: 9876)

  • MCP_CLIENT_HOST : 서버에 대한 클라이언트 연결의 호스트 이름(기본값: localhost)

  • DEBUG : 디버그 모드 활성화("true" 또는 "1"로 설정)

  • S3_ENABLED : S3 업로드를 활성화합니다("true" 또는 "1"로 설정)

  • MP3_FOLDER : MP3 파일을 저장할 경로(기본값은 스크립트 디렉토리의 'mp3' 폴더)

  • MP3_RETENTION_DAYS : MP3 파일을 자동 삭제하기 전까지 보관할 일수

  • DELETE_LOCAL_AFTER_S3_UPLOAD : S3 업로드 성공 후 로컬 MP3 파일을 삭제할지 여부("true" 또는 "1"로 설정)

  • TTS_VOICE : TTS 클라이언트의 기본 음성(기본값: af_heart)

  • TTS_SPEED : TTS 클라이언트의 기본 속도(기본값: 1.0)

  • TTS_LANGUAGE : TTS 클라이언트의 기본 언어(기본값: en-us)

로컬에서 서버 실행

선호하는 방법은 UV를 사용하는 것입니다.

uv run mcp-tts.py

TTS 클라이언트 사용

mcp_client.py 스크립트를 사용하면 서버에 TTS 요청을 보낼 수 있습니다. 다음과 같이 사용할 수 있습니다.

연결 설정

동일한 머신에서 서버와 클라이언트를 실행하는 경우:

  • 서버는 0.0.0.0 (모든 인터페이스) 또는 127.0.0.1 (로컬호스트만)에 바인딩해야 합니다.

  • 클라이언트는 localhost 또는 127.0.0.1 에 연결해야 합니다.

기본 사용법

python mcp_client.py --text "Hello, world!"

파일에서 텍스트 읽기

python mcp_client.py --file my_text.txt

음성 및 속도 사용자 지정

python mcp_client.py --text "Hello, world!" --voice "en_female" --speed 1.2

S3 업로드 비활성화

python mcp_client.py --text "Hello, world!" --no-s3

명령줄 옵션

python mcp_client.py --help

MP3 파일 관리

TTS 서버는 로컬에 저장되고 선택적으로 S3에 업로드되는 MP3 파일을 생성합니다. 이러한 파일 관리 방식을 다음과 같이 설정할 수 있습니다.

로컬 스토리지

  • .env 파일에서 MP3_FOLDER 설정하여 MP3 파일이 저장되는 위치를 지정합니다.

  • 파일은 자동으로 삭제되지 않는 한 이 폴더에 보관됩니다.

자동 정리

  • MP3_RETENTION_DAYS=30 (또는 원하는 숫자)을 설정하면 해당 일수보다 오래된 파일을 자동으로 삭제합니다.

  • S3 업로드가 성공한 직후 로컬 파일을 삭제하려면 DELETE_LOCAL_AFTER_S3_UPLOAD=true 설정합니다.

S3 통합

  • S3_ENABLED=true 또는 DISABLE_S3=true 사용하여 S3 업로드를 활성화/비활성화합니다.

  • .env 파일에서 AWS 자격 증명 및 버킷 설정 구성

  • 클라이언트의 --no-s3 옵션을 사용하여 요청별로 S3 업로드를 비활성화할 수 있습니다.

Available Tools

1 tool
text_to_speechB
    Convert text to speech using the Kokoro TTS service.
    
    Args:
        text: The text to convert to speech
        voice: Voice ID to use (default: af_heart)
        speed: Speech speed (default: 1.0)
        lang: Language code (default: en-us)
        filename: Optional filename for the MP3 (default: auto-generated UUID)
        upload_to_s3: Whether to upload to S3 if enabled (default: True)
        
    Returns:
        A dictionary with information about the generated audio file
    

Inputs: text (required), voice, speed, lang, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clearly defined purpose of converting text to speech, which cannot be confused with any other functionality.

    Naming Consistency5/5

    The single tool name 'text_to_speech' follows a clear verb_noun pattern and uses snake_case consistently. With only one tool, naming consistency is inherently perfect as there are no other tools to compare against.

    Tool Count2/5

    A single tool is too few for a server's apparent scope of text-to-speech functionality. While the tool itself is well-defined, a complete TTS service would typically include additional tools such as listing available voices, managing audio files, or configuring settings, making this server feel thin and incomplete.

    Completeness2/5

    The server is severely incomplete for a text-to-speech domain. It lacks essential operations such as listing available voices, checking service status, managing generated audio files (beyond the single generation tool), or handling configuration. This creates significant gaps that will limit agent workflows and cause failures in more complex tasks.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers