OpenCode Voice MCP Server

OpenCode Voice MCP Server

Enables voice input for AI coding assistants by recording audio, transcribing it locally with Whisper, and optionally typing the text at the cursor position. Supports multiple languages and works with MCP-compatible tools like OpenCode, Claude Code, and Cursor.

Category
访问服务器

README

<div align="center">

🎤 OpenCode Voice MCP Server

Voice Input for AI Coding Assistants

License: MIT npm version GitHub stars GitHub issues MCP Compatible

Speak your prompts. No typing required.

Installation • Quick Start • Tools • Configuration • Architecture • 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

# Install globally
npm install -g @opencode-ai/voice-mcp

# Or use with npx (no install required)
npx @opencode-ai/voice-mcp

Prerequisites

<details> <summary><strong>macOS</strong></summary>

# Install recording tool
brew install sox

# Install transcription engine
pip install faster-whisper

</details>

<details> <summary><strong>Linux (Ubuntu/Debian)</strong></summary>

# Install recording tool
sudo apt install sox

# Install transcription engine
pip install faster-whisper

</details>

<details> <summary><strong>Windows</strong></summary>

# 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):

{
  "mcp": {
    "voice": {
      "command": "npx",
      "args": ["-y", "@opencode-ai/voice-mcp"]
    }
  }
}

Claude Desktop / Cursor (use mcpServers key):

{
  "mcpServers": {
    "voice": {
      "command": "npx",
      "args": ["-y", "@opencode-ai/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.

{
  "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.

{
  "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.

{
  "name": "voice_status",
  "arguments": {}
}

Returns:

{
  "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

# 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 file for details.

🙏 Acknowledgments


<div align="center">

Built with ❤️ for the developer community

Report Bug • Request Feature • Discussions

</div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选