OpenCode Voice MCP Server
<div align="center">
# π€ OpenCode Voice MCP Server
### Voice Input for AI Coding Assistants
[](LICENSE)
[](https://www.npmjs.com/package/@yuvarjbhado/voice-mcp)
[](https://github.com/YuvrajSinghBhadoria2/opencode-voice-mcp)
[](https://github.com/YuvrajSinghBhadoria2/opencode-voice-mcp)
[](https://modelcontextprotocol.io)
**Speak your prompts. No typing required.**
[Installation](#installation) β’ [Quick Start](#quick-start) β’ [Tools](#tools) β’ [Configuration](#configuration) β’ [Architecture](#architecture) β’ [Contributing](#contributing)
</div>
---
## β¨ Features
| Feature | Description |
|---------|-------------|
| π€ **Voice Recording** | Record audio from microphone with configurable duration |
| π£οΈ **Speech-to-Text** | Transcribe using local Whisper model (100% offline) |
| β¨οΈ **Auto-Typing** | Type transcribed text at cursor position |
| π **Privacy First** | No cloud API β audio never leaves your machine |
| π **Multi-Language** | Support for 99+ languages via Whisper |
| π **MCP Standard** | Works with OpenCode, Claude Code, Cursor, and more |
## π¦ Installation
```bash
# Install globally
npm install -g @yuvarjbhado/voice-mcp
# Or use with npx (no install required)
npx @yuvarjbhado/voice-mcp
```
### Prerequisites
<details>
<summary><strong>macOS</strong></summary>
```bash
# Install recording tool
brew install sox
# Install transcription engine
pip install faster-whisper
```
</details>
<details>
<summary><strong>Linux (Ubuntu/Debian)</strong></summary>
```bash
# Install recording tool
sudo apt install sox
# Install transcription engine
pip install faster-whisper
```
</details>
<details>
<summary><strong>Windows</strong></summary>
```bash
# Install FFmpeg (via scoop)
scoop install ffmpeg
# Install transcription engine
pip install faster-whisper
```
</details>
## π Quick Start
### Step 1: Configure MCP Server
Add to your MCP config file:
| Tool | Config Location |
|------|-----------------|
| **OpenCode** | `~/.config/opencode/config.json` |
| **Claude Code** | `~/.claude/claude_desktop_config.json` |
| **Cursor** | `~/.cursor/mcp.json` |
**OpenCode** (use `mcp` key):
```json
{
"mcp": {
"voice": {
"command": "npx",
"args": ["-y", "@yuvarjbhado/voice-mcp"]
}
}
}
```
**Claude Desktop / Cursor** (use `mcpServers` key):
```json
{
"mcpServers": {
"voice": {
"command": "npx",
"args": ["-y", "@yuvarjbhado/voice-mcp"]
}
}
}
```
### Step 2: Restart Your Tool
Restart OpenCode, Claude Code, or Cursor to load the MCP server.
### Step 3: Use Voice Input
```
@voice voice_transcribe
@voice voice_type
@voice voice_status
```
## π οΈ Tools
### `voice_transcribe`
Record audio from microphone and transcribe to text.
```json
{
"name": "voice_transcribe",
"arguments": {
"duration": 10,
"language": "en"
}
}
```
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `duration` | number | `10` | Recording duration in seconds |
| `language` | string | `auto` | Language code (e.g., `en`, `es`, `fr`) |
**Returns:** Transcribed text as string.
---
### `voice_type`
Record audio, transcribe to text, and type it at the cursor position.
```json
{
"name": "voice_type",
"arguments": {
"duration": 10,
"language": "en"
}
}
```
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `duration` | number | `10` | Recording duration in seconds |
| `language` | string | `auto` | Language code |
**Returns:** Confirmation message with typed text.
---
### `voice_status`
Check if voice recording and transcription are available.
```json
{
"name": "voice_status",
"arguments": {}
}
```
**Returns:**
```json
{
"recording": "rec",
"transcription": "faster-whisper (local)",
"platform": "darwin",
"ready": true
}
```
## βοΈ Configuration
### Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `WHISPER_MODEL` | Whisper model size | `base` |
| `WHISPER_DEVICE` | Device to use (`cpu`, `cuda`, `auto`) | `auto` |
| `WHISPER_COMPUTE` | Compute type (`int8`, `float16`, `float32`) | `int8` |
### Model Sizes
| Model | Size | Speed | Accuracy | VRAM |
|-------|------|-------|----------|------|
| `tiny` | ~75MB | β‘β‘β‘β‘ | ββ | ~1GB |
| `base` | ~150MB | β‘β‘β‘ | βββ | ~1GB |
| `small` | ~500MB | β‘β‘ | ββββ | ~2GB |
| `medium` | ~1.5GB | β‘ | βββββ | ~5GB |
| `large-v3` | ~3GB | π | βββββ | ~10GB |
**Recommendation:** Use `base` for best balance of speed and accuracy.
## ποΈ Architecture
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MCP Client β
β (OpenCode / Claude Code / Cursor) β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β JSON-RPC
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Voice MCP Server β
β (Node.js) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β voice_record β βvoice_transcribeβ β voice_type β β
β β Tool β β Tool β β Tool β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β β β β β
β βΌ βΌ βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Audio Recording Layer β β
β β (sox / ffmpeg / macOS rec) β β
β βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Transcription Engine β β
β β (faster-whisper / OpenAI API) β β
β βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Output Layer β β
β β βββββββββββββββ βββββββββββββββββββββββ β β
β β β Return Text β β Type at Cursor β β β
β β β (MCP) β β (osascript/xdotool) β β β
β β βββββββββββββββ βββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
### Data Flow
```
βββββββββββ βββββββββββ βββββββββββββββ βββββββββββ
β User βββββΆβ Micro- βββββΆβ Whisper βββββΆβ Text β
β Speaks β β phone β β Transcribe β β Output β
βββββββββββ βββββββββββ βββββββββββββββ βββββββββββ
β β β β
β β β β
βΌ βΌ βΌ βΌ
"Hello Records 16kHz Processes with Returns text
world" mono audio base model or types it
```
## π§ Development
### Setup
```bash
# Clone repository
git clone https://github.com/YuvrajSinghBhadoria2/opencode-voice-mcp.git
cd opencode-voice-mcp
# Install dependencies
npm install
# Build
npm run build
# Run in development
npm run dev
```
### Project Structure
```
opencode-voice-mcp/
βββ src/
β βββ index.ts # MCP server implementation
βββ dist/
β βββ index.js # Compiled output
βββ package.json # Package configuration
βββ tsconfig.json # TypeScript config
βββ build.sh # Build script
βββ publish.sh # npm publish script
```
### Available Scripts
| Command | Description |
|---------|-------------|
| `npm run build` | Compile TypeScript to JavaScript |
| `npm run dev` | Run in development mode with tsx |
| `npm run start` | Run compiled server |
| `./publish.sh` | Build and publish to npm |
## π€ Contributing
Contributions are welcome! Please follow these steps:
1. **Fork** the repository
2. **Create** a feature branch (`git checkout -b feat/amazing-feature`)
3. **Commit** your changes (`git commit -m 'feat: add amazing feature'`)
4. **Push** to the branch (`git push origin feat/amazing-feature`)
5. **Open** a Pull Request
### Development Guidelines
- Follow TypeScript best practices
- Add tests for new features
- Update documentation as needed
- Use conventional commit messages
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## π Acknowledgments
- [Model Context Protocol](https://modelcontextprotocol.io) - Standard for AI tool integration
- [faster-whisper](https://github.com/SYSTRAN/faster-whisper) - Fast Whisper implementation
- [OpenCode](https://github.com/anomalyco/opencode) - AI coding assistant
- [OpenAI Whisper](https://github.com/openai/whisper) - Speech recognition model
---
<div align="center">
**Built with β€οΈ for the developer community**
[Report Bug](https://github.com/YuvrajSinghBhadoria2/opencode-voice-mcp/issues) β’ [Request Feature](https://github.com/YuvrajSinghBhadoria2/opencode-voice-mcp/issues) β’ [Discussions](https://github.com/YuvrajSinghBhadoria2/opencode-voice-mcp/discussions)
</div>
TDQS
Scored across 3 tools
voice_transcribe and voice_type both perform recording and transcription, differing only in whether the result is typed into the active window. This creates some overlap, though voice_status is clearly distinct. Descriptions clarify the intended use.
The voice_ prefix is consistent across all tools, but the suffix alternates between a verb (transcribe, type) and a noun (status), slightly breaking the uniform verb pattern. Overall, the naming is predictable and readable.
With only three tools, the server is tightly scoped to the core voice capture and transcription workflows. Each tool serves a clear purpose, and the count feels appropriate for the narrow domain.
The server covers the primary actions of transcribing and typing, plus a status check. Missing optional features like language selection or audio device configuration, but these are not essential to the main workflow.