Skip to main content
Glama
README.md
# VoiceVault

Turn texts into MP3s you keep, straight from a Claude chat, using your own ElevenLabs subscription.

Paste an article, a post or a script into Claude and ask it to narrate it in your voice. Claude agrees the voice with you, generates the speech in your ElevenLabs account, and saves the MP3 to storage you control, with a download link.

## The problem

Claude can already generate speech with the ElevenLabs connector and give you the MP3. But the files stay on ElevenLabs' side:

- **There is no promise they will be kept.** ElevenLabs says generated content stays accessible for an unspecified amount of time, with no guarantee on the free tier. The direct file links are signed and expire.
- **They are not where you need them.** Narrations end up in your ElevenLabs history, not in your own folder, bucket or app, where you could keep them, share them or build on them.

## What this project does

VoiceVault is a small MCP server that adds **your own storage** to this workflow. Speech is still generated in your ElevenLabs account; the server keeps the texts and the finished MP3s.

- **Saves every narration where you decide.** By default MP3s are saved as regular files on the computer that runs the server: your own PC, or a server if you host it there. All file access goes through a small `Storage` interface (4 methods), so cloud storage such as S3 or R2 can be plugged in. No cloud adapter is included yet.
- **Gives a stable download link** for each narration and lists all of them in one place.
- **Handles long texts in chunks:** saves each generated chunk right away, joins the chunks into one MP3, and resumes an interrupted narration with only the missing chunks, so finished parts are not paid for twice.
- **Never sees your ElevenLabs credentials.** It only receives links to generated audio, and only from ElevenLabs hosts.

The **Claude plugin** in `plugin/voicevault` teaches Claude the workflow. Claude confirms the text first (if it wrote the text), then the voice (your own or a platform voice), generates one take per chunk, saves each file and returns the link.

```
text ──► get_text ──► ElevenLabs (your account) ──► save_audio ──► finalize_audio ──► MP3 link
```

**Status:** proof of concept. There is no authentication yet, so everyone who knows the server URL shares the same texts and audio.

## Requirements

- Node.js 22.9 or later
- [cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/), or another way to expose the server over https so claude.ai can reach it
- A Claude account with the ElevenLabs connector enabled. Any plan works, including Free (tested on the Free plan in November 2026).

## Run

1. Install dependencies:
   ```
   npm install
   ```
2. Start a tunnel to the server's port and copy the `https://….trycloudflare.com` URL it prints:
   ```
   cloudflared tunnel --url http://localhost:3333
   ```
3. Create `.env` from the example and set `PUBLIC_URL` to the tunnel URL:
   ```
   cp .env.example .env
   ```
   For the other settings, see the comments in `.env.example`.
4. Start the server:
   ```
   npm run build
   npm start
   ```
   Or `npm run dev` while developing (it restarts on code changes). The server listens on `http://localhost:3333/mcp`.

The server reads `.env` only at startup. Restart it after you change `.env`, for example when a quick tunnel gets a new URL.

### Check it works

```
curl -X POST https://<your-tunnel>/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

The response lists the tools. Opening `/mcp` in a browser returns `405 Method Not Allowed`. That is expected: MCP uses POST. A `403 Invalid Host` means `PUBLIC_URL` does not match the tunnel URL.

You can also use the MCP Inspector: `npx @modelcontextprotocol/inspector` (transport: Streamable HTTP).

## Connect to Claude

**claude.ai:** Settings → Connectors → Add custom connector, URL `https://<your-tunnel>/mcp`. Enable it in a chat together with ElevenLabs.

**Claude Code:** add the server to `.mcp.json`:
```json
{ "mcpServers": { "voicevault": { "type": "http", "url": "http://localhost:3333/mcp" } } }
```

If you change the server's tools, claude.ai may keep showing the old tool list. Disconnect and reconnect the connector, then open a new chat.

## Plugin

Build the plugin zip. Its `.mcp.json` points at `PUBLIC_URL`:
```
npm run plugin:zip
```
This writes `plugin/voicevault-v<version>.zip`. Rebuild it whenever `PUBLIC_URL` changes. The skill's source is `plugin/voicevault/skills/voicevault-narration/SKILL.md`, The whole repo has one version, set in `package.json`: the server reports it and the build writes it into the plugin.

## Usage

In a chat with both connectors (and the plugin), ask for example: *"Voice this greeting in my voice and give me a download link: Hi, I can't talk right now…"*

Texts live in `data/texts/*.txt` (`data/texts/hello.txt` is a sample), and audio in `data/audio/<text_id>/`. You can also manage texts over REST:

| Method | Path | Description |
|---|---|---|
| GET | `/api/texts` | list texts |
| PUT | `/api/texts/:id` | create or overwrite a text (the request body is the text) |
| GET | `/api/audio` | list narrations |
| GET | `/audio/<text_id>/<text_id>.mp3` | download a narration |

## Storage

All file access goes through the `Storage` interface in `src/storage.ts`. It has four methods: `put`, `get`, `list` and `url`, where `url` returns a link the user can download from. The default `LocalStorage` keeps files on disk (`TEXTS_DIR`, `AUDIO_DIR`) and builds links from `PUBLIC_URL`.

To keep files somewhere else (S3, R2, a database…), implement `Storage` and pass it instead of `LocalStorage` in `src/index.ts`. Keys look like paths:

```
texts/<id>.txt
audio/<id>/chunks/chunk-000.mp3
audio/<id>/<id>.mp3
```

## MCP tools

| Tool | Purpose |
|---|---|
| `list_texts` | texts available for narration |
| `add_text` | store or overwrite a text |
| `get_text` | the text split into chunks, each `missing` or `saved` |
| `save_audio` | download a generated MP3 from an https link and store it as one chunk |
| `finalize_audio` | join the chunks into one MP3 and return its link |
| `list_audio` | narrations with their final links and status |

Prompt: `narrate(text_id, voice?)`.

## License

[MIT](LICENSE)