Lens Studio MCP Server
Enables AI agents to search Sketchfab for 3D models and import selected models into the Lens Studio project using a Sketchfab API token.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Lens Studio MCP Server
An MCP (Model Context Protocol) server that connects any AI 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.
How It Works
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 server is a 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 81 high-level tools for face filters, materials, animation, particles, scripting, and more
Related MCP server: PlayCanvas Editor MCP Server
Prerequisites
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)
Installation
Step 1: Clone the repo
git clone https://github.com/superdwayne/lensstudio-mcp.git
cd lensstudio-mcpStep 2: Create a virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtStep 3: Verify the server runs
python server.py --helpYou should see the available transport options (stdio, sse, streamable-http).
Connecting to Your AI Agent
Option A: Claude Desktop (automatic installer)
Run the included installer script — it automatically adds lens-studio to your Claude Desktop config:
python install_claude_config.pyThen restart Claude Desktop. The Lens Studio MCP server will appear in your available tools.
Option B: Claude Desktop (manual)
Open your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the lens-studio entry under mcpServers:
{
"mcpServers": {
"lens-studio": {
"command": "/FULL/PATH/TO/lensstudio-mcp/.venv/bin/python",
"args": [
"/FULL/PATH/TO/lensstudio-mcp/server.py",
"--transport", "stdio"
],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
}Replace
/FULL/PATH/TO/lensstudio-mcpwith the actual path where you cloned the repo.
Restart Claude Desktop after saving.
Option C: Claude Code
Add to your project's .mcp.json or run:
claude mcp add lens-studio -- /FULL/PATH/TO/lensstudio-mcp/.venv/bin/python /FULL/PATH/TO/lensstudio-mcp/server.py --transport stdioOr create a .mcp.json in your project root:
{
"mcpServers": {
"lens-studio": {
"command": "/FULL/PATH/TO/lensstudio-mcp/.venv/bin/python",
"args": [
"/FULL/PATH/TO/lensstudio-mcp/server.py",
"--transport", "stdio"
],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
}Option D: Cursor
Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"lens-studio": {
"command": "/FULL/PATH/TO/lensstudio-mcp/.venv/bin/python",
"args": [
"/FULL/PATH/TO/lensstudio-mcp/server.py",
"--transport", "stdio"
],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
}Option E: Windsurf
Add to .windsurf/mcp.json or your project .mcp.json:
{
"mcpServers": {
"lens-studio": {
"command": "/FULL/PATH/TO/lensstudio-mcp/.venv/bin/python",
"args": [
"/FULL/PATH/TO/lensstudio-mcp/server.py",
"--transport", "stdio"
],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
}Option F: SSE Transport (remote/web clients)
For clients that connect over HTTP instead of stdio:
source .venv/bin/activate
python server.py --transport sse --port 8000Then point your client to http://localhost:8000/sse.
Option G: Streamable HTTP Transport
source .venv/bin/activate
python server.py --transport streamable-http --port 8000First Run
Open Lens Studio 5.15+ and open or create a project
Start your AI agent (Claude Desktop, Cursor, etc.)
On first connection, Lens Studio shows a permission popup — click Allow
The auth token is cached at
~/.lens_mcp_token.jsonand reused automaticallyStart prompting your AI!
Example prompts
"Create a face filter with a red clown nose and cat ears"
"Add a sparkle particle effect to both hands"
"Apply a vintage color grading effect to the camera"
"Search for a crown 3D model and import it"
"Make the nose scale up when I open my mouth"Optional: Sketchfab 3D Model Search
To enable searching and importing 3D models from Sketchfab:
Get a free API token at sketchfab.com/settings/password
Add the token to your MCP config's
envblock:
{
"mcpServers": {
"lens-studio": {
"command": "/FULL/PATH/TO/lensstudio-mcp/.venv/bin/python",
"args": [
"/FULL/PATH/TO/lensstudio-mcp/server.py",
"--transport", "stdio"
],
"env": {
"PYTHONUNBUFFERED": "1",
"SKETCHFAB_API_TOKEN": "your_token_here"
}
}
}
}Available Tools (81)
Connection & Status
Tool | Description |
| Authenticate with Lens Studio (triggers permission popup on first use) |
| Connection state, port, cached tool count |
| List all available Lens Studio tools |
| Call any Lens Studio tool directly by name |
Scene Management
Tool | Description |
| Full scene hierarchy with names, types, components |
| Create a scene object (optional preset template) |
| Remove a scene object by name |
| Quick-add: sphere, cube, cylinder, camera, light, image, text |
| Set any property on an object/component/asset |
| Create a new asset (Material, RenderTarget, etc.) |
| Search Lens Studio docs and knowledge base |
Materials & Colors
Tool | Description |
| Create a PBR or unlit material with a solid color |
| Set an object's color by name (auto-creates material) |
| Assign an existing material to an object |
| Create a PBR material ready for textures |
| Apply a texture to an object's material |
| Create a sprite sheet texture |
| Create a custom shader material |
| Set a property on a material |
Face Tracking
Tool | Description |
| Create a head-tracked anchor with Face Occluder |
| Add 3D element at a face landmark |
| Reference positions for nose, eyes, ears, etc. |
Hand Tracking
Tool | Description |
| Create a hand-tracked anchor |
| Add 3D element at a hand joint |
| Reference positions for all hand joints |
| Trigger script on pinch, fist, open palm, etc. |
Body Tracking
Tool | Description |
| Create a body-tracked anchor |
| Add 3D element at a body joint |
| Reference positions for all body joints |
World Tracking
Tool | Description |
| Surface, world (6DOF), or rotation tracking |
| Position an object in world space |
| Track cats, dogs, people, or hands |
Animation
Tool | Description |
| Animate a property over time |
| Chain multiple animations |
| Animate on tap, mouth open, smile, etc. |
| Loop between values |
Particles
Tool | Description |
| Sparkles, fire, smoke, confetti, hearts, snow, stars, bubbles |
| Tune emission rate, lifetime, speed, size, color, gravity |
| Attach particles to an object |
| Create and attach particles in one call |
Segmentation
Tool | Description |
| Person, background, hair, skin, sky, upper garment |
| Replace or blur the background |
| Draw an outline around people |
| Change hair color |
Scripting
Tool | Description |
| Create a JavaScript script asset |
| Attach a script to a scene object |
| Run code when an object is tapped |
| Create a state machine |
| AI-generate a script from natural language |
Audio
Tool | Description |
| Add an audio component |
| Play sound on tap, smile, etc. |
| Pitch up/down, echo, robot, whisper |
| Animate in sync with music |
| Search licensed music |
| Install a track from the library |
Post-Processing
Tool | Description |
| Bloom, blur, vignette, chromatic aberration, grain, sharpen |
| Warm, cool, vintage, cyberpunk, pastel, high contrast |
| Import a custom color LUT |
| Light leaks, lens flare overlays |
Lens Recipes
Tool | Description |
| List available recipe templates |
| Build a complete lens from a template |
| Create a face filter from a feature list |
| Virtual try-on for glasses, hats, earrings, etc. |
| Interactive AR game (catch, tap, gesture quiz) |
3D Model Library (Sketchfab)
Tool | Description |
| Search Sketchfab for downloadable 3D models |
| Download and import a model into Lens Studio |
macOS UI Automation (fallback)
For operations not available via 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
Environment Variables
Variable | Default | Description |
|
| Lens Studio's MCP server port |
|
| Path to cached auth token |
| (none) | Sketchfab API token for 3D model search/import |
|
| Sketchfab API base URL |
|
| Cache directory for downloaded 3D models |
Troubleshooting
Problem | Solution |
"Connection refused" | Make sure Lens Studio 5.15+ is open with a project loaded |
"401 Unauthorized" | Lens Studio was restarted — delete |
Permission popup doesn't appear | Check Lens Studio is in the foreground and not blocked by a dialog |
UI automation tools fail | macOS only — run |
Sketchfab tools return error | Set |
Running Tests
source .venv/bin/activate
python -m pytest smoke_test.py -vAll 160 tests run against a mock Lens Studio server — no real Lens Studio instance needed.
Security
Lens Studio's MCP server binds to
localhostonly — not accessible from the networkAuth tokens are stored locally at
~/.lens_mcp_token.jsonSSE/HTTP transports bind to
127.0.0.1by defaultSketchfab API token is read from environment variables, never hardcoded
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
Make games with AI: one MCP server that connects your agent to Unity, Unreal and Godot editors.
Build, edit and publish live 3D, AR and game scenes in ARClip from your AI assistant.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to drive a running Roblox Studio in real time over a single WebSocket, executing whole Luau programs, installing in-engine controllers, hot-patching scripts during live playtests, and receiving errors, assertions and other events as pushes. It also reaches Roblox Open Cloud for the open place and answers visual questions via a vision sidecar, exposing all of this through nine MCP tools.92MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to automate the PlayCanvas Editor through a built-in MCP client, with no browser extension needed. Provides tools for entities, scripts, assets, scenes, templates, animation, builds, store imports, viewport and editor control, plus runtime launching with screenshots, logs and input to verify that projects actually run.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to control a live Blender session, including scene and object operations, rendering, and PolyHaven asset workflows. Supports provider-agnostic LLM backends that can be switched at runtime through MCP tools.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to inspect and control a live Blender session through MCP tools that create, modify, and delete objects, apply materials, render images, execute Python, and pull PolyHaven assets over a local TCP add-on. It also exposes a provider-agnostic LLM layer that can be pointed at Ollama, LM Studio, llama.cpp, OpenAI-compatible, or Azure endpoints and switched at runtime.-