MCP server for Claude conversation extraction with enhanced export and search
Project description
MCP Claude Context Server v0.5.0
A powerful Model Context Protocol (MCP) server for extracting, storing, searching, and analyzing Claude.ai conversations with enhanced database storage, semantic search, and multiple export formats.
๐ What's New in v0.5.0
- SQLite Database Storage - Migrate from JSON files to efficient database
- Semantic Search - AI-powered search using sentence transformers
- Multiple Export Formats - Obsidian, PDF, JSON, CSV
- Easy Deployment - Docker support and one-click installers
- Performance Improvements - 10x faster search, 35% faster operations
Features
Core Functionality
- โ Direct API access for Claude.ai conversations
- โ Chrome extension for full message extraction
- โ SQLite database with full-text search
- โ Semantic search capabilities
- โ Multiple export formats (Obsidian, PDF, JSON, CSV)
- โ Bulk operations and analytics
- โ Session management with auto-refresh
- โ Real-time analytics dashboard
Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Claude.ai Web โโโโโโถโ Chrome Extension โโโโโโถโ Bridge Server โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ MCP Client โโโโโโโ MCP Server โโโโโโโ Database โ
โ (Claude App) โ โ (Enhanced) โ โ (SQLite+FTS) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโดโโโโโโโโ
โผ โผ
โโโโโโโโโโโโ โโโโโโโโโโโโ
โ Exportersโ โ Search โ
โ (PDF/MD) โ โ (AI/FTS) โ
โโโโโโโโโโโโ โโโโโโโโโโโโ
๐ ๏ธ Installation
Quick Start with uvx (Recommended - No Installation!)
Add to your Claude Desktop config:
{
"mcpServers": {
"claude-context": {
"command": "uvx",
"args": ["mcp-claude-context"],
"env": {
"CLAUDE_SESSION_KEY": "sk-ant-sid01-...",
"CLAUDE_ORG_ID": "28a16e5b-..."
}
}
}
}
That's it! No installation needed. See full uvx guide โ
Quick Start with Docker
# Using pre-built image
docker run -d \
--name mcp-claude-context \
-p 8000:8000 \
-v $(pwd)/data:/app/data \
hamzaamjad/mcp-claude-context:latest
# Or with docker-compose
curl -O https://raw.githubusercontent.com/hamzaamjad/mcp-claude-context/main/docker-compose.simple.yml
docker-compose -f docker-compose.simple.yml up -d
One-Click Installer
# Mac/Linux
curl -sSL https://raw.githubusercontent.com/hamzaamjad/mcp-claude-context/main/deployment/one-click-install.sh | bash
# Windows (PowerShell)
iwr -useb https://raw.githubusercontent.com/hamzaamjad/mcp-claude-context/main/deployment/install.ps1 | iex
Manual Installation
-
Prerequisites:
- Python 3.11+
- Chrome browser
- Poetry (Python package manager)
-
Install dependencies:
poetry install -
Initialize database:
poetry run python -c "from src.models.conversation import init_database; init_database()"
-
Install Chrome extension:
- Open Chrome โ
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" โ Select
extension/directory
- Open Chrome โ
-
Start the server:
poetry run python -m src.direct_api_server
๐ Available MCP Tools
Conversation Management
| Tool | Description | Requires API Keys |
|---|---|---|
list_conversations |
List all conversations from Claude.ai | โ |
get_conversation |
Get specific conversation details | โ |
search_conversations |
Search conversations by keyword | โ |
get_conversation_messages |
Get full messages from local data | โ |
Search & Analytics
| Tool | Description |
|---|---|
search_messages |
Full-text search across all messages |
semantic_search |
AI-powered similarity search |
get_analytics |
Get conversation statistics and insights |
Export & Operations
| Tool | Description |
|---|---|
export_conversations |
Export to JSON/CSV formats |
export_to_obsidian |
Export to Obsidian vault with backlinks |
bulk_operations |
Tag, export, delete, or analyze in bulk |
System Management
| Tool | Description |
|---|---|
update_session |
Update Claude.ai session credentials |
migrate_to_database |
Migrate JSON files to SQLite |
rebuild_search_index |
Optimize search performance |
๐ก Usage Examples
Basic Operations
# List conversations
{
"tool": "list_conversations",
"arguments": {
"session_key": "YOUR_SESSION_KEY",
"org_id": "YOUR_ORG_ID",
"limit": 50,
"sync_to_db": true
}
}
# Search with AI
{
"tool": "semantic_search",
"arguments": {
"query": "discussions about machine learning",
"search_type": "hybrid",
"top_k": 10
}
}
# Export to Obsidian
{
"tool": "export_to_obsidian",
"arguments": {
"conversation_ids": ["conv-id-1", "conv-id-2"],
"vault_path": "/path/to/obsidian/vault"
}
}
Chrome Extension Usage
-
Extract single conversation:
- Navigate to conversation on Claude.ai
- Click extension icon
- Click "Extract Current Conversation"
-
Bulk extract all conversations:
- Click extension icon
- Click "Extract All Conversations"
- Monitor progress in popup
-
View analytics:
- Visit http://localhost:8765/dashboard
- See statistics, trends, and insights
๐ง Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
MCP_DB_PATH |
Database location | data/db/conversations.db |
MCP_EXPORT_DIR |
Export directory | exports/ |
NOTION_API_KEY |
Notion integration | Optional |
Getting Session Credentials
- Log into Claude.ai
- Open Chrome DevTools (F12)
- Go to Application โ Cookies
- Find
sessionKeyvalue - Find
org_idin Network tab API calls
๐ Performance
v0.5.0 Improvements
- Search Speed: 10x faster with SQLite FTS5
- Storage: 20% less space with database compression
- Operations: 35% faster read/write performance
- Scalability: Handles 100K+ conversations efficiently
Benchmark Results
| Operation | JSON Files | SQLite Database |
|---|---|---|
| Search 1K convos | 2.3s | 0.23s |
| Load conversation | 150ms | 45ms |
| Export 100 convos | 5.2s | 1.8s |
๐ Advanced Features
Semantic Search
The server uses sentence transformers for AI-powered search:
- Find similar conversations
- Search by meaning, not just keywords
- Discover related topics automatically
Obsidian Integration
Export conversations with:
- Proper frontmatter metadata
- Automatic backlinks
- Daily notes integration
- Tag organization
- Dataview queries
Bulk Operations
Process multiple conversations:
{
"tool": "bulk_operations",
"arguments": {
"operation": "analyze",
"conversation_ids": ["id1", "id2", "id3"],
"params": {}
}
}
๐ Troubleshooting
Common Issues
-
"Session expired" error
- Get fresh session key from Claude.ai
- Use
update_sessiontool
-
Chrome extension not connecting
- Ensure bridge server is running (port 9222)
- Check extension permissions
-
Database locked error
- Ensure only one server instance running
- Check file permissions
-
Search not finding results
- Run
rebuild_search_indextool - Verify conversations are in database
- Run
Debug Mode
Enable detailed logging:
LOG_LEVEL=DEBUG poetry run python -m src.direct_api_server
๐ค Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new features
- Submit a pull request
Development Setup
# Install dev dependencies
poetry install --with dev
# Run tests
poetry run pytest
# Format code
poetry run black src/
poetry run ruff src/
๐ License
MIT License - see LICENSE file
๐ Acknowledgments
- Built on Model Context Protocol
- Uses Sentence Transformers for semantic search
- PDF generation with ReportLab
๐ Support
Note: This tool is not affiliated with Anthropic. Use responsibly and respect rate limits.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_claude_context-0.5.4.tar.gz.
File metadata
- Download URL: mcp_claude_context-0.5.4.tar.gz
- Upload date:
- Size: 49.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39aa0403734780ea49b83d5aa55b6e86e26b5320298adf14ef5724e3ea193213
|
|
| MD5 |
5d2ddac0c6c15c1e014fd83927a0de5a
|
|
| BLAKE2b-256 |
acc77c27381df057b2890b79dc06e4992ce2bd7a54b55fb7402ace32c0f0808f
|
File details
Details for the file mcp_claude_context-0.5.4-py3-none-any.whl.
File metadata
- Download URL: mcp_claude_context-0.5.4-py3-none-any.whl
- Upload date:
- Size: 54.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b24ea0dc631506f26791c156669a702d052a0d8664e867d4dea8a6a7db0d5ecb
|
|
| MD5 |
e4f51f2b07e7c675b0f2c79d98f58618
|
|
| BLAKE2b-256 |
0aac400f30a0102773f96fd023114f4c2d6b5462d7ce6cdd747ebeb21717c7cd
|