Skip to main content
Glama
Multimodal MCP
by vsiwach
README.md
# Multimodal MCP - Personal Resume AI Agent

A personalized AI agent that reads your resume and provides intelligent responses about your professional background through a standardized MCP (Model Context Protocol) server interface. Built with RAG (Retrieval-Augmented Generation) capabilities and multimodal voice support.

## Features

- **Resume Processing**: Automatically reads and processes resume files (PDF, DOCX, TXT, MD)
- **RAG System**: Uses ChromaDB and sentence transformers for intelligent content retrieval
- **MCP Server**: Exposes functionality through standardized MCP protocol
- **Skill Matching**: Analyzes how well your skills match job requirements
- **Natural Language Interface**: Ask questions about your experience, skills, education, etc.
- **🎀 Voice Support**: Web UI with voice input/output using OpenAI Whisper & TTS
- **🌐 Web Interface**: Clean, Google-like UI with conversational history
- **☁️ AWS Deployment**: Production-ready deployment with HTTPS on custom domain

## Quick Start

### Option 1: Web UI with Voice Support (Recommended)

1. **Install Dependencies**
   ```bash
   pip install -r requirements.txt
   ```

2. **Set OpenAI API Key** (for voice features)
   ```bash
   export OPENAI_API_KEY="sk-your-api-key-here"
   ```

3. **Add Your Resume**
   ```bash
   cp your-resume.pdf data/
   ```

4. **Start Web Server**
   ```bash
   cd src
   python mcp_resume_server_web.py
   ```

5. **Open Browser**: Navigate to `http://localhost:8000`

πŸ“– See [QUICKSTART_WEB_UI.md](QUICKSTART_WEB_UI.md) for detailed instructions.

### Option 2: MCP Server (Claude Desktop)

1. **Install Dependencies**
   ```bash
   pip install -r requirements.txt
   ```

2. **Add Your Resume**
   ```bash
   cp your-resume.pdf data/
   ```

3. **Run as MCP Server**
   ```bash
   cd src
   python mcp_resume_server.py
   ```

### Option 3: AWS Cloud Deployment

Deploy to AWS with HTTPS and custom domain:

```bash
cd deploy
./deploy.sh
```

πŸ“– See [DEPLOYMENT.md](DEPLOYMENT.md) for complete AWS deployment guide.

## Architecture

### Deployment Options

This system supports three deployment modes:

#### 1. Local MCP Server (Claude Desktop)
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Claude Desktop   β”‚
β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ stdio (JSON-RPC)
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ MCP Server       │────▢│  Resume Agent   │────▢│   RAG System     β”‚
β”‚ (stdio)          β”‚     β”‚                 β”‚     β”‚  (ChromaDB +     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚  Transformers)   β”‚
                                                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                           β”‚
                                                           β–Ό
                                                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                                  β”‚  Resume Files    β”‚
                                                  β”‚  (PDF/DOCX/TXT)  β”‚
                                                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

#### 2. AWS Cloud Deployment with HTTPS
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Claude Desktop   β”‚
β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ stdio
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ HTTP Wrapper     β”‚
│ (stdio→HTTP)     │
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ HTTPS
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Route 53         │────▢│ ACM Certificate β”‚     β”‚                  β”‚
β”‚ (vsiwach.live)   β”‚     β”‚ (SSL/TLS)       β”‚     β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚                  β”‚
         β”‚                        β”‚               β”‚                  β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚                  β”‚
                     β–Ό                            β”‚                  β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚  AWS VPC         β”‚
         β”‚ Application LB      β”‚                 β”‚                  β”‚
         β”‚ (HTTPS:443)         β”‚                 β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β”‚  β”‚ ECS Fargate  β”‚β”‚
                    β”‚                            β”‚  β”‚              β”‚β”‚
                    β–Ό                            β”‚  β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”‚  β”‚ β”‚Container β”‚ β”‚β”‚
         β”‚ Target Group        β”‚                β”‚  β”‚ β”‚          β”‚ β”‚β”‚
         β”‚ (Health: /health)   β”‚                β”‚  β”‚ β”‚ MCP HTTP β”‚ β”‚β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚  β”‚ β”‚ Server   β”‚ β”‚β”‚
                    β”‚                            β”‚  β”‚ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β”‚β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”˜       β”‚β”‚
                                                 β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
                                                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

#### 3. Web UI with Voice Support
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Web Browser    β”‚
β”‚                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ 🎀 Voice   β”‚  β”‚
β”‚  β”‚ πŸ”Š Audio   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ HTTP/HTTPS
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Web UI Server    │────▢│  Audio Wrapper  │────▢│  OpenAI API      β”‚
β”‚ (FastAPI)        β”‚     β”‚                 β”‚     β”‚  β€’ Whisper (STT) β”‚
β”‚ β€’ Text Chat      β”‚     β”‚                 β”‚     β”‚  β€’ TTS (Voice)   β”‚
β”‚ β€’ Voice Input    β”‚     β”‚                 β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β€’ Audio Output   β”‚     β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Resume Agent    │────▢│   RAG System    │────▢│  Resume Files    β”‚
β”‚                  β”‚     β”‚  (ChromaDB +    β”‚     β”‚  (PDF/DOCX/TXT)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚  Transformers)  β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### Core Components

