Building from Source
Complete guide to building an IETF vCon-compliant MCP Server from scratch
📋 Table of Contents
Prerequisites
Required Knowledge
✅ TypeScript/JavaScript programming
✅ Node.js and npm/yarn
✅ PostgreSQL basics
✅ REST APIs and JSON
✅ Git version control
Required Software
✅ Node.js 18.x or higher (Download)
✅ npm or yarn package manager
✅ Git (Download)
✅ Code editor (VS Code recommended)
✅ Supabase account (Sign up)
Time Estimate
Total: 4-6 hours for first-time implementation
Experienced developers: 2-3 hours
Project Overview
What We're Building
An MCP (Model Context Protocol) Server that:
Stores and manages IETF vCon (Virtual Conversation) data
Provides tools for AI assistants to interact with vCons
Ensures full compliance with
draft-ietf-vcon-vcon-core-00Uses Supabase (PostgreSQL) as the database backend
Key Features
✅ Create, read, update, delete vCons
✅ Add dialog, analysis, and attachments
✅ Search and query vCon data
✅ Privacy and consent management
✅ Spec-compliant data validation
✅ MCP tools for AI integration
Architecture
Phase 1: Environment Setup
Step 1.1: Create Project Directory
Step 1.2: Initialize Node.js Project
Step 1.3: Install Dependencies
What each package does:
@modelcontextprotocol/sdk- MCP server framework@supabase/supabase-js- Supabase client libraryzod- Schema validation librarytypescript- TypeScript compilertsx- TypeScript execution for developmentvitest- Testing framework
Step 1.4: Configure TypeScript
Create tsconfig.json:
Step 1.5: Update package.json Scripts
Add these scripts to your package.json:
Step 1.6: Create .env.example
Create .env.example:
Step 1.7: Create .gitignore
Create .gitignore:
✅ Phase 1 Checkpoint
Verify your setup:
Phase 2: Database Setup
Step 2.1: Create Supabase Project
Go to supabase.com
Click "New Project"
Fill in:
Name: vcon-mcp-server
Database Password: (Generate strong password)
Region: (Choose closest to you)
Click "Create new project"
Wait 2-3 minutes for provisioning
Step 2.2: Get Supabase Credentials
Go to Project Settings → API
Copy:
Project URL → SUPABASE_URL
anon/public key → SUPABASE_ANON_KEY
Create .env file:
Step 2.3: Run Database Schema
Go to SQL Editor in Supabase dashboard
Copy the entire schema from
CORRECTED_SCHEMA.mdPaste into SQL Editor
Click "Run" to execute
Key tables created:
vcons- Main vCon recordsparties- Conversation participantsdialog- Conversation content (recordings, text, etc.)analysis- AI/ML analysis resultsattachments- File attachmentsparty_history- Party event timeline
Step 2.4: Verify Database Schema
Run these verification queries in SQL Editor:
Expected results:
✅ 8+ tables created
✅
analysis.schemaexists (NOTschema_version)✅
analysis.vendoris NOT NULL✅
analysis.bodyis TEXT type✅ No DEFAULT values on encoding fields
✅ Dialog type constraint exists
Step 2.5: Set Up Row Level Security (Optional)
For multi-tenant applications, enable RLS:
✅ Phase 2 Checkpoint
Verify database setup:
Phase 3: Project Structure
Step 3.1: Create Directory Structure
Step 3.2: Verify Structure
Your project should now look like this:
✅ Phase 3 Checkpoint
Phase 4: Core Implementation
Step 4.1: Create vCon Types
Create src/types/vcon.ts:
💡 Key Points:
✅ Uses
schemanotschema_versionin Analysis✅
vendoris required (no?) in Analysis✅
bodyisstringtype (notobject)✅ Includes
uuidfield in Party✅ Includes new fields:
session_id,application,message_id
Step 4.2: Create Database Client
Create src/db/client.ts:
Step 4.3: Create Database Queries
Create src/db/queries.ts:
Step 4.4: Create Validation Utilities
Create src/utils/validation.ts:
✅ Phase 4 Checkpoint
Verify your implementation:
Phase 5: MCP Server
Step 5.1: Create MCP Tool Definitions
Create src/tools/vcon-crud.ts:
Step 5.2: Create MCP Server
Create src/index.ts:
Step 5.3: Test the Server
✅ Phase 5 Checkpoint
The server should:
✅ Start without errors
✅ List 4 tools (create, add_analysis, get, search)
✅ Accept tool calls
✅ Return proper responses
Phase 6: Testing & Validation
Step 6.1: Create Compliance Tests
Create tests/vcon-compliance.test.ts:
Step 6.2: Run Tests
Step 6.3: Verify No Incorrect Field Names
✅ Phase 6 Checkpoint
All tests should pass:
✅ No
schema_versionin codebase✅
vendoris required in Analysis type✅
bodyaccepts string values✅ All validation tests pass
Phase 7: Deployment
Step 7.1: Build for Production
Step 7.2: Configure MCP Client
Add to your MCP client configuration (e.g., Claude Desktop):
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json
Step 7.3: Test with AI Assistant
Restart your AI assistant and try:
✅ Phase 7 Checkpoint
The AI should:
✅ See the vCon tools
✅ Successfully create vCons
✅ Add analysis with correct field names
✅ Retrieve and search vCons
Troubleshooting
Issue: TypeScript Compilation Errors
Symptom: Errors about missing types or incorrect field names
Solution:
Issue: Database Connection Fails
Symptom: "Missing Supabase credentials" error
Solution:
Issue: "schema_version does not exist" Error
Symptom: Database error about unknown column
Solution:
If incorrect, re-run the corrected schema from CORRECTED_SCHEMA.md.
Issue: Vendor Validation Fails
Symptom: "vendor is required" error
Solution:
✅ Always include
vendorin analysis objects✅ Check that Analysis type doesn't have
vendor?(with question mark)✅ Verify tool schema marks vendor as required
Issue: MCP Server Doesn't Start
Symptom: Server crashes on startup
Solution:
Next Steps
Enhancements to Consider
Add More Tools
Update vCon
Delete vCon
Add dialog
Add attachments
Export vCon to JWS/JWE
Add Resources
vcon://v1/vconsURI schemeList recent vCons
vCon templates
Add Prompts
Summarize conversation
Extract action items
Compliance check
Advanced Features
Privacy redaction
Consent management
Group vCons
Digital signatures (JWS)
Encryption (JWE)
Performance
Caching layer
Batch operations
Pagination
Indexes optimization
Security
Row Level Security
API rate limiting
Input sanitization
Audit logging
Learning Resources
IETF vCon Spec:
background_docs/draft-ietf-vcon-vcon-core-00.txtMCP Documentation: https://modelcontextprotocol.io/
Supabase Docs: https://supabase.com/docs
Implementation Guide:
CLAUDE_CODE_INSTRUCTIONS.mdQuick Reference:
QUICK_REFERENCE.md
Community & Support
vCon Working Group: https://datatracker.ietf.org/wg/vcon/
MCP Discord: https://discord.gg/modelcontextprotocol
Issues: File bugs/questions in your repo issues
Appendix: Command Reference
Development Commands
Git Commands
Database Commands
Success Checklist
Your implementation is complete when:
🎉 Congratulations! You've built a fully spec-compliant IETF vCon MCP Server!
Last Updated: October 7, 2025 Spec Version: draft-ietf-vcon-vcon-core-00 vCon Schema: 0.3.0
Last updated