# Dosugamea
## 基本信息
- Slug: `dosugamea-voicevox-mcp-server`
- Source: modelscope
- Publisher: @Dosugamea/voicevox-mcp-server
- Categories: speech-processing / autonomous-agents
- Hosted: No
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@Dosugamea/voicevox-mcp-server
## 简介
暂无描述。
## MCP Server 详情

# Voicevox MCP Server

This server enables the use of VOICEVOX-compatible speech synthesis servers (AivisSpeech / VOICEVOX / COEIROINK) via the MCP (Model Context Protocol). It can be used for speech synthesis in agent mode with Claude 3.7 using Cursor, etc.

## Prerequisites

### Windows Environment

- Node.js 18 or higher
- VOICEVOX ENGINE, etc. (running locally at http://localhost:50000, etc.)
- VLC Media Player (ensure it is in your system's PATH)

### Docker Environment (WSL2)

- Docker and Docker Compose
- WSL2
- VOICEVOX ENGINE, etc. (running locally or in Docker)
- A Linux environment where `sudo apt install libsdl2-dev pulseaudio-utils pulseaudio` has been executed
- Access permissions to `/mnt/wslg`

## Installation and Configuration

1. Clone the repository
bash
git clone https://github.com/Dosugamea/voicevox-mcp-server.git
cd voicevox-mcp-server


2. Install dependencies
bash
npm install


3. Set up environment variables
Copy `.env_example` to create a `.env` file and modify the settings as needed:
plaintext
VOICEVOX_API_URL=http://localhost:50021
VOICEVOX_SPEAKER_ID=1


## How to Run

### Running on Windows Environment
Please start the server separately from the editor following the steps below.
bash
npm run build
npm start


### Running in Docker Environment
No separate action from the editor is required. Since it starts in stdio mode, it cannot be run directly.

## Configuration

### For Running on Windows Environment
Add the following to `mcp.json`. If the connection is unstable and gets disconnected, please reconnect.
json
"voicevox": {
    "url": "http://localhost:10100/sse"
}


### For Running in Docker Environment
Add the following to `mcp.json`. (Operation in the author's environment has not been verified.)
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"
            }
        }
    }
}


## About Speaker IDs

The speaker ID varies depending on the VOICEVOX model being used. By default, it uses "1" (Shikoku Metan). If you want to use another speaker ID, change the `VOICEVOX_SPEAKER_ID` environment variable.

You can check the list of speaker IDs through the `/speakers` endpoint of the VOICEVOX ENGINE API.
Example: `curl http://localhost:50021/speakers`## Troubleshooting

- **Connection Error with VOICEVOX**: Please ensure that the VOICEVOX ENGINE is running and that the API URL is correctly set.
- **No Audio Playback**: Verify that VLC is properly installed and that the path is correctly configured.
- **Audio Output Issues in Docker Environment**: Check if the pulseaudio settings are correct.

## Information for Developers

- If you wish to contribute to the source code, please create an Issue or submit a Pull Request.
- For bug reports or feature requests, please use the Issue feature on GitHub.

## License

MIT License