- **Resume RAG System**: ChromaDB + Sentence Transformers for semantic search
- **Personal Resume Agent**: Query processing and response generation
- **MCP Servers**: stdio (local), HTTP (AWS), Web UI (browser)
- **Audio Wrapper**: OpenAI Whisper (STT) + TTS for voice features
- **HTTP Wrapper**: Bridges stdio protocol to HTTP for remote deployment
- **AWS Infrastructure**: ECS Fargate + ALB + ACM for production deployment

## Project Structure

```
multimodal-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ resume_rag.py              # RAG system for resume processing
β”‚   β”œβ”€β”€ personal_resume_agent.py   # Main agent logic
β”‚   β”œβ”€β”€ audio_wrapper.py           # OpenAI STT/TTS integration
β”‚   β”œβ”€β”€ mcp_resume_server.py       # MCP server (stdio)
β”‚   β”œβ”€β”€ mcp_resume_server_http.py  # MCP server (HTTP/AWS)
β”‚   β”œβ”€β”€ mcp_resume_server_web.py   # Web UI server with voice
β”‚   └── static/                    # Web UI files
β”‚       β”œβ”€β”€ index.html             # Google-like UI
β”‚       β”œβ”€β”€ style.css              # Styling
β”‚       └── app.js                 # Frontend logic
β”œβ”€β”€ data/                          # Resume files + vector DB
β”œβ”€β”€ deploy/                        # AWS deployment scripts
β”‚   β”œβ”€β”€ deploy.sh                  # Automated deployment
β”‚   └── cloudformation-template.yaml  # Infrastructure as code
β”œβ”€β”€ tests/                         # Test suite
β”œβ”€β”€ examples/                      # Usage examples
β”œβ”€β”€ requirements.txt               # Local dependencies
β”œβ”€β”€ requirements-aws.txt           # AWS optimized dependencies
└── mcp_http_wrapper.py            # Stdio-to-HTTP bridge
```

## Usage Examples

### Direct Agent Usage

```python
from personal_resume_agent import PersonalResumeAgent

agent = PersonalResumeAgent()
await agent.initialize()

# Ask questions about your resume
result = await agent.process_query("What programming languages do I know?")
print(result['response'])

# Analyze skill match for a job
match = await agent.get_skill_match("Python, React, AWS, Docker")
print(f"Match: {match['match_percentage']}%")
```

### MCP Server Tools

The MCP server exposes these tools:

- `query_resume`: Ask questions about resume content
- `get_agent_info`: Get agent capabilities and status
- `analyze_skill_match`: Compare skills with job requirements
- `get_resume_summary`: Get overview of resume knowledge base

## Configuration

### Claude Desktop Integration

Add to your Claude Desktop config (`claude_desktop_config.json`):

**Local Mode:**
```json
{
  "mcpServers": {
    "personal-resume": {
      "command": "python",
      "args": ["/path/to/multimodal-mcp/src/mcp_resume_server.py"],
      "cwd": "/path/to/multimodal-mcp"
    }
  }
}
```

**Remote AWS Mode:**
```json
{
  "mcpServers": {
    "personal-resume": {
      "command": "python",
      "args": ["/path/to/multimodal-mcp/mcp_http_wrapper.py"]
    }
  }
}
```

## Supported File Formats

- **PDF**: Extracted using PyPDF2
- **DOCX**: Processed with python-docx
- **TXT/MD**: Plain text files

## Requirements

- Python 3.8+
- ChromaDB for vector storage
- Sentence Transformers for embeddings
- PyPDF2 for PDF processing
- python-docx for Word documents
- OpenAI API key (for voice features)

## Privacy & Security

πŸ”’ **Important Privacy Notes:**

- All resume data is processed **locally** on your machine or in your AWS account
- No personal information is sent to external services (except OpenAI for voice features)
- Vector database is stored locally in `data/resume_vectordb/`
- The `data/` directory is excluded from version control
- Never commit personal resume files or API keys to public repositories

## Deployment

### Docker Image Optimization

The Docker image has been optimized from 4.34GB to 587MB (86% reduction) by:
- Using CPU-only PyTorch instead of GPU version
- Removing unnecessary CUDA dependencies
- Multi-stage build process

### AWS Infrastructure

Complete infrastructure deployed via CloudFormation:
- **ECS Fargate**: Serverless container orchestration
- **Application Load Balancer**: HTTPS termination and routing
- **ACM Certificate**: Automatic SSL/TLS for custom domain
- **CloudWatch**: Logging and monitoring
- **ECR**: Docker image registry

Estimated cost: ~$50/month

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request

See [CONTRIBUTING.md](CONTRIBUTING.md) for details.

## License

MIT License - See LICENSE file for details.

## Documentation

- [Deployment Guide](DEPLOYMENT.md) - Complete AWS deployment instructions
- [Web UI Guide](WEB_UI_GUIDE.md) - Web interface and voice features
- [Quick Start](QUICKSTART_WEB_UI.md) - Get started in 5 minutes
- [Domain Setup](DOMAIN_SETUP.md) - Custom domain configuration
- [Implementation Summary](IMPLEMENTATION_SUMMARY.md) - Technical details

## Live Demo

🌐 **Production Instance**: https://vsiwach.live (with HTTPS and voice support)

---

Built with ❀️ using MCP, ChromaDB, FastAPI, and OpenAI