README.mdโข9.26 kB
# ๐๏ธ Voice Code Assistant for SCS-MCP
A hands-free voice-enabled AI pair programmer that integrates with your SCS-MCP tools and VS Code, allowing natural voice conversations while you code.
## โจ Features
- **๐ค Hands-free Operation**: Wake word detection ("Hey Assistant") or push-to-talk
- **๐ Continuous Mode**: Always listening for uninterrupted workflow
- **๐ฃ๏ธ Natural Voice Synthesis**: ElevenLabs integration for human-like responses
- **๐ Visual Feedback**: Real-time waveforms and status indicators
- **๐ง Context-Aware**: Tracks your current file, symbol, and selection
- **๐ Quick Actions**: One-click access to common tasks
- **๐ฌ Conversation History**: Full transcript with export capability
- **๐ VS Code Integration**: Seamless editor context sharing
## ๐ ๏ธ Prerequisites
- Node.js 16+ installed
- SCS-MCP system set up and running
- ElevenLabs API key (free tier sufficient)
- VS Code (for editor integration)
- Chrome/Edge browser (for speech recognition)
## ๐ฆ Installation
### 1. Clone and Setup
```bash
# Navigate to SCS-MCP directory
cd /path/to/SCS-MCP
# Install voice assistant dependencies
cd voice-assistant
npm install
# Create environment file
cp .env.example .env
# Edit .env with your API keys
```
### 2. Environment Configuration
Create `.env` file:
```env
# Required
ELEVEN_LABS_API_KEY=your_elevenlabs_api_key_here
PROJECT_ROOT=/path/to/your/current/project
# Optional (if not using Claude Desktop)
ANTHROPIC_API_KEY=your_anthropic_key
ANTHROPIC_MODEL=claude-3-opus-20240229
# Server ports (optional, defaults shown)
PORT=3000
WS_PORT=3001
```
### 3. VS Code Extension Setup
```bash
# Install VS Code extension
cd vscode-extension
npm install
npm run compile
npm run package
# Install in VS Code
code --install-extension voice-code-assistant-1.0.0.vsix
```
Or install directly from VS Code:
1. Open Command Palette (`Ctrl+Shift+P`)
2. Run "Extensions: Install from VSIX..."
3. Select `vscode-extension/voice-code-assistant-1.0.0.vsix`
## ๐ Quick Start
### 1. Start the Voice Assistant Server
```bash
cd voice-assistant
npm start
```
You should see:
```
Initializing SCS-MCP client...
โ
SCS-MCP connected
Initializing ElevenLabs MCP client...
โ
ElevenLabs MCP connected
Voice Assistant Server running on http://localhost:3000
WebSocket server running on ws://localhost:3001
```
### 2. Open the Web UI
Open your browser and navigate to:
```
http://localhost:3000
```
### 3. Connect VS Code
The VS Code extension auto-connects on startup. Check the status bar for:
- ๐ Voice Connected (green) - Connected
- ๐ Voice Disconnected (gray) - Not connected
Click the status to toggle connection.
## ๐ฏ Usage
### Voice Commands
#### Push-to-Talk Mode (Default)
1. Click the microphone button or press `Ctrl+Shift+V`
2. Speak your command
3. Release to process
#### Continuous Mode
1. Click "Continuous" mode button
2. Assistant listens constantly
3. All speech is processed immediately
#### Wake Word Mode
1. Click "Wake Word" mode button
2. Say "Hey Assistant" followed by your command
3. Only processes speech after wake word
### Example Commands
```yaml
"Review this code"
"Explain what this function does"
"Find similar patterns in the codebase"
"Generate tests for this class"
"What technical debt exists here?"
"Show me the import dependencies"
"What model are you using?"
"How much would this operation cost?"
```
### Quick Actions
Click any quick action button for instant analysis:
- ๐ **Review Code**: Instant code review
- ๐ก **Explain This**: Symbol explanation
- ๐ **Find Similar**: Pattern matching
- ๐งช **Generate Tests**: Test creation
- ๐๏ธ **Tech Debt**: Debt analysis
- ๐ค **Model Info**: Current capabilities
### VS Code Commands
| Command | Shortcut | Description |
|---------|----------|-------------|
| Toggle Connection | `Ctrl+Shift+V` | Connect/disconnect voice assistant |
| Ask Question | `Ctrl+Shift+A` | Type a question |
| Review Current | - | Review current selection |
| Find Similar | - | Find similar code |
| Explain This | - | Explain current symbol |
## ๐จ Customization
### Voice Models
Choose from 6 ElevenLabs voices in Settings:
- **Rachel**: Natural, friendly developer
- **Domi**: Young, enthusiastic
- **Bella**: Soft, patient teacher
- **Antoni**: Professional expert
- **Elli**: Casual, relaxed
- **Josh**: Deep, authoritative
### Response Styles
Configure in Settings:
- **Concise**: Brief, to-the-point responses
- **Detailed**: Comprehensive explanations with examples
- **Teaching**: Educational style with step-by-step guidance
### Wake Word
Change the wake word in Settings (default: "hey assistant")
## ๐ง Configuration
### VS Code Settings
Access via `Preferences > Settings > Voice Code Assistant`:
```json
{
"voiceAssistant.serverUrl": "ws://localhost:3001",
"voiceAssistant.autoConnect": true,
"voiceAssistant.wakeWord": "hey assistant",
"voiceAssistant.voiceModel": "rachel"
}
```
### Server Configuration
Edit `voice-assistant-server.js` for advanced settings:
```javascript
// Adjust intent patterns
const intents = [
{
patterns: ['review', 'check', 'analyze'],
tool: 'instant_review'
}
// Add custom patterns
];
// Modify voice parameters
const voiceSettings = {
model_id: 'eleven_turbo_v2',
stability: 0.5,
similarity_boost: 0.5
};
```
## ๐ Architecture
```
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ Web Browser โโโโโโถโ Voice Server โโโโโโถโ SCS-MCP โ
โ (Web UI) โโโโโโโ (Node.js) โโโโโโโ Tools โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ โฒ
โ โ
โผ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ VS Code โโโโโโถโ ElevenLabs โ
โ Extension โ โ MCP โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
```
## ๐ Troubleshooting
### Voice Recognition Not Working
- Ensure using Chrome/Edge browser
- Check microphone permissions
- Verify HTTPS or localhost access
### No Voice Output
- Check ElevenLabs API key in `.env`
- Verify "Auto-play Responses" is enabled
- Check browser audio permissions
### VS Code Not Connecting
- Restart VS Code after installing extension
- Check WebSocket port 3001 is not blocked
- Verify extension is activated (check Output panel)
### SCS-MCP Tools Not Working
- Ensure SCS-MCP is properly initialized
- Check database at `.claude-symbols/search.db`
- Verify project is indexed
## ๐ Performance Tips
1. **For Best Recognition**:
- Use a quality microphone
- Minimize background noise
- Speak clearly and naturally
2. **For Fastest Response**:
- Keep SCS-MCP cache warm
- Use continuous mode for ongoing work
- Pre-index your project
3. **For Cost Efficiency**:
- ElevenLabs free tier: 10,000 chars/month
- Use concise response style
- Disable auto-play for long sessions
## ๐ฏ Perfect For
- **Long coding sessions** - Hands stay on keyboard
- **Code reviews** - Instant voice-triggered analysis
- **Learning** - Ask questions naturally while coding
- **Debugging** - "What's wrong with this function?"
- **Documentation** - "Explain this to a junior developer"
## ๐ Advanced Features
### Custom Intents
Add domain-specific commands in `voice-assistant-server.js`:
```javascript
{
patterns: ['security', 'vulnerability', 'safe'],
tool: 'security_analyzer',
extractArgs: (text, ctx) => ({
code: ctx.selectedCode,
level: 'strict'
})
}
```
### Proactive Assistance
Enable proactive suggestions:
```javascript
// Monitor code changes
onCodeChange: async (change) => {
if (detectPotentialIssue(change)) {
speak("I noticed a potential issue. Would you like me to explain?");
}
}
```
### Multi-Language Support
Configure language in speech recognition:
```javascript
recognition.lang = 'en-US'; // Change to your language
// es-ES, fr-FR, de-DE, ja-JP, etc.
```
## ๐ค Contributing
Contributions welcome! Areas for improvement:
- Additional voice commands
- More language support
- Enhanced context awareness
- Custom voice training
- Integration with other IDEs
## ๐ License
MIT License - Use freely in your projects
## ๐ Acknowledgments
- Built on [SCS-MCP](https://github.com/scs-mcp/scs-mcp)
- Voice synthesis by [ElevenLabs](https://elevenlabs.io)
- Speech recognition via Web Speech API
- Icons from Unicode Emoji
---
**Note**: This is a companion tool for SCS-MCP. Ensure SCS-MCP is properly configured and running before using the voice assistant.
For issues or questions, please refer to the main SCS-MCP documentation or create an issue in the repository.