gemini-tts
README.md
# gemini-tts: AI Studio voiceovers for any AI agent
Ask your AI agent for a voiceover and get an MP3 back in your project. The agent writes the script, picks a voice from Google AI Studio's speech playground (Enzo, Fola, Riko, Kore...), adds style notes and expression tags like `<laugh>`, and saves:
```
<your project>/voiceover/voiceover.mp3
```
It uses the same Gemini TTS engine as [AI Studio's Generate speech](https://aistudio.google.com/generate-speech), through **your own** Gemini API key.
Works with any agent that supports [MCP](https://modelcontextprotocol.io): Claude Code, Claude Desktop, GitHub Copilot (VS Code and CLI), Google Antigravity, Gemini CLI, Cursor, Codex, and others.
It has two parts:
| Part | What it is | Who uses it |
| --- | --- | --- |
| **MCP server** (`server.py`) | The tools `generate_voiceover` and `list_voices` | Every MCP client |
| **Skill** (`skills/voiceover/SKILL.md`) | Instructions for writing the script, choosing a voice and style, and saving to the project | Agents that support [Agent Skills](https://agentskills.io); others can read it as plain instructions |
## Requirements
- [uv](https://docs.astral.sh/uv/getting-started/installation/) (runs the server)
- [git](https://git-scm.com/) (uv fetches the server from this repo)
- [ffmpeg](https://ffmpeg.org/download.html) on your `PATH` (converts the audio to MP3)
- A Gemini API key: open [aistudio.google.com/apikey](https://aistudio.google.com/apikey) and click **Create API key**. Tip: pick **Create API key in new project**. Quota is counted per Google Cloud project, so a project used only for voiceovers keeps its own limits.
## Install with one prompt (any agent)
Paste this into your AI agent (Copilot, Antigravity, Claude, Cursor, Codex...). It installs the server and the skill into that agent's own config.
```text
Install the gemini-tts voiceover extension from https://github.com/TarekMohammedgg/gemini-tts-mcp for yourself (the agent I am talking to now):
1. Check that `uv`, `git` and `ffmpeg` are installed. If one is missing, tell me how to install it for my OS and stop.
2. Add this MCP server to YOUR OWN user-level MCP config file (the one this agent reads; keep any servers already in it):
name: gemini-tts
command: uvx
args: ["--from", "git+https://github.com/TarekMohammedgg/gemini-tts-mcp", "gemini-tts-mcp"]
env: GEMINI_API_KEY = <my key>
Ask me for the key. Do not print it back, and never put it in a file inside a git repository.
3. Download https://raw.githubusercontent.com/TarekMohammedgg/gemini-tts-mcp/main/skills/voiceover/SKILL.md into your user-level skills folder as voiceover/SKILL.md. If you do not support skills, save it where you keep standing instructions.
4. Tell me which files you changed and whether I need to restart you.
```
Then restart the agent and ask:
> Write a 30-second voiceover introducing my app, Enzo's voice, excited documentary style.
> اعمل voiceover بالعامية المصرية عن الذكاء الاصطناعي بصوت Fola
## Install manually
Every client uses the same server definition; only the file differs.
```json
{
"mcpServers": {
"gemini-tts": {
"command": "uvx",
"args": ["--from", "git+https://github.com/TarekMohammedgg/gemini-tts-mcp", "gemini-tts-mcp"],
"env": { "GEMINI_API_KEY": "YOUR_KEY" }
}
}
}
```
| Agent | MCP config file |
| --- | --- |
| Claude Code | Use the plugin below (server and skill together) |
| Google Antigravity | `~/.gemini/config/mcp_config.json` |
| GitHub Copilot CLI | `~/.copilot/mcp-config.json` (or `copilot mcp add`) |
| VS Code (Copilot) | `mcp.json` via **MCP: Open User Configuration**; the top-level key is `servers`, not `mcpServers` |
| Gemini CLI | `~/.gemini/settings.json` |
| Cursor | `~/.cursor/mcp.json` |
| Codex | `~/.codex/config.toml`, as `[mcp_servers.gemini-tts]` |
For the skill, copy `skills/voiceover/` into your agent's skills folder. Antigravity reads `~/.gemini/config/skills/`; `~/.agents/skills/` is the cross-agent location from the [Agent Skills](https://agentskills.io) spec, read by a growing number of agents. Your agent's docs list its own folder.
Config locations change between versions. If one does not work, check your agent's MCP docs, or use the prompt above and let the agent find its own file.
The key sits in that config file as plain text, so keep the file out of git. If your agent passes your environment to MCP servers, you can set `GEMINI_API_KEY` as a user environment variable instead and leave `env` out.
## Claude Code plugin
Claude Code can install the server and the skill together, and stores the key in your system keychain instead of a file:
```
/plugin marketplace add TarekMohammedgg/gemini-tts-mcp
/plugin install gemini-tts@gemini-tts
```
It asks for your Gemini API key during install. To change it later: `claude plugin configure gemini-tts`. Restart Claude Code after installing.
## Tools
| Tool | What it does |
| --- | --- |
| `generate_voiceover` | `text`, `voice` (default `Enzo`), `style`, `speakers` (up to 2, `{"Host": "Enzo", "Guest": "Fola"}`), `project_dir`, `filename`, `model` (default `gemini-3.8-flash-tts`). Saves `<project_dir>/voiceover/<filename>` and returns the path. Earlier takes are kept with a timestamped name. |
| `list_voices` | AI Studio's voices with their character, plus the Style presets (Whisper, Friendly, Narration, Promote, Podcast). |
Style takes a preset or free-form director's notes, e.g. `Egyptian Arabic, warm documentary narrator, medium pace`. Expression tags go inline in the text: `<laugh>`, `<gasp>`, `<sigh>`, `<whisper>`.
## How is this different?
### vs. using Google AI Studio directly
| | This extension | AI Studio website |
| --- | --- | --- |
| Script | The agent writes it from your idea, in context of your project | You write or paste it |
| Steps | One request: script, voice, style, MP3 in your project | Write, pick voice, Run, download, convert, move the file |
| Output | `voiceover/voiceover.mp3` in the project, previous takes kept | A WAV download you file yourself |
| Quota | Your **API key's** quota (free tier, then pay per use) | The website's limits; a Google AI Pro or Ultra plan raises these |
| Best for | Repeating voiceovers inside real projects, scripted by the agent | Auditioning voices and one-off clips by hand |
A Google AI Pro/Ultra subscription raises limits in the AI Studio website, but API calls with a key are billed and limited separately ([Google](https://ai.google.dev/gemini-api/docs/google-ai-plans)). If your API quota runs out, the tool stops (no retries) and returns a ready-to-paste block for the website, so you can finish there.
### vs. other tools that take your Gemini API key
- **Full TTS controls.** Many Gemini front-ends and chat apps only do text chat, or expose TTS without voice choice, styles, expression tags, or two-speaker dialogue. This exposes all of them.
- **Your key goes only to Google.** The server runs on your machine and calls `generativelanguage.googleapis.com` directly. Hosted tools often route your key and text through their own servers.
- **Part of your agent's workflow.** The agent writes the script, generates the audio and saves it next to your code in one step, instead of you copying text between apps.
- **Quota-aware.** One API call per voiceover, never an automatic retry.
### vs. other TTS providers (ElevenLabs, OpenAI TTS...)
Those are separate accounts, billing and voice catalogs. Use this if you want AI Studio's Gemini voices on your existing Google key; use them if you need their voice cloning or voices.
## Notes
- Not affiliated with Google. It calls the official Gemini API; it does not automate the AI Studio website or your Google account.
- Each voiceover spends your Gemini API quota. Check your live limits in AI Studio, or enable billing on the project for higher limits.
## License
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues