This directory contains example implementations and integrations for the vCon MCP Server.
File: conserver-supabase-storage.py
A production-ready storage backend for the vCon conserver that stores vCons in Supabase PostgreSQL with optional Redis caching.
- Supabase Integration: Stores vCons in Supabase PostgreSQL using the vCon schema
- Redis Caching: Optional write-through cache for fast reads
- Full CRUD Support: Create, read, update, delete, and search operations
- Error Handling: Graceful degradation when Redis is unavailable
- Type Safety: Complete vCon spec compliance with proper field mapping
# Install required packages
pip install supabase redis- Copy to conserver installation:
cp conserver-supabase-storage.py /path/to/conserver/server/storage/supabase.py- Configure in config.yml:
storages:
supabase:
module: storage.supabase
options:
url: ${SUPABASE_URL}
anon_key: ${SUPABASE_ANON_KEY}
redis_url: ${REDIS_URL} # Optional
cache_ttl: 3600
chains:
main_chain:
storages:
- supabase
# ... rest of chain config- Set environment variables:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
REDIS_URL=redis://localhost:6379 # OptionalThe storage backend implements a write-through cache pattern:
Write Path: Conserver → Supabase (permanent) → Redis (cache)
Read Path: Conserver → Redis (cache check) → Supabase (fallback)
| Option | Required | Default | Description |
|---|---|---|---|
url |
Yes | $SUPABASE_URL |
Supabase project URL |
anon_key |
Yes | $SUPABASE_ANON_KEY |
Supabase API key |
redis_url |
No | $REDIS_URL |
Redis connection URL |
cache_ttl |
No | 3600 |
Cache TTL in seconds |
Saves a vCon to Supabase and caches in Redis.
storage.save({
'uuid': 'abc-123',
'vcon': '0.3.0',
'parties': [...],
'dialog': [...]
})Retrieves a vCon by UUID (cache-first).
vcon = storage.get('abc-123')Deletes a vCon from Supabase and invalidates cache.
storage.delete('abc-123')Searches vCons by criteria.
results = storage.search({
'subject': 'support',
'start_date': '2025-01-01',
'end_date': '2025-12-31'
})The storage backend handles errors gracefully:
- Redis Unavailable: Falls back to Supabase-only mode
- Supabase Errors: Logs errors and returns None/False
- Invalid Data: Validates vCon structure before saving
The storage backend logs all operations:
✅ Connected to Supabase
✅ Redis cache enabled (TTL: 3600s)
✅ Saved vCon abc-123 to Supabase
✅ Cached vCon abc-123 in Redis
✅ Cache HIT for vCon abc-123
ℹ️ Cache MISS for vCon def-456
⚠️ Redis connection failed: Connection refused. Caching disabled.
Test the storage backend:
import os
from storage.supabase import SupabaseStorage
# Initialize
storage = SupabaseStorage({
'url': os.getenv('SUPABASE_URL'),
'anon_key': os.getenv('SUPABASE_ANON_KEY'),
'redis_url': os.getenv('REDIS_URL')
})
# Test save
vcon = {
'uuid': 'test-123',
'vcon': '0.3.0',
'created_at': '2025-10-15T12:00:00Z',
'parties': [{'name': 'Test User'}]
}
assert storage.save(vcon) == True
# Test get
retrieved = storage.get('test-123')
assert retrieved is not None
assert retrieved['uuid'] == 'test-123'
# Test delete
assert storage.delete('test-123') == True
assert storage.get('test-123') is None
print("✅ All tests passed!")File: logging-plugin.js
A simple example plugin that logs vCon operations. See the Plugin Development Guide for more details.
- Twilio Adapter: Convert Twilio call records to vCons
- Slack Adapter: Convert Slack conversations to vCons
- Webhook Handler: Receive vCons via webhooks
- Batch Processor: Process vCons in bulk
Have a useful example or integration? Submit a pull request!
- Fork the repository
- Create your example file
- Add documentation to this README
- Submit a pull request
For questions about examples:
- GitHub Issues: vcon-mcp/issues
- Documentation: Full docs
- Email: support@example.com