Mentra Glass MCP Server
Enables control of MentraOS smart glasses through tools for managing text displays, audio output, and input transcriptions. It integrates with Mentra Cloud to facilitate seamless interaction with smart glass hardware using natural language commands.
README
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.
- Start the Server (Locally or Deployed).
- Open the Webview:
- Local:
http://localhost:3000/webview - Deployed:
https://your-app.onrender.com/webview
- Local:
- Login: Sign in with your Mentra account.
- 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
- Go to Settings > Features > MCP.
- Click + Add New MCP Server.
- Name:
mentra-glass - Type:
SSE - 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 configurationsrc/services: Core logic (Mentra SDK, Session Management)src/tools: MCP Tool definitionssrc/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.
- Database: Follow
SUPABASE_SETUP.mdto create your Supabase project and get credentials. - 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.
- Install
flyctl. - Run
fly launch. - Create a volume:
fly volumes create mcp_data. - Update
fly.tomlto 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.