Lens Studio MCP Server
Build, debug, and generate Snapchat Lenses by letting AI agents drive Lens Studio's scene graph, assets, scripts, and runtime via a local MCP server.
Lens Studio is Snap's authoring tool for creating AR Lenses for Snapchat and Spectacles. Its built-in MCP server (introduced as part of Lens Studio AI's Developer Mode) exposes the app's internal "ChatTools" over HTTP so external LLM clients like Claude Code, Cursor, and VS Code can read and modify a Lens project in real time. The server runs locally inside the Lens Studio process and is started from AI Assistant > MCP > Configure Server.
The server provides a broad surface area covering the Lens authoring workflow: scene graph introspection, asset and component creation from presets, property edits, prefab instantiation, TypeScript file authoring and compilation, runtime log capture, asset library and licensed music search, and optional generative AI tools for 3D meshes, textures, and face masks. A documentation RAG tool (QueryLensStudioRag) is included so agents can look up the official Lens Studio API and property paths before making changes.
Because the server is shipped with Lens Studio itself, it is the canonical, first-party way to script Lens Studio with an LLM. There is no public GitHub repo, the implementation lives inside the Lens Studio application and is extendable through the Chat Tool Package available from the Asset Library.
Tools
| Tool | Description |
|---|---|
GetLensStudioSceneGraph |
Source of truth for scene objects, component IDs, property paths and values. |
GetLensStudioSceneObjectById |
Fetch a scene object by its internal ID. |
GetLensStudioSceneObjectByName |
Fetch scene objects matching a name. |
ListLensStudioAssets |
List the project's assets with IDs and properties. |
GetLensStudioAssetById |
Look up a specific asset by ID. |
GetLensStudioAssetByPath |
Look up an asset by its path in the project. |
GetLensStudioAssetsByName |
Find assets whose name matches a query. |
QueryLensStudioRag |
Query authoritative Lens Studio docs (APIs, decorators, property paths). |
GetPresetRegistryTool |
List available presets for objects, components, and assets. |
CreateSceneObjectFromPresetTool |
Create a scene object from a registered preset. |
CreateComponentFromPresetTool |
Attach a component to a scene object using a preset. |
CreateAssetFromPresetTool |
Create an asset from a preset definition. |
CreateLensStudioSceneObject |
Create a new scene object in the hierarchy. |
CreateLensStudioComponent |
Add a component to a scene object. |
CreateLensStudioAsset |
Create a new asset in the project. |
InstantiateLensStudioPrefab |
Instantiate a prefab into the scene. |
CreatePrefabFromSceneObject |
Convert a scene object into a reusable prefab. |
SetLensStudioProperty |
Set a property on a scene object, component, or asset. |
SetLensStudioParent |
Reparent a scene object in the hierarchy. |
RenameLensStudioSceneObject |
Rename a scene object. |
DuplicateLensStudioSceneObject |
Duplicate an existing scene object. |
DeleteLensStudioSceneObject |
Delete a scene object. |
RenameAsset |
Rename an asset. |
MoveLensStudioAsset |
Move an asset to a different folder. |
DuplicateLensStudioAsset |
Duplicate an asset. |
DeleteLensStudioAsset |
Delete an asset. |
ReadWriteTextFile |
Read or write TypeScript and other text files in the project. |
CompileWithLogsTool |
Compile TypeScript and return compiler logs. |
RunAndCollectLogsTool |
Restart preview and capture runtime logs. |
GetLensStudioLogsTool |
Return current Lens Studio runtime diagnostics. |
SearchLensStudioAssetLibrary |
Search the Lens Studio Asset Library. |
InstallLensStudioPackage |
Install a package from the Asset Library. |
SearchLensStudioMusicLibrary |
Search the licensed music library. |
InstallLicensedMusic |
Add a licensed music track to the project. |
ListInstalledPackagesTool |
List installed packages and dependencies. |
GenerateFast3DAssets |
Generate 3D assets using the fast model (optional AI tool). |
GenerateThreeDAssetTool |
Generate a 3D asset (optional AI tool). |
GenerateTexture |
Generate a texture (optional AI tool). |
GenerateFaceMaskTexture |
Generate a face mask texture (optional AI tool). |
Prerequisites
- Lens Studio installed (with AI Assistant / Developer Mode available)
- The Chat Tool Package installed from the Lens Studio Asset Library
- An MCP-capable client: Claude Code, Cursor, or VS Code
Start the server
- Open Lens Studio
- From the menu bar choose
AI Assistant > AI Model Context Protocol (MCP) > Configure Server - Click
Start Server - Click
Copy MCP Configto copy the generated config (includes the localhost URL and a one-time Authorization token)
The server is HTTP-based and listens locally, typically at http://localhost:8732/mcp.
Claude Code
claude mcp add --transport http lens-studio http://localhost:8732/mcp \
--header "Authorization: Bearer <token-from-lens-studio>"
Verify with claude mcp list or /mcp inside Claude Code. If the token expires, run claude mcp remove lens-studio and re-add with a fresh token.
Cursor / VS Code
Paste the copied config into the MCP settings file:
{
"mcpServers": {
"lens-studio": {
"type": "http",
"url": "http://localhost:8732/mcp",
"headers": {
"Authorization": "Bearer <token-from-lens-studio>"
}
}
}
}
Restart the editor and enable the lens-studio server in the MCP / Tools panel.
- Generate a complete Lens scaffold by asking the agent to create scene objects, attach components from presets, and wire up a TypeScript controller script
- Audit an existing Lens project, list scene objects and assets, then refactor naming and folder structure consistently across the scene graph
- Author and iterate on TypeScript behaviors with
ReadWriteTextFile,CompileWithLogsTool, andRunAndCollectLogsToolso the agent can write code, compile it, and read runtime errors without leaving the editor - Pull in third-party assets and licensed music by searching the Asset Library and Music Library and installing packages directly from chat
- Prototype AR effects faster using the optional generative tools to create 3D assets, textures, and face mask textures from text prompts
- "Read the current scene graph and add a Face Stretch component to the Face Object, then set its intensity to 0.6."
- "Create a new TypeScript controller that tweens the camera's FOV from 60 to 30 over 2 seconds when the user taps the screen, then compile and show me any errors."
- "Search the Asset Library for a confetti particle effect, install it, and instantiate it under the Camera object."
- "Run the preview, collect runtime logs, and tell me why my Tween script is throwing an error."
- "Generate a stylized lava texture and apply it as the base color of the Ground material."
- First-party server shipped inside Lens Studio, no third-party fork or community reverse-engineering required
- Very broad tool coverage spanning scene graph, assets, scripting, compile/runtime logs, library search, and generative AI
- Includes a docs RAG tool (
QueryLensStudioRag) so agents can ground decisions in official Lens Studio API references - Works with the major MCP clients (Claude Code, Cursor, VS Code) using a standard HTTP transport
- Local-only: Lens Studio must be running on the same machine and the bearer token rotates, requiring reconfiguration when it expires
- Requires the Chat Tool Package from the Asset Library and a Lens Studio version that supports Developer Mode
- No public source repository, behavior and tool list can change between Lens Studio releases and are documented only on Snap's developer site
- Blender MCP for AI-driven 3D scene authoring outside of Snap's AR ecosystem
- Unity MCP for controlling Unity Editor from an LLM, similar workflow but for general game/AR development
- Meta Spark Studio (no official MCP server) as a competing AR authoring tool, manual scripting only