Mentra Glass MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "MENTRAOS_API_KEY=${MENTRAOS_API_KEY}" mentra-glass -- docker compose up --build -d
Required:MENTRAOS_API_KEY+ 4 optional
README.md

Control MentraOS smart glasses through natural language commands.

Mentra Glass MCP Server

A Model Context Protocol (MCP) server for controlling MentraOS smart glasses. Built with Bun, Mentra SDK, and MCP SDK.

Features

  • MCP Support: Exposes tools to control glasses (Display, Audio, Input) via JSON-RPC.
  • Multi-User: Supports multiple users via Bearer token authentication (email).
  • Mentra Integration: Connects to Mentra Cloud as an AppServer.
  • Docker Ready: Includes Dockerfile and Compose setup.

Architecture

MCP Client (Claude/Cursor) 
       ⬇️ JSON-RPC (HTTP)
   [MCP Server]
       ⬇️ Mentra SDK
   Mentra Cloud
       ⬇️
   Smart Glasses

Prerequisites

  • Bun (v1.0+)
  • Mentra Developer Account & API Key

Authentication

This server uses a secure token-based authentication system.

  1. Start the Server (Locally or Deployed).
  2. Open the Webview:
    • Local: http://localhost:3000/webview
    • Deployed: https://your-app.onrender.com/webview
  3. Login: Sign in with your Mentra account.
  4. Get Token: Copy the Access Token displayed on the screen.

Connecting to Clients

1. GitHub Copilot (VS Code)

Add the server to your MCP configuration file (usually ~/.config/github-copilot/mcp.json or via the VS Code command "MCP: Manage MCP Servers").

{
  "mcpServers": {
    "mentra-glasses": {
  "type": "sse",
  "url": "mcp url here",
  "headers": {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
  }
  }
}

Note: Replace the URL and Token with your actual values.

2. Claude Desktop

Edit your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "mentra-glass": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-sse-client"],
      "env": {
        "MCP_SSE_URL": "http://localhost:3000/mcp",
        "MCP_SSE_HEADERS": "{\"Authorization\": \"Bearer YOUR_ACCESS_TOKEN\"}"
      }
    }
  }
}

3. Cursor

  1. Go to Settings > Features > MCP.
  2. Click + Add New MCP Server.
  3. Name: mentra-glass
  4. Type: SSE
  5. URL: https://your-app.onrender.com/mcp?token=YOUR_ACCESS_TOKEN (Note: Cursor may not support custom headers yet, so we support passing the token via query parameter as a fallback)

Running Locally

# Start the server
bun run src/index.ts

# Watch mode
bun run dev

The server will start on http://localhost:3000.

  • /mcp: MCP JSON-RPC endpoint
  • /health: Health check
  • /webview: Auth & Settings

Running with Docker

# Build & Run
docker compose up --build -d

Available Tools

  • Display: glasses_display_text, glasses_clear_display
  • Audio: glasses_speak
  • Input: glasses_get_transcriptions, glasses_get_events
  • System: glasses_status

Project Structure

  • src/config: Environment configuration
  • src/services: Core logic (Mentra SDK, Session Management)
  • src/tools: MCP Tool definitions
  • src/index.ts: Entry point

Deployment

Option 1: Render + Supabase (Recommended for Free Tier)

Best for indie devs. Uses Supabase for the database (since Render's free tier wipes local files) and Render for hosting.

  1. Database: Follow SUPABASE_SETUP.md to create your Supabase project and get credentials.
  2. Hosting:
    • Sign up at render.com.
    • Create a new Web Service.
    • Connect your GitHub repository.
    • Runtime: Docker.
    • Environment Variables:
      • SUPABASE_URL: Your Supabase URL.
      • SUPABASE_SERVICE_KEY: Your Supabase Service Role Key.
      • MENTRAOS_API_KEY: Your Mentra API Key.
      • PACKAGE_NAME: com.yourname.glassmcp.
      • PORT: 3000.

Option 2: Fly.io (Best for SQLite)

Allows you to keep using the local SQLite database by attaching a persistent volume.

  1. Install flyctl.
  2. Run fly launch.
  3. Create a volume: fly volumes create mcp_data.
  4. Update fly.toml to mount the volume to /app/mcp.sqlite.

Option 3: Self-Hosted (VPS)

Run standard Docker Compose on any server (DigitalOcean, Hetzner, Oracle Cloud).

docker compose up -d

Tools (6)

glasses_display_textDisplays text on the smart glasses screen.
glasses_clear_displayClears the smart glasses display.
glasses_speakPlays audio output through the smart glasses.
glasses_get_transcriptionsRetrieves input transcriptions from the glasses.
glasses_get_eventsRetrieves events from the smart glasses.
glasses_statusChecks the current status of the smart glasses.

Environment Variables

SUPABASE_URLURL for Supabase database connection
SUPABASE_SERVICE_KEYService role key for Supabase
MENTRAOS_API_KEYrequiredAPI key for MentraOS developer account
PACKAGE_NAMEApplication package identifier
PORTServer port number

Configuration

claude_desktop_config.json
{"mcpServers": {"mentra-glass": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-sse-client"], "env": {"MCP_SSE_URL": "http://localhost:3000/mcp", "MCP_SSE_HEADERS": "{\"Authorization\": \"Bearer YOUR_ACCESS_TOKEN\"}"}}}}

Try it

Display a reminder on my glasses to pick up groceries at 5 PM.
Clear the current text from my smart glasses display.
Speak the latest notification to me through my glasses.
Get the recent transcriptions from my glasses input.
Check the current status and battery level of my smart glasses.

Frequently Asked Questions

What are the key features of Mentra Glass?

Exposes tools to control glasses display, audio, and input via JSON-RPC. Supports multi-user authentication via Bearer tokens. Integrates with Mentra Cloud as an AppServer. Docker-ready for easy deployment.

What can I use Mentra Glass for?

Displaying hands-free navigation or task instructions on smart glasses. Triggering audio alerts or voice feedback from AI agents. Capturing and processing voice transcriptions from wearable hardware. Monitoring the status of connected smart glass devices.

How do I install Mentra Glass?

Install Mentra Glass by running: bun run src/index.ts

What MCP clients work with Mentra Glass?

Mentra Glass 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 Mentra Glass docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare