GlassCloud MCP Server

MCP Relay Server for GlassBridge smart glasses app

README.md

GlassCloud

MCP Relay Server for GlassBridge - a cloud service that bridges the GlassBridge Android app with Google services and third-party tools via the Model Context Protocol (MCP).

Purpose

GlassCloud solves a fundamental challenge in mobile AI assistants: how do you give a voice assistant on smart glasses access to your personal data (email, calendar) securely?

The answer is a cloud relay that:

  1. Authenticates users via Google OAuth on a web browser
  2. Links devices via QR code scanning (no typing passwords on glasses)
  3. Proxies tool calls from the Android app to Google APIs
  4. Manages OAuth tokens securely with encryption at rest
┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  Smart Glasses  │────▶│   GlassCloud    │────▶│  Google APIs    │
│  + Android App  │ WS  │  (This Server)  │     │  Gmail/Calendar │
└─────────────────┘     └─────────────────┘     └─────────────────┘
                               │
                               ▼
                        ┌─────────────────┐
                        │  Web Console    │
                        │  (OAuth + QR)   │
                        └─────────────────┘

Key Features

  • WebSocket Relay - Real-time bidirectional communication with Android devices
  • Google OAuth - Secure authentication without exposing credentials to the mobile app
  • QR Code Linking - Scan-to-link flow for easy device pairing
  • MCP Tool Execution - Gmail and Calendar tools with automatic token refresh
  • Voice-First Design - Progress messages for immediate audio feedback during tool execution

Quick Start

# Install dependencies
npm install

# Copy and configure environment
cp .env.example .env
# Edit .env with your settings (see Configuration below)

# Development (auto-reload)
npm run dev

# Production
npm run build
npm start

Then open: http://localhost:3000/console

Configuration

Required Environment Variables

# Security - MUST be unique random values (32+ chars)
# Generate with: node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
JWT_SECRET=your-random-secret-here
ENCRYPTION_KEY=your-random-key-here

# Google OAuth (optional for dev, required for production)
# Create at: https://console.cloud.google.com/apis/credentials
GOOGLE_CLIENT_ID=xxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=xxx
GOOGLE_CALLBACK_URL=http://localhost:3000/auth/google/callback

Optional Settings

PORT=3000                      # Server port
NODE_ENV=development           # development | production
LOG_LEVEL=debug               # trace | debug | info | warn | error
DATABASE_PATH=./data/glasscloud.db
CORS_ORIGINS=http://localhost:3000

Architecture

System Components

┌─────────────────────────────────────────────────────────────────┐
│                        GlassCloud Server                         │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌─────────────┐   ┌─────────────┐   ┌─────────────┐           │
│  │  WebSocket  │   │  REST API   │   │  MCP Proxy  │           │
│  │   Server    │   │  (Express)  │   │   Manager   │           │
│  │             │   │             │   │             │           │
│  │ - Device    │   │ - OAuth     │   │ - Gmail     │           │
│  │   connections│   │ - QR codes  │   │ - Calendar  │           │
│  │ - Tool      │   │ - Devices   │   │ - Token     │           │
│  │   routing   │   │ - Console   │   │   refresh   │           │
│  └──────┬──────┘   └──────┬──────┘   └──────┬──────┘           │
│         │                 │                 │                   │
│         └─────────────────┼─────────────────┘                   │
│                           │                                     │
│                  ┌────────┴────────┐                            │
│                  │   SQLite + WAL  │                            │
│                  │                 │                            │
│                  │ - Users         │                            │
│                  │ - Devices       │                            │
│                  │ - OAuth tokens  │                            │
│                  │ - Link tokens   │                            │
│                  └─────────────────┘                            │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Directory Structure

src/
├── index.ts                 # Entry point, server startup
├── config/
│   ├── env.ts              # Zod environment validation
│   ├── mcp-services.ts     # Built-in service definitions
│   └── index.ts
├── server/
│   ├── express.ts          # Express app setup (CORS, helmet, rate limiting)
│   └── websocket.ts        # WebSocket server with zombie cleanup
├── routes/
│   ├── auth.ts             #

Tools 2

gmail_toolsProvides access to Gmail functionality for reading and managing emails.
calendar_toolsProvides access to Google Calendar for managing events and schedules.

Environment Variables

JWT_SECRETrequiredRandom secret for JWT authentication
ENCRYPTION_KEYrequiredRandom key for data encryption
GOOGLE_CLIENT_IDrequiredGoogle OAuth Client ID
GOOGLE_CLIENT_SECRETrequiredGoogle OAuth Client Secret
GOOGLE_CALLBACK_URLrequiredGoogle OAuth callback URL

Try it

Check my calendar for any meetings scheduled for this afternoon.
Read the latest unread email from my inbox.
List my upcoming events for tomorrow.
Search for emails from my manager regarding the project update.

Frequently Asked Questions

What are the key features of GlassCloud?

WebSocket relay for real-time bidirectional communication with mobile devices. Secure Google OAuth authentication for third-party tool access. QR code-based device pairing flow. Automatic OAuth token refresh for continuous service access. Voice-first design with progress feedback for tool execution.

What can I use GlassCloud for?

Enabling voice-controlled access to personal email while wearing smart glasses. Managing calendar schedules hands-free via mobile-to-cloud relay. Securely bridging mobile AI assistant tool calls to Google APIs without exposing credentials.

How do I install GlassCloud?

Install GlassCloud by running: npm install && npm run build && npm start

What MCP clients work with GlassCloud?

GlassCloud works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep GlassCloud docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare