@kajidog/mcp-tts-voicevox 0.7.3 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,652 @@
1
+ # VOICEVOX TTS MCP
2
+
3
+ **English** | [日本語](README.ja.md)
4
+
5
+ A text-to-speech MCP server using VOICEVOX
6
+
7
+ > 🎮 **[Try the Browser Demo](https://kajidog.github.io/mcp-tts-voicevox/)** — Test VoicevoxClient directly in your browser
8
+
9
+ ## What You Can Do
10
+
11
+ - **Make your AI assistant speak** — Text-to-speech from MCP clients like Claude Desktop
12
+ - **UI Audio Player (MCP Apps)** — Play audio directly in the chat with an interactive player (ChatGPT / Claude Desktop / Claude Web etc.)
13
+ - **Multi-character conversations** — Switch speakers per segment in a single call
14
+ - **Smooth playback** — Queue management, immediate playback, prefetching, streaming
15
+ - **Cross-platform** — Works on Windows, macOS, Linux (including WSL)
16
+
17
+ ## UI Audio Player (MCP Apps)
18
+
19
+ ![UI Audio Player](docs/images/player.png)
20
+
21
+ The `voicevox_speak_player` tool uses [MCP Apps](https://github.com/modelcontextprotocol/ext-apps) to render an interactive audio player directly inside the chat. Unlike the standard `voicevox_speak` tool which plays audio on the server, **audio is played on the client side (in the browser/app)** — no audio device needed on the server.
22
+
23
+ ### Features
24
+
25
+ - **Client-side playback** — Audio plays in Claude Desktop's chat, not on the server. Works even over remote connections.
26
+ - **Play/Pause controls** — Full playback controls embedded in the conversation
27
+ - **Multi-speaker dialogue** — Sequential playback of multiple speakers in one player with track navigation
28
+ - **Speaker switching** — Change the voice of any segment directly from the player UI
29
+ - **Segment editing** — Adjust speed, volume, intonation, pause length, and pre/post silence per segment
30
+ - **Accent phrase editing** — Edit accent positions and mora pitch directly in the UI
31
+ - **Add / delete / reorder segments** — Drag-and-drop track reordering; add new segments inline
32
+ - **WAV export** — Save all tracks as numbered WAV files and open the output folder automatically
33
+ - **User dictionary manager** — Add, edit, and delete VOICEVOX user dictionary words with preview playback
34
+ - **Cross-session state restore** — Player state is persisted on the server; reopening the chat restores previous tracks
35
+
36
+ Export behavior by environment:
37
+ - `Save and open` always exports WAV files. If opening the file explorer is not supported, export still succeeds and the save path is shown in the UI.
38
+ - `Choose output folder` uses a native directory picker on Windows/macOS. On unsupported environments, this action falls back to the default export directory.
39
+
40
+ | Multi-speaker playback | Track list | Segment editing |
41
+ |:---:|:---:|:---:|
42
+ | ![Multi-speaker player](docs/images/multi-player.png) | ![Track list](docs/images/list-player.png) | ![Segment editing](docs/images/edit-player.png) |
43
+
44
+ | Speaker selection | Dictionary manager | WAV export |
45
+ |:---:|:---:|:---:|
46
+ | ![Speaker selection](docs/images/select-player.png) | ![Dictionary manager](docs/images/dictionary-player.png) | ![WAV export](docs/images/export-player.png) |
47
+
48
+ ### Supported Clients
49
+
50
+ | Client | Connection | Notes |
51
+ |--------|-----------|-------|
52
+ | **ChatGPT** | HTTP (remote) | Requires `VOICEVOX_PLAYER_DOMAIN` |
53
+ | **Claude Desktop** | stdio (local) | Works out of the box |
54
+ | **Claude Desktop** | HTTP (via mcp-remote) | Do not set `VOICEVOX_PLAYER_DOMAIN` |
55
+
56
+ > **Note:** `speak_player` requires a host that supports MCP Apps. In hosts without MCP Apps support, the tool is not available and `speak` (server-side playback) can be used instead.
57
+
58
+ ### Player MCP Tools
59
+
60
+ | Tool | Description |
61
+ |------|-------------|
62
+ | `speak_player` | Create a new player session and display the UI. Returns `viewUUID`. |
63
+ | `resynthesize_player` | Update all segments for an existing player (new `viewUUID` each call). |
64
+ | `get_player_state` | Read the current player state (paginated) for AI tuning. |
65
+ | `open_dictionary_ui` | Open the user dictionary manager UI. |
66
+
67
+ ## Quick Start
68
+
69
+ ### Requirements
70
+
71
+ - Node.js 20.0.0 or higher (or [Bun](https://bun.sh/)) **or Docker**
72
+ - [VOICEVOX Engine](https://voicevox.hiroshiba.jp/) (must be running; included in Docker Compose)
73
+ - ffplay (optional, recommended — not needed with Docker)
74
+
75
+ #### Installing FFplay
76
+
77
+ ffplay is a lightweight player included with FFmpeg that supports playback from stdin. When available, it automatically enables low-latency streaming playback.
78
+
79
+ > 💡 **FFplay is optional.** Without it, playback falls back to temp file-based playback (Windows: PowerShell, macOS: afplay, Linux: aplay, etc.).
80
+
81
+ - Easy setup: One-liner installation for each OS (see steps below)
82
+ - Required: `ffplay` must be in PATH (restart terminal/apps after installation)
83
+
84
+ <details>
85
+ <summary>FFplay Installation and PATH Setup</summary>
86
+
87
+ Installation examples:
88
+
89
+ - Windows (any of these)
90
+ - Winget: `winget install --id=Gyan.FFmpeg -e`
91
+ - Chocolatey: `choco install ffmpeg`
92
+ - Scoop: `scoop install ffmpeg`
93
+ - Official builds: Download from https://www.gyan.dev/ffmpeg/builds/ or https://github.com/BtbN/FFmpeg-Builds and add the `bin` folder to PATH
94
+
95
+ - macOS
96
+ - Homebrew: `brew install ffmpeg`
97
+
98
+ - Linux
99
+ - Debian/Ubuntu: `sudo apt-get update && sudo apt-get install -y ffmpeg`
100
+ - Fedora: `sudo dnf install -y ffmpeg`
101
+ - Arch: `sudo pacman -S ffmpeg`
102
+
103
+ PATH Setup:
104
+
105
+ - Windows: Add `...\ffmpeg\bin` to environment variables, then restart PowerShell/terminal and editor (Claude/VS Code, etc.)
106
+ - Verify: `powershell -c "$env:Path"` should include the ffmpeg path
107
+ - macOS/Linux: Usually auto-detected. Check with `echo $PATH` if needed, restart shell.
108
+ - MCP clients (Claude Desktop/Code): Restart the app to reload PATH.
109
+
110
+ Verification:
111
+
112
+ ```bash
113
+ ffplay -version
114
+ ```
115
+
116
+ If version info is displayed, installation is complete. CLI/MCP will automatically detect ffplay and use stdin streaming playback.
117
+
118
+ </details>
119
+
120
+
121
+ ### 3 Steps to Get Started
122
+
123
+ **1. Start VOICEVOX Engine**
124
+
125
+ **2. Add to Claude Desktop config file**
126
+
127
+ Config file location:
128
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
129
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
130
+
131
+ ```json
132
+ {
133
+ "mcpServers": {
134
+ "tts-mcp": {
135
+ "command": "npx",
136
+ "args": ["-y", "@kajidog/mcp-tts-voicevox"]
137
+ }
138
+ }
139
+ }
140
+ ```
141
+
142
+ > 💡 **If using Bun**, just replace `npx` with `bunx`:
143
+ > ```json
144
+ > "command": "bunx", "args": ["@kajidog/mcp-tts-voicevox"]
145
+ > ```
146
+
147
+ **3. Restart Claude Desktop**
148
+
149
+ That's it! Ask Claude to "say hello" and it will speak!
150
+
151
+ ### Quick Start with Docker
152
+
153
+ You can run both the MCP server and VOICEVOX Engine with a single command using Docker Compose. No Node.js or VOICEVOX installation required.
154
+
155
+ **1. Start the containers**
156
+
157
+ ```bash
158
+ docker compose up -d
159
+ ```
160
+
161
+ This starts the VOICEVOX Engine and the MCP server (HTTP mode on port 3000).
162
+
163
+ **2. Add to Claude Desktop config file (using mcp-remote)**
164
+
165
+ ```json
166
+ {
167
+ "mcpServers": {
168
+ "tts-mcp": {
169
+ "command": "npx",
170
+ "args": ["-y", "mcp-remote", "http://localhost:3000/mcp"]
171
+ }
172
+ }
173
+ }
174
+ ```
175
+
176
+ **3. Restart Claude Desktop**
177
+
178
+ > **Limitations (Docker):** The Docker container has no audio device, so the `voicevox_speak` tool (server-side playback) is disabled by default. Use `voicevox_speak_player` instead — it plays audio on the client side (in Claude Desktop) and works without any audio device on the server. See [UI Audio Player](#ui-audio-player-mcp-apps) for details.
179
+
180
+ ---
181
+
182
+ ## MCP Tools
183
+
184
+ ### `voicevox_speak` — Text-to-Speech
185
+
186
+ The main feature callable from Claude.
187
+
188
+ | Parameter | Description | Default |
189
+ |-----------|-------------|---------|
190
+ | `text` | Text to speak (multiple segments separated by newlines) | Required |
191
+ | `speaker` | Speaker ID | 1 |
192
+ | `speedScale` | Playback speed | 1.0 |
193
+ | `immediate` | Immediate playback (clears queue) | true |
194
+ | `waitForEnd` | Wait for playback completion | false |
195
+
196
+ **Examples:**
197
+
198
+ ```javascript
199
+ // Simple text
200
+ { "text": "Hello" }
201
+
202
+ // Specify speaker
203
+ { "text": "Hello", "speaker": 3 }
204
+
205
+ // Different speakers per segment
206
+ { "text": "1:Hello\n3:Nice weather today" }
207
+
208
+ // Wait for completion (synchronous processing)
209
+ { "text": "Wait for this to finish before continuing", "waitForEnd": true }
210
+ ```
211
+
212
+ <details>
213
+ <summary>Other Tools</summary>
214
+
215
+ | Tool | Description |
216
+ |------|-------------|
217
+ | `voicevox_speak_player` | Speak with UI audio player (disable with `--disable-tools`) |
218
+ | `voicevox_ping` | Check VOICEVOX Engine connection |
219
+ | `voicevox_get_speakers` | Get list of available speakers |
220
+ | `voicevox_stop_speaker` | Stop playback and clear queue |
221
+ | `voicevox_synthesize_file` | Generate audio file |
222
+
223
+ </details>
224
+
225
+ ---
226
+
227
+ ## Configuration
228
+
229
+ <details>
230
+ <summary><b>Environment Variables</b></summary>
231
+
232
+ ### VOICEVOX Settings
233
+
234
+ | Variable | Description | Default |
235
+ |----------|-------------|---------|
236
+ | `VOICEVOX_URL` | Engine URL | `http://localhost:50021` |
237
+ | `VOICEVOX_DEFAULT_SPEAKER` | Default speaker ID | `1` |
238
+ | `VOICEVOX_DEFAULT_SPEED_SCALE` | Playback speed | `1.0` |
239
+ | `VOICEVOX_RETRY_COUNT` | Retries for failed API requests (0 disables) | `2` |
240
+ | `VOICEVOX_RETRY_DELAY_MS` | Initial retry delay in ms (exponential backoff) | `250` |
241
+
242
+ ### Playback Options
243
+
244
+ | Variable | Description | Default |
245
+ |----------|-------------|---------|
246
+ | `VOICEVOX_USE_STREAMING` | Streaming playback (requires `ffplay`) | `false` |
247
+ | `VOICEVOX_DEFAULT_IMMEDIATE` | Immediate playback | `true` |
248
+ | `VOICEVOX_DEFAULT_WAIT_FOR_START` | Wait for playback start | `false` |
249
+ | `VOICEVOX_DEFAULT_WAIT_FOR_END` | Wait for playback end | `false` |
250
+
251
+ ### Restriction Settings
252
+
253
+ Restrict AI from specifying certain options.
254
+
255
+ | Variable | Description |
256
+ |----------|-------------|
257
+ | `VOICEVOX_RESTRICT_IMMEDIATE` | Restrict `immediate` option |
258
+ | `VOICEVOX_RESTRICT_WAIT_FOR_START` | Restrict `waitForStart` option |
259
+ | `VOICEVOX_RESTRICT_WAIT_FOR_END` | Restrict `waitForEnd` option |
260
+
261
+ ### Disable Tools
262
+
263
+ ```bash
264
+ # Disable individual tools
265
+ export VOICEVOX_DISABLED_TOOLS=speak_player,synthesize_file
266
+
267
+ # Disable a built-in group of tools
268
+ export VOICEVOX_DISABLED_GROUPS=player
269
+
270
+ # Combine groups and individual tools
271
+ export VOICEVOX_DISABLED_GROUPS=dictionary
272
+ export VOICEVOX_DISABLED_TOOLS=synthesize_file
273
+ ```
274
+
275
+ Built-in groups for `VOICEVOX_DISABLED_GROUPS` / `--disable-groups`:
276
+
277
+ | Group | Tools |
278
+ |-------|-------|
279
+ | `player` | `speak_player`, `resynthesize_player`, `get_player_state`, `open_dictionary_ui` |
280
+ | `dictionary` | `get_accent_phrases`, `get_user_dictionary`, `add_user_dictionary_word`, `update_user_dictionary_word`, `delete_user_dictionary_word`, `add_user_dictionary_words`, `update_user_dictionary_words` |
281
+ | `file` | `synthesize_file` |
282
+ | `apps` | `speak_player`, `resynthesize_player`, `open_dictionary_ui` (MCP App UI tools) |
283
+
284
+ ### UI Player Settings
285
+
286
+ | Variable | Description | Default |
287
+ |----------|-------------|---------|
288
+ | `VOICEVOX_PLAYER_DOMAIN` | Widget domain for UI player (required for ChatGPT, e.g. `https://your-app.onrender.com`) | _(unset)_ |
289
+ | `VOICEVOX_AUTO_PLAY` | Auto-play audio in UI player | `true` |
290
+ | `VOICEVOX_PLAYER_EXPORT_ENABLED` | Enable track export(download) from UI player (`false` to disable) | `true` |
291
+ | `VOICEVOX_PLAYER_EXPORT_DIR` | Default output directory for exported tracks (also used as fallback when folder picker is unavailable) | `./voicevox-player-exports` |
292
+ | `VOICEVOX_PLAYER_CACHE_DIR` | Directory for player cache files (`*.txt`) and default player state file | `./.voicevox-player-cache` |
293
+ | `VOICEVOX_PLAYER_AUDIO_CACHE_ENABLED` | Enable persistent audio cache on disk (`false` disables disk cache writes/reads) | `true` |
294
+ | `VOICEVOX_PLAYER_AUDIO_CACHE_TTL_DAYS` | Audio cache retention in days (`0`: disable disk cache, `-1`: no TTL cleanup) | `30` |
295
+ | `VOICEVOX_PLAYER_AUDIO_CACHE_MAX_MB` | Audio cache size cap in MB (`0`: disable disk cache, `-1`: unlimited) | `512` |
296
+ | `VOICEVOX_PLAYER_STATE_FILE` | Path of persisted player state JSON | `<VOICEVOX_PLAYER_CACHE_DIR>/player-state.json` |
297
+
298
+ ### Server Settings
299
+
300
+ | Variable | Description | Default |
301
+ |----------|-------------|---------|
302
+ | `MCP_HTTP_MODE` | Enable HTTP mode | `false` |
303
+ | `MCP_HTTP_PORT` | HTTP port | `3000` |
304
+ | `MCP_HTTP_HOST` | HTTP host | `0.0.0.0` |
305
+ | `MCP_ALLOWED_HOSTS` | Allowed hosts (comma-separated) | `localhost,127.0.0.1,[::1]` |
306
+ | `MCP_ALLOWED_ORIGINS` | Allowed origins (comma-separated) | `http://localhost,http://127.0.0.1,...` |
307
+ | `MCP_API_KEY` | Required API key for `/mcp` (sent via `X-API-Key` or `Authorization: Bearer`) | _(unset)_ |
308
+
309
+ </details>
310
+
311
+ <details>
312
+ <summary><b>Command Line Arguments</b></summary>
313
+
314
+ Command line arguments take priority over environment variables.
315
+
316
+ ```bash
317
+ # Basic settings
318
+ npx @kajidog/mcp-tts-voicevox --url http://192.168.1.100:50021 --speaker 3 --speed 1.2
319
+
320
+ # HTTP mode
321
+ npx @kajidog/mcp-tts-voicevox --http --port 8080
322
+
323
+ # With restrictions
324
+ npx @kajidog/mcp-tts-voicevox --restrict-immediate --restrict-wait-for-end
325
+
326
+ # Disable individual tools
327
+ npx @kajidog/mcp-tts-voicevox --disable-tools speak_player,synthesize_file
328
+
329
+ # Disable a tool group
330
+ npx @kajidog/mcp-tts-voicevox --disable-groups player
331
+ ```
332
+
333
+ | Argument | Description |
334
+ |----------|-------------|
335
+ | `--help`, `-h` | Show help |
336
+ | `--version`, `-v` | Show version |
337
+ | `--init` | Generate `.voicevoxrc.json` with default settings |
338
+ | `--config <path>` | Path to config file |
339
+ | `--url <value>` | VOICEVOX Engine URL |
340
+ | `--speaker <value>` | Default speaker ID |
341
+ | `--speed <value>` | Playback speed |
342
+ | `--use-streaming` / `--no-use-streaming` | Streaming playback |
343
+ | `--immediate` / `--no-immediate` | Immediate playback |
344
+ | `--wait-for-start` / `--no-wait-for-start` | Wait for start |
345
+ | `--wait-for-end` / `--no-wait-for-end` | Wait for end |
346
+ | `--restrict-immediate` | Restrict immediate |
347
+ | `--restrict-wait-for-start` | Restrict waitForStart |
348
+ | `--restrict-wait-for-end` | Restrict waitForEnd |
349
+ | `--disable-tools <tools>` | Disable tools (comma-separated tool names) |
350
+ | `--disable-groups <groups>` | Disable tool groups: `player`, `dictionary`, `file`, `apps` |
351
+ | `--auto-play` / `--no-auto-play` | Auto-play in UI player |
352
+ | `--player-export` / `--no-player-export` | Enable/disable track export(download) in UI player |
353
+ | `--player-export-dir <dir>` | Default output directory for exported tracks |
354
+ | `--player-cache-dir <dir>` | Player cache directory |
355
+ | `--player-state-file <path>` | Persisted player state file path |
356
+ | `--player-audio-cache` / `--no-player-audio-cache` | Enable/disable disk audio cache for player |
357
+ | `--player-audio-cache-ttl-days <days>` | Audio cache retention days (`0`: disable, `-1`: no TTL cleanup) |
358
+ | `--player-audio-cache-max-mb <mb>` | Audio cache size cap in MB (`0`: disable, `-1`: unlimited) |
359
+ | `--http` | HTTP mode |
360
+ | `--port <value>` | HTTP port |
361
+ | `--host <value>` | HTTP host |
362
+ | `--allowed-hosts <hosts>` | Allowed hosts (comma-separated) |
363
+ | `--allowed-origins <origins>` | Allowed origins (comma-separated) |
364
+ | `--api-key <key>` | Required API key for `/mcp` |
365
+
366
+ </details>
367
+
368
+ <details>
369
+ <summary><b>Config File (.voicevoxrc.json)</b></summary>
370
+
371
+ You can use a JSON config file instead of (or in addition to) environment variables and CLI arguments. This is useful when you have many settings to configure.
372
+
373
+ **Priority order:** CLI args > Environment variables > Config file > Defaults
374
+
375
+ ### Generate a config file
376
+
377
+ ```bash
378
+ npx @kajidog/mcp-tts-voicevox --init
379
+ ```
380
+
381
+ This creates `.voicevoxrc.json` in the current directory with all default settings. Edit it as needed.
382
+
383
+ ### Use a custom config file path
384
+
385
+ ```bash
386
+ npx @kajidog/mcp-tts-voicevox --config ./my-config.json
387
+ ```
388
+
389
+ Or via environment variable:
390
+
391
+ ```bash
392
+ VOICEVOX_CONFIG=./my-config.json npx @kajidog/mcp-tts-voicevox
393
+ ```
394
+
395
+ ### Example `.voicevoxrc.json`
396
+
397
+ ```json
398
+ {
399
+ "url": "http://192.168.1.50:50021",
400
+ "speaker": 3,
401
+ "speed": 1.2,
402
+ "http": true,
403
+ "port": 8080,
404
+ "disable-tools": ["synthesize_file"],
405
+ "disable-groups": ["dictionary"]
406
+ }
407
+ ```
408
+
409
+ Keys can be written in kebab-case (`use-streaming`), camelCase (`useStreaming`), or internal key names (`defaultSpeaker`). If `.voicevoxrc.json` exists in the current directory, it is loaded automatically.
410
+
411
+ </details>
412
+
413
+ <details>
414
+ <summary><b>HTTP Mode</b></summary>
415
+
416
+ For remote connections:
417
+
418
+ **Start Server:**
419
+
420
+ ```bash
421
+ # Linux/macOS
422
+ MCP_HTTP_MODE=true MCP_HTTP_PORT=3000 npx @kajidog/mcp-tts-voicevox
423
+
424
+ # Windows PowerShell
425
+ $env:MCP_HTTP_MODE='true'; $env:MCP_HTTP_PORT='3000'; npx @kajidog/mcp-tts-voicevox
426
+ ```
427
+
428
+ **Claude Desktop Config (using mcp-remote):**
429
+
430
+ ```json
431
+ {
432
+ "mcpServers": {
433
+ "tts-mcp-proxy": {
434
+ "command": "npx",
435
+ "args": ["-y", "mcp-remote", "http://localhost:3000/mcp"]
436
+ }
437
+ }
438
+ }
439
+ ```
440
+
441
+ ### Per-Project Speaker Settings
442
+
443
+ With Claude Code, you can configure different default speakers per project using custom headers in `.mcp.json`:
444
+
445
+ | Header | Description |
446
+ |--------|-------------|
447
+ | `X-Voicevox-Speaker` | Default speaker ID for this project |
448
+ | `X-API-Key` | API key when `MCP_API_KEY` is configured |
449
+
450
+ **Example `.mcp.json`:**
451
+
452
+ ```json
453
+ {
454
+ "mcpServers": {
455
+ "tts": {
456
+ "type": "http",
457
+ "url": "http://localhost:3000/mcp",
458
+ "headers": {
459
+ "X-Voicevox-Speaker": "113",
460
+ "X-API-Key": "your-api-key"
461
+ }
462
+ }
463
+ }
464
+ }
465
+ ```
466
+
467
+ This allows each project to use a different voice character automatically.
468
+
469
+ **Priority order:**
470
+ 1. Explicit `speaker` parameter in tool call (highest)
471
+ 2. Project default from `X-Voicevox-Speaker` header
472
+ 3. Global `VOICEVOX_DEFAULT_SPEAKER` setting (lowest)
473
+
474
+ </details>
475
+
476
+ <details>
477
+ <summary><b>WSL to Windows Host Connection</b></summary>
478
+
479
+ Connecting from WSL to an MCP server running on Windows:
480
+
481
+ ### 1. Get Windows Host IP from WSL
482
+
483
+ ```bash
484
+ # Method 1: From default gateway
485
+ ip route show | grep -oP 'default via \K[\d.]+'
486
+ # Usually in the format 172.x.x.1
487
+
488
+ # Method 2: From /etc/resolv.conf (WSL2)
489
+ cat /etc/resolv.conf | grep nameserver | awk '{print $2}'
490
+ ```
491
+
492
+ ### 2. Start Server on Windows
493
+
494
+ Add the WSL gateway IP to `MCP_ALLOWED_HOSTS` to allow access from WSL:
495
+
496
+ ```powershell
497
+ $env:MCP_HTTP_MODE='true'
498
+ $env:MCP_ALLOWED_HOSTS='localhost,127.0.0.1,172.29.176.1'
499
+ npx @kajidog/mcp-tts-voicevox
500
+ ```
501
+
502
+ Or with CLI arguments:
503
+
504
+ ```powershell
505
+ npx @kajidog/mcp-tts-voicevox --http --allowed-hosts "localhost,127.0.0.1,172.29.176.1"
506
+ ```
507
+
508
+ ### 3. WSL Configuration (.mcp.json)
509
+
510
+ ```json
511
+ {
512
+ "mcpServers": {
513
+ "tts": {
514
+ "type": "http",
515
+ "url": "http://172.29.176.1:3000/mcp"
516
+ }
517
+ }
518
+ }
519
+ ```
520
+
521
+ > ⚠️ Within WSL, `localhost` refers to WSL itself. Use the WSL gateway IP to access the Windows host.
522
+
523
+ </details>
524
+
525
+ <details>
526
+ <summary><b>Using with ChatGPT</b></summary>
527
+
528
+ To use with ChatGPT, deploy the MCP server in HTTP mode to the cloud with access to a VOICEVOX Engine.
529
+
530
+ ### 1. Deploy to the Cloud
531
+
532
+ Deploy with Docker to Render, Railway, etc. (Dockerfile included).
533
+
534
+ ### 2. Set Up VOICEVOX Engine
535
+
536
+ Run VOICEVOX Engine locally and expose it via ngrok, or deploy it alongside the MCP server.
537
+
538
+ ### 3. Configure Environment Variables
539
+
540
+ | Variable | Example | Description |
541
+ |----------|---------|-------------|
542
+ | `VOICEVOX_URL` | `https://xxxx.ngrok-free.app` | VOICEVOX Engine URL |
543
+ | `MCP_HTTP_MODE` | `true` | Enable HTTP mode |
544
+ | `MCP_ALLOWED_HOSTS` | `your-app.onrender.com` | Deployed hostname |
545
+ | `VOICEVOX_PLAYER_DOMAIN` | `https://your-app.onrender.com` | Widget domain for UI player (required for ChatGPT) |
546
+ | `VOICEVOX_DISABLED_TOOLS` | `speak` | Disable server-side playback (no audio device) |
547
+ | `VOICEVOX_PLAYER_EXPORT_ENABLED` | `false` | Disable export feature (files cannot be downloaded from cloud) |
548
+
549
+ ### 4. Add Connector in ChatGPT
550
+
551
+ Go to ChatGPT Settings → Connectors → Add MCP server URL (`https://your-app.onrender.com/mcp`).
552
+
553
+ </details>
554
+
555
+ <details>
556
+ <summary><b>Using with Claude Web</b></summary>
557
+
558
+ The basic steps are the same as ChatGPT, but the `VOICEVOX_PLAYER_DOMAIN` value is different.
559
+
560
+ Claude Web requires `ui.domain` to be a **hash-based dedicated domain**. Compute it with the following command:
561
+
562
+ ```bash
563
+ node -e "console.log(require('crypto').createHash('sha256').update('Your MCP server URL').digest('hex').slice(0,32)+'.claudemcpcontent.com')"
564
+ ```
565
+
566
+ Example: If your MCP server URL is `https://your-app.onrender.com/mcp`:
567
+
568
+ ```bash
569
+ node -e "console.log(require('crypto').createHash('sha256').update('https://your-app.onrender.com/mcp').digest('hex').slice(0,32)+'.claudemcpcontent.com')"
570
+ # Example output: 48fb73a6...claudemcpcontent.com
571
+ ```
572
+
573
+ Set this output value as `VOICEVOX_PLAYER_DOMAIN`.
574
+
575
+ > **Note**: Since ChatGPT and Claude Web require different `VOICEVOX_PLAYER_DOMAIN` values, a single instance cannot serve both clients simultaneously. Deploy separate instances for each, or switch the environment variable depending on your target client.
576
+
577
+ </details>
578
+
579
+ ---
580
+
581
+ ## Troubleshooting
582
+
583
+ <details>
584
+ <summary><b>Audio is not playing</b></summary>
585
+
586
+ **1. Check if VOICEVOX Engine is running**
587
+
588
+ ```bash
589
+ curl http://localhost:50021/speakers
590
+ ```
591
+
592
+ **2. Check platform-specific playback tools**
593
+
594
+ | OS | Required Tool |
595
+ |----|---------------|
596
+ | Linux | One of `aplay`, `paplay`, `play`, `ffplay` |
597
+ | macOS | `afplay` (pre-installed) |
598
+ | Windows | PowerShell (pre-installed) |
599
+
600
+ </details>
601
+
602
+ <details>
603
+ <summary><b>Not recognized by MCP client</b></summary>
604
+
605
+ - Check package installation: `npm list -g @kajidog/mcp-tts-voicevox`
606
+ - Verify JSON syntax in config file
607
+ - Restart the client
608
+
609
+ </details>
610
+
611
+ ---
612
+
613
+ ## Package Structure
614
+
615
+ | Package | Description |
616
+ |---------|-------------|
617
+ | `@kajidog/mcp-tts-voicevox` | MCP server |
618
+ | [`@kajidog/voicevox-client`](https://www.npmjs.com/package/@kajidog/voicevox-client) | General-purpose VOICEVOX client library (can be used independently) |
619
+ | `@kajidog/player-ui` | React-based audio player UI for browser playback |
620
+
621
+ ---
622
+
623
+ <details>
624
+ <summary><b>Developer Information</b></summary>
625
+
626
+ ### Setup
627
+
628
+ ```bash
629
+ git clone https://github.com/kajidog/mcp-tts-voicevox.git
630
+ cd mcp-tts-voicevox
631
+ pnpm install
632
+ ```
633
+
634
+ ### Commands
635
+
636
+ | Command | Description |
637
+ |---------|-------------|
638
+ | `pnpm build` | Build all packages |
639
+ | `pnpm test` | Run tests |
640
+ | `pnpm lint` | Run lint |
641
+ | `pnpm dev` | Start dev server |
642
+ | `pnpm dev:stdio` | Dev with stdio mode |
643
+ | `pnpm dev:bun` | Start dev server with Bun |
644
+ | `pnpm dev:bun:http` | Start HTTP dev server with Bun |
645
+
646
+ </details>
647
+
648
+ ---
649
+
650
+ ## License
651
+
652
+ ISC