# 🤖 MCP AI Assistant - Jarvis Voice Integration

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Node.js Version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen)](https://nodejs.org)
[![ElevenLabs](https://img.shields.io/badge/Powered%20by-ElevenLabs-blue)](https://elevenlabs.io)
[![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-purple)](https://github.com/anthropic/mcp)

> "Good evening, sir. Jarvis is online and ready for your commands." - Your AI-powered voice assistant for Claude Code

A Model Context Protocol (MCP) server that brings the Iron Man Jarvis experience to your development workflow, with advanced text-to-speech capabilities and voice-activated commands.

## 🎥 Demo

```bash
$ source ~/.zshrc
$ wake up daddy's home
🔊 "Good evening, sir. Jarvis is online and ready for your commands."
🤖 JARVIS ACTIVATED
```

## ✨ Key Features

### 🎙️ Voice Capabilities
- **Dual Persona System**: Switch between Sarah (friendly) and Jarvis (professional) voices
- **Real-time TTS**: Instant text-to-speech conversion using ElevenLabs AI
- **Multiple Voice Options**: 5 different AI voices (Sarah, George/Jarvis, Aria, Charlie, Laura)
- **Automatic Response Reading**: Claude's responses are automatically spoken aloud
- **Voice-Activated Commands**: "Wake up, daddy's home" universal activation

### 🛠️ MCP Integration
- **Full MCP Server**: Exposes voice tools to Claude for seamless integration
- **ElevenLabs Account Management**: Handle multiple API keys and accounts
- **Voice Customization**: Control voice parameters (stability, similarity boost, style)
- **Audio File Management**: Automatic audio file generation with timestamps
- **Streaming Support**: Low-latency audio streaming for real-time applications

### 🚀 Developer Experience
- **Universal Commands**: Global shell commands work from any directory
- **Shell Integration**: Deep integration with zsh/bash profiles
- **Quick Commands**: `jarvis speak`, `jarvis mode`, `jarvis status`
- **Flexible Syntax**: Multiple wake phrase variations supported
- **TypeScript Support**: Fully typed MCP server implementation

## 📦 Installation

### Prerequisites
- macOS (for `afplay` audio playback)
- Node.js v16 or higher
- Git
- Claude Code

### Quick Start (2 minutes)

```bash
# Clone the repository
git clone https://github.com/ChinchillaEnterprises/ChillMCP.git
cd ChillMCP/mcp-Ai-assistant

# Install dependencies
npm install

# Quick setup script
node team-setup.js

# Add to your shell profile (automatic)
source ~/.zshrc
```

## 🎮 Usage

### Basic Commands

```bash
# In any Claude Code terminal:
source ~/.zshrc              # Load shell profile
wake up daddy's home         # Activate Jarvis

# Then use these commands:
jarvis speak "Hello, world!" # Make Jarvis speak
jarvis mode                  # Enter interactive voice mode
jarvis status               # Check system status
```

### Voice Personas

```bash
# Switch to Jarvis (British professional)
node claude-personas.js switch jarvis

# Switch to Sarah (Friendly assistant)
node claude-personas.js switch sarah

# Use specific voice for one command
jarvis speak "Hello" george   # British male (Jarvis)
jarvis speak "Hello" sarah    # Friendly female
jarvis speak "Hello" aria     # Professional female
```

### Advanced Usage

```javascript
// Direct Node.js usage
const { speak } = require('./speak.js');
await speak("System analysis complete, sir.", "george");

// Voice activation mode
node voice-activation.js  // Listens for "Hey Claude" or "Claude, speak"
```


## 🏗️ Architecture

```
mcp-Ai-assistant/
├── src/
│   ├── index.ts              # MCP server entry point
│   ├── tools/                # MCP tool implementations
│   │   ├── tts/             # Text-to-speech tools
│   │   ├── voice/           # Voice management tools
│   │   └── account/         # Account management
│   └── services/            # Core services
├── jarvis-voice.js          # Jarvis persona implementation
├── claude-personas.js       # Persona management system
├── speak.js                 # Core TTS functionality
├── jarvis-mode.sh          # Interactive voice mode
├── wake-up-jarvis.sh       # Universal activation script
└── voice-activation.js     # Voice command listener
```

## 🔧 Configuration

### Environment Variables

```bash
# Set your own ElevenLabs API key (optional)
export ELEVENLABS_API_KEY="your-key-here"

# Choose default voice
export CLAUDE_VOICE="jarvis"  # or sarah, aria, charlie, laura

# Set audio output directory
export AUDIO_OUTPUT_DIR="./audio"
```

### Voice Options

| Voice | ID | Description | Best For |
|-------|----|--------------|-----------|
| `sarah` | EXAVITQu4vr4xnSDxMaL | Friendly, conversational | Default assistant |
| `george` | JBFqnCBsd6RMkjVDRZzb | British, professional | Jarvis mode |
| `aria` | 9BWtsMINqrJLrRacOk9x | Clear, professional | Documentation |
| `charlie` | IKne3meq5aSn9XLyUdCD | Casual, energetic | Notifications |
| `laura` | FGY2WhTYpPnrIDTdsKH5 | Warm, supportive | Tutorials |

### MCP Configuration

Add to your Claude Code settings:

```json
{
  "mcpServers": {
    "ai-assistant": {
      "command": "node",
      "args": ["/path/to/mcp-Ai-assistant/dist/index.js"]
    }
  }
}
```

## 🧪 Development

### Building from Source

```bash
# TypeScript compilation
npm run build

# Development mode with watch
npm run dev

# Run tests
npm test

# Linting
npm run lint
```

### Adding New Voices

1. Get voice ID from ElevenLabs
2. Add to `VOICES` object in `speak.js`:
```javascript
const VOICES = {
  'mynewvoice': 'VOICE_ID_HERE',
  // ... existing voices
};
```

### Creating Custom Commands

```javascript
// Add to jarvis-voice.js
const customCommands = {
  'deploy': () => 'Initiating deployment sequence, sir.',
  'test': () => 'Running test suite now, sir.',
  'build': () => 'Compiling project assets, sir.'
};
```

## 🐛 Troubleshooting

### Common Issues

| Problem | Solution |
|---------|----------|
| "Command not found" | Run `source ~/.zshrc` first |
| No audio playing | Check volume, verify macOS, try `afplay test.mp3` |
| API errors | Check internet connection, verify API key |
| Voice not working | Update dependencies: `npm install` |
| Rate limiting | Using default key, set your own `ELEVENLABS_API_KEY` |

### Debug Mode

```bash
# Enable verbose logging
export DEBUG=mcp:*
node src/index.js

# Test specific components
node speak.js "Test message" sarah
node jarvis-voice.js "Test Jarvis mode"
```

## 🚀 Roadmap

- [ ] **Voice Recognition**: Integrate Whisper API for speech-to-text
- [ ] **Bi-directional Communication**: Full voice conversation mode
- [ ] **Custom Wake Words**: User-defined activation phrases
- [ ] **Multi-language Support**: Support for 20+ languages
- [ ] **Voice Command Macros**: Chain multiple commands
- [ ] **VS Code Extension**: Direct IDE integration
- [ ] **Mobile Companion**: iOS/Android app for remote control
- [ ] **Smart Context**: Remember conversation history
- [ ] **Emotion Detection**: Adjust tone based on context

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md).

1. Fork the repository
2. Create feature branch: `git checkout -b feature/amazing-feature`
3. Commit changes: `git commit -m 'Add amazing feature'`
4. Push to branch: `git push origin feature/amazing-feature`
5. Submit Pull Request

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments

- **[ElevenLabs](https://elevenlabs.io)** for outstanding AI voice technology
- **[Anthropic](https://anthropic.com)** for Claude and MCP framework
- **Marvel Studios** for Jarvis inspiration
- **Open Source Community** for continuous support

## 📞 Support

- **Documentation**: [Full API Docs](https://github.com/ChinchillaEnterprises/ChillMCP/wiki)
- **Issues**: [GitHub Issues](https://github.com/ChinchillaEnterprises/ChillMCP/issues)
- **Discussions**: [GitHub Discussions](https://github.com/ChinchillaEnterprises/ChillMCP/discussions)
- **Email**: support@chinchillaenterprises.com
- **Discord**: [Join our server](https://discord.gg/chinchilla)

---

<p align="center">
  <img src="https://img.shields.io/github/stars/ChinchillaEnterprises/ChillMCP?style=social" alt="GitHub stars">
  <img src="https://img.shields.io/github/forks/ChinchillaEnterprises/ChillMCP?style=social" alt="GitHub forks">
</p>

<p align="center">
  Made with ❤️ by <a href="https://github.com/ChinchillaEnterprises">Chinchilla Enterprises</a><br>
  <em>"Just like Tony Stark's Jarvis, but for developers"</em>
</p>