Skip to main content
Glama
Voicevox MCP Server

Voicevox MCP Server

by Dosugamea

Voicevox MCP 服务器

这是通过 MCP(模型上下文协议)使用 VOICEVOX 兼容语音合成服务器(AivisSpeech / VOICEVOX / COEIROINK)的服务器。它可以用于使用 Cursor 等中的 Claude 3.7 在代理模式下进行语音合成。

先决条件

Windows 环境

Docker 环境(WSL2)

  • Docker 和 Docker Compose

  • WSL2

  • VOICEVOX ENGINE 等(本地运行或在 Docker 中运行)

  • sudo apt install libsdl2-dev pulseaudio-utils pulseaudio的Linux环境

  • /mnt/wslg的访问权限

Related MCP server: TTS-MCP

安装和配置

  1. 克隆存储库

git clone https://github.com/Dosugamea/voicevox-mcp-server.git
cd voicevox-mcp-server
  1. 安装依赖项

npm install
  1. 设置环境变量通过复制.env_example并根据需要修改设置来创建.env文件:

VOICEVOX_API_URL=http://localhost:50021
VOICEVOX_SPEAKER_ID=1

如何做

在Windows环境中执行

请按照以下步骤从编辑器单独启动服务器。

npm run build
npm start

Docker环境中执行

无需单独的编辑器或操作。它不能直接执行,因为它以 stdio 模式启动。

如何设置

在 Windows 环境中运行时

请将以下内容添加到 mcp.json。连接不稳定,如果断开,请重新连接。

        "voicevox": {
            "url": "http://localhost:10100/sse"
        }

在 Docker 环境中运行时

请将以下内容添加到 mcp.json。 (作者环境未测试。)

{
    "tools": {
        "voicevox": {
            "command": "cmd",
            "args": [
                "/c",
                "docker",
                "run",
                "-i",
                "--rm",
                "-v",
                "/mnt/wslg:/mnt/wslg",
                "-e",
                "PULSE_SERVER",
                "-e",
                "SDL_AUDIODRIVER",
                "-e",
                "VOICEVOX_API_URL",
                "-e",
                "VOICEVOX_SPEAKER_ID",
                "your-local-docker-image-name"
            ],
            "env": {
                "PULSE_SERVER": "unix:/mnt/wslg/PulseServer",
                "SDL_AUDIODRIVER": "pulseaudio",
                "VOICEVOX_API_URL": "http://host.docker.internal:50031",
                "VOICEVOX_SPEAKER_ID": "919692871"
            }
        }
    }
}

关于Speaker ID

扬声器 ID 根据您使用的 VOICEVOX 型号而有所不同。默认使用“1”(四国金属)。如果您想使用其他扬声器 ID,请更改环境变量VOICEVOX_SPEAKER_ID 。

可以在 VOICEVOX ENGINE API 的/speakers端点找到说话者 ID 列表。例如: curl http://localhost:50021/speakers

故障排除

  • VOICEVOX 连接错误:请确保 VOICEVOX ENGINE 正在运行并且 API URL 设置正确。

  • 没有播放声音:确保 VLC 已正确安装并位于您的路径中。

  • Docker 环境中的音频输出问题:请检查 pulseaudio 是否配置正确。

开发者信息

  • 要为源代码做出贡献,请创建问题或提交拉取请求。

  • 要报告错误或请求功能,请使用 GitHub 上的问题功能。

执照

MIT 许可证

Available Tools

1 tool
voicevoxC

VOICEVOXを使用して音声を合成し、ホストコンピュータで再生します

Inputs: text.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/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 'voicevox' has a clear, distinct purpose for text-to-speech synthesis and playback.

    Naming Consistency5/5

    A single tool inherently exhibits perfect naming consistency, as there are no other tools to compare against. The tool name 'voicevox' is straightforward and matches the server's domain.

    Tool Count2/5

    A single tool is too few for a server's purpose, even for a focused domain like text-to-speech. This limits functionality, as agents cannot perform related operations like listing voices, adjusting parameters, or managing playback without additional tools.

    Completeness2/5

    The tool surface is severely incomplete for a text-to-speech domain. While the core synthesis and playback function is covered, there are obvious gaps such as fetching available voices, configuring speech parameters, pausing or stopping playback, or handling errors, which will likely cause agent failures.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that integrates high-quality text-to-speech capabilities with Claude Desktop and other MCP-compatible clients, supporting multiple voice options and audio formats.
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Node.js server that enables AI assistants to interact with Bouyomi-chan's text-to-speech functionality through Model Context Protocol (MCP), allowing for voice reading of text with adjustable parameters.
      1
      2
      MIT