An MCP (Model Context Protocol) server that connects any AI coding agent to Lens Studio in real-time. Tell your AI to build an AR lens and watch it happen live.
No plugins required — works with Lens Studio 5.15+'s built-in MCP endpoint.
Compatible with: Claude Desktop, Claude Code, Cursor, Windsurf, VS Code Copilot, OpenAI agents, and any MCP-compatible client.
AI Agent ←─ MCP (stdio/SSE/HTTP) ─→ lens-studio-mcp ←─ HTTP JSON-RPC ─→ Lens Studio (port 50050)
Lens Studio 5.15+ ships with a built-in HTTP MCP server at localhost:50050/mcp. This package is a thin proxy that:
- Discovers all tools from Lens Studio's API
- Registers them as MCP tools with friendly wrappers
- Forwards tool calls via HTTP and handles authentication
- Adds convenience tools for face filters, materials, colors, and macOS UI automation
pip install lens-studio-mcpgit clone https://github.com/superdwayne/lens-studio-mcp.git
cd lens-studio-mcp
pip install -e .Launch Lens Studio 5.15+ and open or create a project. The built-in MCP server starts automatically on port 50050.
Add lens-studio-mcp to your editor's MCP configuration:
Windsurf (.windsurf/mcp.json or project .mcp.json):
{
"mcpServers": {
"lens-studio": {
"command": "lens-studio-mcp",
"args": ["--transport", "stdio"]
}
}
}Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"lens-studio": {
"command": "lens-studio-mcp",
"args": ["--transport", "stdio"]
}
}
}Cursor (.cursor/mcp.json):
{
"mcpServers": {
"lens-studio": {
"command": "lens-studio-mcp",
"args": ["--transport", "stdio"]
}
}
}SSE transport (for remote/web clients):
lens-studio-mcp --transport sse --port 8000Streamable HTTP transport:
lens-studio-mcp --transport streamable-http --port 8000The first time you connect, Lens Studio shows a permission popup — click Allow. After that, the auth token is cached and reused automatically.
Now just tell your AI agent what to build:
"Create a face filter with a red clown nose and colorful wig"
| Tool | Description |
|---|---|
connect() |
Authenticate with Lens Studio (triggers permission popup on first use) |
status() |
Connection state, port, cached tool count |
list_tools() |
List all available Lens Studio tools |
lens_tool(name, arguments) |
Call any Lens Studio tool directly by name |
| Tool | Description |
|---|---|
get_scene() |
Full scene hierarchy with names, types, components |
create_object(name, preset?) |
Create a scene object (optional preset template) |
delete_object(name) |
Remove a scene object by name |
add_primitive(shape, name?) |
Quick-add: sphere, cube, cylinder, camera, light, image, text |
set_property(uuid, path, value, type) |
Set any property on an object/component/asset |
create_asset(name, type) |
Create a new asset (Material, RenderTarget, etc.) |
| Tool | Description |
|---|---|
create_material(name, color?, r?, g?, b?) |
Create a PBR or unlit material with a solid color |
set_color(object_name, color?) |
Set an object's color by name (auto-creates material) |
assign_material(object_name, material_name) |
Assign an existing material to an object |
| Tool | Description |
|---|---|
create_face_anchor(name?) |
Create a head-tracked anchor with Face Occluder |
add_face_element(parent, landmark, shape?) |
Add 3D element at a face landmark position |
get_face_landmarks(landmark?) |
Reference positions for nose, eyes, ears, cheeks, etc. |
| Tool | Description |
|---|---|
query_knowledge_base(query) |
Search Lens Studio docs and knowledge base |
Fallback tools for operations not covered by the API:
ui_activate, ui_menu_click, ui_new_project, ui_save_project, ui_open_project, ui_preview, ui_keystroke, ui_type_text, ui_import_asset, ui_export_lens, ui_add_object, ui_dump_menus, ui_list_buttons, ui_click_button, ui_request_permissions
| Variable | Default | Description |
|---|---|---|
LENS_MCP_PORT |
50050 |
Lens Studio's MCP server port |
LENS_MCP_TOKEN_FILE |
~/.lens_mcp_token.json |
Path to cached auth token |
- Python 3.10+
- Lens Studio 5.15+ (running on the same machine)
- macOS recommended (UI automation tools are macOS-only, but all API tools work cross-platform)
- Lens Studio's MCP server binds to
localhostonly — not accessible from the network. - Auth tokens are stored locally at
~/.lens_mcp_token.json. - The SSE/HTTP transport also binds to
127.0.0.1by default.
MIT