# MyAIGist MCP Server
Local MCP server for Claude Desktop providing document intelligence and knowledge management. Process documents, answer questions with RAG, and transcribe media - all running locally with zero infrastructure costs.
## Overview
**MyAIGist MCP** provides 11 powerful tools for document intelligence and knowledge management:
- **Document Processing**: PDF, DOCX, TXT, URLs, and batch processing
- **Media Transcription**: Audio and video transcription with Whisper
- **Q&A System**: RAG-powered question answering with voice support
- **Knowledge Management**: Persistent vector storage with document tracking
## Features
✅ **Core document intelligence** - Process, summarize, and search documents
✅ **Local execution** - Runs in Claude Desktop
✅ **Persistent storage** - Single vector store across sessions
✅ **Multi-document RAG** - Unlimited documents (no 5-doc limit)
✅ **Media transcription** - Whisper-powered audio/video transcription
✅ **Zero infrastructure costs** - Replaces $200-400/month AWS deployment
## Installation
### Prerequisites
- Python 3.8+
- OpenAI API key
- Claude Desktop installed
### Setup
1. **Install dependencies:**
```bash
cd /Users/mikeschwimmer/myaigist_mcp
pip install -r requirements.txt
```
2. **Configure environment:**
```bash
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY
```
3. **Configure Claude Desktop:**
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
{
"mcpServers": {
"myaigist": {
"command": "/Library/Frameworks/Python.framework/Versions/3.13/bin/python3",
"args": ["/Users/mikeschwimmer/myaigist_mcp/server.py"]
}
}
}
```
4. **Restart Claude Desktop**
The MCP server will start automatically when you open Claude Desktop.
## Architecture
```
myaigist_mcp/ # MCP server (this project)
├── server.py # Main MCP server with 11 tools
├── mcp_agents/ # All agent code (local, self-contained)
│ ├── document_processor.py # PDF/DOCX/TXT extraction
│ ├── summarizer.py # 3-level summarization
│ ├── embeddings.py # OpenAI embeddings
│ ├── url_crawler.py # Web content extraction
│ ├── openai_client.py # OpenAI client factory
│ ├── transcriber.py # Audio/video transcription
│ ├── qa_agent.py # Q&A with RAG
│ └── vector_store.py # Vector storage
├── data/ # Persistent vector storage
│ └── vector_store.pkl # Created at runtime
└── audio/ # Temporary files for Whisper transcription
```
**Architecture Notes:**
- All agents are self-contained in `mcp_agents/`
- No external dependencies on other projects
- Single-user design (no session/user isolation)
- Persistent vector storage with unlimited documents
## Available Tools (11 Total)
### Content Processing (5 tools)
#### 1. `process_document`
Process PDF, DOCX, or TXT files and add to knowledge base.
**Parameters:**
- `file_path` (string, required): Path to document file
- `title` (string, optional): Document title (defaults to filename)
- `summary_level` (string, optional): `quick`, `standard`, or `detailed`
**Example:**
```
"Process /Users/mike/contract.pdf as a detailed summary"
```
#### 2. `process_text`
Process raw text and add to knowledge base.
**Example:**
```
"Process this text: [paste long article]"
```
#### 3. `process_url`
Crawl web URL, extract content, and add to knowledge base.
**Example:**
```
"Process https://example.com/article"
```
#### 4. `process_media`
Transcribe audio or video file and add transcript to knowledge base.
**Supported formats:**
- Audio: MP3, WAV, FLAC, M4A, AAC, OGG, WMA
- Video: MP4, AVI, MOV, WMV, FLV, WebM, MKV, M4V
**Example:**
```
"Transcribe /Users/mike/meeting.mp4"
```
#### 5. `process_batch`
Process multiple files and generate unified summary.
**Example:**
```
"Process all files in /Users/mike/research/ and give me a unified summary"
```
### Q&A System (2 tools)
#### 6. `ask_question`
Ask questions about stored documents using RAG.
**Example:**
```
"What are the main findings in the research papers?"
```
#### 7. `ask_question_voice`
Transcribe voice question and answer using RAG.
**Example:**
```
"Answer the question in /Users/mike/voice_question.mp3"
```
### Document Management (3 tools)
#### 8. `list_documents`
List all documents in knowledge base with metadata.
**Example:**
```
"Show me all my documents"
```
#### 9. `delete_document`
Delete specific document by ID.
**Example:**
```
"Delete document abc123xyz"
```
#### 10. `clear_all_documents`
Clear entire knowledge base.
**Example:**
```
"Clear all my documents"
```
### Utility Tools (1 tool)
#### 11. `get_status`
Get system status and knowledge base statistics.
**Example:**
```
"What's my system status?"
```
## Common Workflows
### Single Document Q&A
```
User: "Process /Users/mike/contract.pdf"
Claude: ✅ Processed with summary
User: "What are the payment terms?"
Claude: "The payment terms are net 30..."
```
### Multi-Document Research
```
User: "Process these 3 research papers: paper1.pdf, paper2.pdf, paper3.pdf"
Claude: ✅ Processed all 3 with unified summary
User: "What are the common findings across all papers?"
Claude: "The common findings are..."
```
### Media Transcription
```
User: "Transcribe /Users/mike/meeting.mp4 and summarize it"
Claude: ✅ Transcribed and summarized
User: "What action items were discussed?"
Claude: "The action items were..."
```
## Configuration
### Environment Variables (.env)
```bash
# Required
OPENAI_API_KEY=sk-your-key-here
# Optional (with recommended defaults)
OPENAI_MODEL=gpt-4o-mini # For summarization/Q&A
OPENAI_EMBED_MODEL=text-embedding-3-large # For vector search
OPENAI_WHISPER_MODEL=whisper-1 # For transcription
```
### Model Selection
**Recommended for best quality:**
- `gpt-4o-mini` - Best balance of quality and cost
- `text-embedding-3-large` - Higher accuracy for RAG
- `whisper-1` - Current transcription model
### Storage
**Vector Store:**
- Path: `data/vector_store.pkl`
- Format: Pickle with numpy arrays
- Persistence: Survives server restarts
- Capacity: Unlimited documents
**Temporary Files:**
- Path: `audio/` directory
- Used for: Whisper transcription temporary files
- Cleanup: Automatic by system
## Cost Savings
**Before (AWS/Flask):** $200-400/month
- ECS Fargate compute
- Load balancer
- CloudWatch
- Data transfer
**After (MCP/Local):** $0/month infrastructure
- Runs locally on your machine
- Only OpenAI API costs (usage-based)
**OpenAI API Costs** (estimated monthly):
- 100 documents processed: ~$5-10
- 500 questions answered: ~$2-5
- 10 hours media transcribed: ~$4
- **Total: ~$10-20/month** (vs $200-400 AWS)
## Troubleshooting
### Server won't start
```bash
# Check if Python can find dependencies
python3 -c "import mcp; print('✅ MCP installed')"
# Check syntax
python3 -m py_compile server.py
# Check logs
tail -f ~/Library/Logs/Claude/mcp-server-myaigist.log
```
### Import errors
```bash
# Test agent imports
cd /Users/mikeschwimmer/myaigist_mcp
python3 -c "from mcp_agents.summarizer import Summarizer; print('✅ Imports work')"
python3 -c "from mcp_agents.qa_agent import QAAgent; print('✅ QAAgent works')"
```
### Empty knowledge base after restart
- Check `data/vector_store.pkl` exists
- Verify file permissions (readable/writable)
- Check for errors in server logs
## Development
### Running Tests
```bash
# Test agent imports
python3 -c "from mcp_agents.qa_agent import QAAgent; qa = QAAgent(); print('✅ QAAgent works')"
# Test document processing
cd /Users/mikeschwimmer/myaigist_mcp
python3 -c "from mcp_agents.document_processor import DocumentProcessor; dp = DocumentProcessor(); print('✅ DocumentProcessor works')"
```
### Debugging
```bash
# Check server logs
tail -f ~/Library/Logs/Claude/mcp-server-myaigist.log
# Run server manually to see output
python3 /Users/mikeschwimmer/myaigist_mcp/server.py
```
## Project Structure
```
myaigist_mcp/
├── server.py # Main MCP server (11 tools)
├── requirements.txt # Python dependencies
├── .env # Environment variables (symlinked)
├── .env.example # Template
├── README.md # This file
├── mcp_agents/ # MCP-adapted agents
│ ├── __init__.py
│ ├── transcriber.py # Modified: absolute paths
│ ├── qa_agent.py # Modified: single-user
│ └── vector_store.py # Modified: no user filtering
├── data/ # Persistent storage
│ └── vector_store.pkl # Vector embeddings and metadata
└── audio/ # Whisper temporary files
```
## Related Projects
This project is self-contained with no external dependencies beyond Python packages.
## Recent Changes
**2026-01-19:** Removed audio generation functionality
- Focused on core document intelligence features
- Removed TTS audio generation tools
- Kept Whisper transcription for media files
- Simplified from 13 to 11 tools
- See `AUDIO_REMOVAL_SUMMARY.md` for details
## License
Same as original myaigist project.
## Support
For issues or questions:
1. Check troubleshooting section above
2. Review MCP logs: `~/Library/Logs/Claude/mcp-server-myaigist.log`
3. Verify environment variables in `.env`
4. Test agent imports individually
---
**Last Updated:** 2026-01-19
**Project Status:** ✅ Complete - 11 core tools implemented and tested
**Cost Savings:** $200-400/month (AWS → $0)
**Focus:** Document intelligence without audio complexity