Skip to main content
Glama
mberg

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
    
ParametersJSON Schema
NameRequiredDescriptionDefault
textYes
voiceNoen_sarah
speedNo
langNoen-us
filenameNo
upload_to_s3No

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the output is an MP3 file and that upload to S3 is optional, which adds some context. However, it doesn't cover important aspects like rate limits, authentication requirements, error conditions, or what the returned dictionary contains. For a tool with 6 parameters and no annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized. It starts with the core purpose, then lists parameters with clear explanations, and ends with return information. Every sentence earns its place, though the formatting with 'Args:' and 'Returns:' sections is slightly verbose but still efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, no annotations, no output schema), the description is moderately complete. It excels at parameter documentation but lacks behavioral context and usage guidelines. The absence of an output schema means the description should ideally explain the return dictionary structure, which it doesn't. It's adequate but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides excellent parameter semantics beyond the input schema. With 0% schema description coverage, the description fully compensates by explaining each parameter's purpose, default values, and optionality. It clarifies that 'filename' is auto-generated if not provided and that 'upload_to_s3' depends on whether S3 is enabled. This adds significant value over the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Convert text to speech using the Kokoro TTS service.' It specifies the verb ('convert') and resource ('text to speech'), and mentions the specific service. However, without sibling tools, it cannot demonstrate differentiation from alternatives, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, constraints, or typical use cases. The only contextual information is the service name (Kokoro TTS), but this doesn't help an agent decide when this tool is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 1 tool updatev1.0.0
    • Changedtext_to_speech2 fields changed
      • changedInput schema / properties / speed / default
        Previous value: -1New value: +1.2
      • changedInput schema / properties / voice / default
        Previous value: -"af_heart"New value: +"en_sarah"
  2. 1 tool update
    • First observedtext_to_speech

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers