You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VaultAssist - Personal Google Workspace MCP Server
A Model Context Protocol (MCP) server that provides comprehensive Google Workspace integration for your personal AI assistant with vault-level security.
Built with Next.js, TypeScript, Better Auth, and Vercel's MCP SDK, this server enables natural language control over Gmail, Google Drive, Calendar, Sheets, Slides, and Tasks through secure OAuth 2.1 authentication with advanced session management and graph database integration.
Overview
VaultAssist acts as a secure bridge between AI assistants and Google Workspace services, enabling seamless automation and data access through a vault-secured, authenticated API. The server uses Better Auth for robust user session management, PostgreSQL for persistent data storage, and Graph DBs for intelligent relationship mapping across your personal data ecosystem.
VaultAssist acts as a secure bridge between AI assistants and Google Workspace services, enabling seamless automation and data access through a vault-secured, authenticated API. The server supports multiple users, with each user's data, sessions, and Google Workspace access fully isolated. Better Auth provides robust user session management, PostgreSQL ensures persistent, per-user data storage, and Graph DBs enable intelligent, user-specific relationship mapping across your personal data ecosystem.
OAuth 2.1 authentication with encrypted token storage
Secure session management and automatic token refresh
Input validation with Zod schemas and CORS protection
Environment-based secrets management
Multi-user isolation: Each user has a fully isolated workspace, with strict separation of sessions, tokens, and data. No cross-user access is possible. All Google Workspace API calls and memory graphs are partitioned per user for maximum privacy.
Google Workspace Coverage
Gmail: Full email management with search, labels, and batch operations
Drive: File operations with Office format support and URL imports
Docs: Create, edit, search, and batch update Google Docs with advanced content manipulation
Calendar: Event management with Google Meet and attachments
Sheets: Spreadsheet operations with flexible data I/O
Slides: Presentation management with batch updates
Tasks: Complete task and task list management with hierarchy
Intelligent Context Management
Graph database integration for relationship mapping across personal data
Memory persistence for long-term context retention
Sequential thinking patterns for complex task management
Cross-platform data correlation and insights
Developer Experience
Built on Vercel MCP SDK for optimal performance and reliability
Full TypeScript implementation with Zod validation
Modular architecture with clean separation of concerns
PostgreSQL database with Drizzle ORM and graph database integration
Support for multiple MCP transport methods such as Streamable HTTP & SSE (deprecated)
Architecture
Multi-User Architecture & Isolated Access
VaultAssist is designed for secure, multi-user operation. Each user authenticates via OAuth 2.1 and is assigned a unique, encrypted session. All Google Workspace API calls are performed strictly on behalf of the authenticated user, ensuring that:
Data Isolation: User data, tokens, and memory graphs are partitioned and encrypted per user. No user can access another user's data or sessions.
Session Security: Sessions are managed with Better Auth, providing advanced session isolation and automatic token refresh for each user.
Per-User API Access: All Google API operations are scoped to the authenticated user's account, with no shared credentials.
Database & Graph Partitioning: PostgreSQL and graph database entries are keyed and isolated per user, preventing cross-user data leakage.
This architecture enables VaultAssist to safely serve multiple users in parallel, with strong guarantees of privacy and access control.
git clone https://github.com/3xCaffeine/mcp-server.git
cd mcp-server
bun install # or npm install, pnpm install, yarn install
2. Database Setup
Set up your PostgreSQL database and configure environment variables:
# Copy environment template
cp .env.example .env
3. Google Cloud Console Setup
Create a Google Cloud Project
Enable APIs:
Gmail API
Google Drive API
Google Calendar API
Google Sheets API
Google Slides API
Google Tasks API
Create OAuth 2.1 Credentials:
Go to APIs & Services → Credentials
Click Create Credentials → OAuth Client ID
Choose Web Application
Add authorized redirect URIs:
http://localhost:3000/api/auth/callback/google
Download credentials and add to .env
4. Database Migration
# Generate and run migrations
bun run drizzle:generate
bun run drizzle:migrate
# Optional: Open Drizzle Studio to inspect database
bun run drizzle:studio
5. Development Server
# Start development server
bun dev
Visit http://localhost:3000/dashboard to access the web interface.
Deployment Steps
Check the Caddy config and start the services with Docker Compose.
cd mcp-server/deployment/
docker compose up -d
MCP Client Configuration
Open up the VS Code Command Palette > MCP:Open User Configuration and paste the below into mcp.json config.