Skip to main content
Glama
README.md
# Theta-MCP: AI-Powered Sales Assistant

A comprehensive sales automation platform combining Model Context Protocol (MCP) server with Gemini AI voice interface, featuring 13+ integrated sales tools and AWS deployment capabilities.

## ๐Ÿš€ Features

### Core Capabilities
- **Voice Interface**: Gemini AI-powered speech-to-text and text-to-speech
- **MCP Server**: Model Context Protocol server with extensive tool integration
- **Real-time Processing**: WebSocket-based voice communication
- **AWS Deployment**: Production-ready with ECS Fargate and auto-scaling

### Integrated Sales Tools
- **CRM**: HubSpot, Salesforce integration
- **Communication**: Gmail, Google Meet, Twilio SMS
- **Lead Generation**: LinkedIn Sales Navigator, Apollo
- **Data Management**: Google Sheets, Google Drive
- **Payments**: Stripe integration
- **Scheduling**: Calendly automation
- **Search**: Google Search API

## ๐Ÿ—๏ธ Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Voice Client  โ”‚โ—„โ”€โ”€โ–บโ”‚  Gemini AI TTS   โ”‚โ—„โ”€โ”€โ–บโ”‚   MCP Server    โ”‚
โ”‚   (WebSocket)   โ”‚    โ”‚    Interface     โ”‚    โ”‚  (13+ Tools)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

## ๐Ÿ› ๏ธ Quick Start

### Local Development
```bash
# Clone repository
git clone <repository-url>
cd Theta-MCP

# Setup environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

# Configure settings
cp config/settings.example.json config/settings.json
# Add your API keys to config/settings.json

# Run locally
python ./deployment/test_local.py
```

### Production Deployment
```bash
# Setup AWS deployment
./deployment/setup_aws.sh

# Deploy to AWS ECS
./deployment/aws/deploy.sh
```

## ๐Ÿ“ Project Structure

```
Theta-MCP/
โ”œโ”€โ”€ sales_mcp_server.py          # Main MCP server
โ”œโ”€โ”€ gemini_tts_interface.py      # Voice interface with Gemini AI
โ”œโ”€โ”€ health_check.py              # Health monitoring
โ”œโ”€โ”€ refresh_google_token.py      # Token management
โ”œโ”€โ”€ config/                      # Configuration files
โ”‚   โ”œโ”€โ”€ google_auth.py          # Google authentication
โ”‚   โ”œโ”€โ”€ settings.py             # Settings loader
โ”‚   โ””โ”€โ”€ settings.example.json   # Configuration template
โ”œโ”€โ”€ tools/                       # Sales automation tools
โ”‚   โ”œโ”€โ”€ hubspot_tool.py         # HubSpot CRM integration
โ”‚   โ”œโ”€โ”€ salesforce_tool.py      # Salesforce integration
โ”‚   โ”œโ”€โ”€ gmail_tool.py           # Gmail automation
โ”‚   โ”œโ”€โ”€ linkedin_tool.py        # LinkedIn Sales Navigator
โ”‚   โ”œโ”€โ”€ apollo_tool.py          # Lead generation
โ”‚   โ”œโ”€โ”€ stripe_tool.py          # Payment processing
โ”‚   โ”œโ”€โ”€ calendly_tool.py        # Scheduling automation
โ”‚   โ””โ”€โ”€ ... (13+ tools total)
โ”œโ”€โ”€ deployment/                  # Deployment configurations
โ”‚   โ”œโ”€โ”€ aws/                    # AWS-specific files
โ”‚   โ”œโ”€โ”€ docker/                 # Docker configurations
โ”‚   โ”œโ”€โ”€ setup_aws.sh           # AWS setup script
โ”‚   โ””โ”€โ”€ test_local.py          # Local testing
โ””โ”€โ”€ tests/                      # Test suite
```

## ๐Ÿ”ง Configuration

### Required API Keys
- Google Cloud (Speech-to-Text, Text-to-Speech, Calendar, Gmail)
- Gemini AI API key
- HubSpot, Salesforce, LinkedIn, Apollo (as needed)
- AWS credentials (for deployment)

### Environment Variables
Copy `.env.example` to `.env` and configure:
```
GOOGLE_CLOUD_PROJECT=your-project
GEMINI_API_KEY=your-gemini-key
HUBSPOT_API_KEY=your-hubspot-key
# ... additional API keys
```

## ๐Ÿš€ AWS Deployment

### Infrastructure
- **ECS Fargate**: Serverless container orchestration
- **Application Load Balancer**: Traffic distribution
- **Auto Scaling**: 2-10 instances based on demand
- **EFS Storage**: Persistent token and log storage
- **Secrets Manager**: Secure API key management
- **CloudWatch**: Monitoring and logging

### Deployment Process
1. Configure AWS credentials
2. Run `./deployment/setup_aws.sh`
3. Execute `./deployment/aws/deploy.sh`
4. Access via provided ALB endpoint

## ๐Ÿงช Testing

```bash
# Run test suite
python -m pytest tests/

# Test local deployment
python ./deployment/test_local.py

# Health check
curl http://localhost:8000/health
```

## ๐Ÿ“š API Documentation

### MCP Server Endpoints
- `GET /health` - Health check
- `POST /tools/{tool_name}` - Execute tool
- `WebSocket /voice` - Voice interface

### Voice Interface
- Real-time speech-to-text processing
- Gemini AI conversation handling
- Text-to-speech response generation
- WebSocket-based communication

## ๐Ÿค Contributing

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. Open Pull Request

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

## ๐Ÿ†˜ Support

For issues and questions:
- Create an issue in this repository
- Check the deployment guide: `./deployment/README.md`
- Review test configurations: `./tests/README.md`

---

**Built with โค๏ธ using Python, FastAPI, Gemini AI, and AWS**