Looker VS Code Extension
This extension provides support for LookML development in VS Code-based IDEs,
including syntax highlighting, autocomplete, and file synchronization with your
Looker instance.
Features
- Syntax Highlighting: Rich coloring for
.lkml files to make code easier
to read.
- LookML Validation: Syntax errors are highlighted in real-time as you
type and save. Run a full validation of your project via the command palette
or context menu.
- Autocomplete: Context-aware suggestions for LookML parameters (explore,
view, dimension, measure, etc.).
- Live Synchronization: Keeps files in real-time sync with your Looker dev
mode copy without needing to use Git.
- Git Integration: Keeps Looker and your local Git clone in sync.
- Authentication: Sign in using OAuth or Looker API credentials.
Getting Started
Here's how to get started with agentic LookML development with an agentic VS Code-based editor.
To provide the agent with access to the Looker API (run queries, inspect SQL,
inspect the LookML model, and inspect connection schema information), you need a
running, local
MCP Toolbox for Databases
server.
The recommended approach is to use npx. You can provide your Looker instance
URL and API credentials as inline environment variables, or you can set them in
your shell environment.
For OAuth:
LOOKER_BASE_URL="https://your-instance.looker.com" \
LOOKER_USE_CLIENT_OAUTH=true \
npx @toolbox-sdk/server --prebuilt=looker,looker-dev
For client ID & secret:
LOOKER_BASE_URL="https://your-instance.looker.com" \
LOOKER_CLIENT_ID="YOUR_CLIENT_ID" \
LOOKER_CLIENT_SECRET="YOUR_CLIENT_SECRET" \
npx @toolbox-sdk/server --prebuilt=looker,looker-dev
For more advanced installation and configuration options, see the
official documentation.
In your IDE, use CMD-SHIFT-P (Mac) or CTRL+SHIFT+P (Linux/Windows)
to open the command palette and choose Preferences: Open Workspace
Settings (JSON).
Update your Workspace Settings to configure the extension based on your
preferred authentication approach:
OAuth (Recommended): OAuth is recommended because it provides a secure
authorization flow without storing secrets in the editor. A Looker admin
must
register
the Looker VS Code extension as an OAuth client in Looker's API Explorer and
provide you with an OAuth client ID. The OAuth client ID is the same as the
client_guid in the API Explorer. Add the following to your Workspace
Settings:
```json
{
"looker.instanceURL": "https://your-instance.looker.com",
"looker.oauthClientId": "YOUR_OAUTH_CLIENT_ID",
"looker.projectId": "your_project_name"
}
```
Client ID & Secret (API Key): Add the following to your Workspace
Settings:
{
"looker.instanceURL": "https://your-instance.looker.com",
"looker.clientId": "YOUR_API_KEY_CLIENT_ID",
"looker.clientSecret": "YOUR_API_KEY_CLIENT_SECRET",
"looker.projectId": "your_project_name"
}
By default the MCP for Databases server runs on port 5000. If you used
a different port, update looker.mcpServerUrl, e.g.:
"looker.mcpServerUrl": "http://localhost:7171/mcp"
In the Output tab in your IDE, check the Looker channel for any
errors.
Follow the your IDE's documentation to open
your mcp_config.json.
Add the following to your mcp_config.json:
{
"mcpServers": {
"Looker": {
"serverUrl": "http://127.0.0.1:5050",
"disabledTools": [
"get_project_files",
"get_project_file",
"create_project_file",
"update_project_file",
"delete_project_file",
"run_dashboard",
"get_dashboards",
"make_dashboard",
"add_dashboard_filter",
"add_dashboard_element",
"get_looks",
"make_look",
"generate_embed_url",
"health_analyze",
"health_vacuum",
"health_pulse",
"query_url"
]
}
}
}
Note that here, serverUrl refers to the URL of the MCP proxy run by the
extension, not the MCP Server you set up in Step 1.
Note: We disable the file system tools because the extension already
handles file operations.
Usage
- Clone a LookML Project: Clone your LookML project's Git repository to
your local machine.
- Open the Project: Open the cloned folder in VS Code.
- Switch Branch: Ensure you are on the desired Git branch locally. The
extension will automatically switch your Looker session to this branch.
- Edit: Open a file. The extension will fetch the latest content from
Looker. Be aware that this may overwrite local changes if they differ from
Looker's version.
- Save: Saving a file pushes the changes to Looker immediately.
- Prompt the agent: Use your AI agent to assist you. For
example, ask "Please add a new dimension for
user_id to the users view."
Troubleshooting & Logs
If you encounter issues, you can view the extension's logs in the VS Code
Output panel.
Viewing Logs:
- Open the Output panel using the VS Code command palette (CMD-SHIFT-P on Mac,
CTRL+SHIFT+P on Windows/Linux) and selecting View: Toggle Output.
Alternatively, use the shortcut CMD-SHIFT-U (Mac) or CTRL+SHIFT+U
(Windows/Linux).
- In the dropdown menu on the right side of the Output panel, select
Looker.
Changing the Log Level:
- Open the command palette (CMD-SHIFT-P on Mac, CTRL+SHIFT+P on Windows/Linux)
and select Developer: Set Log Level....
- Select Looker from the dropdown of extensions.
- Choose your desired logging level (e.g.,
Debug or Trace for more verbose
output, or Info for standard output).
Configuration Reference
You can configure the following settings in your workspace VS Code
settings.json (or via the Settings UI under Looker):
Note: We recommend using workspace settings rather than user (global)
settings because they are specific to a Looker instance and project.
| Setting |
Description |
Default |
looker.instanceURL |
Base URL of the Looker instance (e.g. https://mycompany.looker.com). |
- |
looker.authURL |
URL to use for OAuth authentication. Only set if different than your instance URL. |
looker.instanceURL |
looker.sdkURL |
URL to use for API requests. Only set if different than your instance URL. |
looker.instanceURL |
looker.oauthClientId |
Looker OAuth Client ID. Required for OAuth. The same as the client_guid in Looker's API Explorer. |
- |
looker.clientId |
Looker API Client ID. Required for API Key auth. |
- |
looker.clientSecret |
Looker API Client Secret. Required for API Key auth. |
- |
looker.projectId |
Looker Project ID. |
- |
looker.mcpServerUrl |
URL of the external MCP server to proxy (e.g. http://localhost:5000/mcp). |
- |
looker.acceptSelfSignedCertificates |
Ignore SSL certificate errors (e.g. for self-signed certificates). WARNING: insecure. |
false |
looker.askBeforeOverwritingRemote |
Always ask before overwriting remote files during file save when a conflict is detected. |
false |
MCP Proxy
This VS Code extension includes a built-in proxy for the MCP Toolbox for
Databases server.
Why?
AI agents can act extremely fast. Because the VS Code extension syncs local
changes to Looker asynchronously, a race condition can occur where the agent
queries the MCP server before its file edits have been uploaded to Looker.
The built-in MCP proxy solves this by waiting for all active file syncs to
complete before forwarding the agent's MCP requests to the underlying MCP
server.
Configuring the Proxy
- Set
looker.mcpServerUrl to the destination URL of your MCP Toolbox for
Databases server (e.g., http://localhost:5000/mcp).
- When the extension starts, the proxy will listen locally on port 5050
(default:
http://127.0.0.1:5050) and forward requests to the URL defined
in looker.mcpServerUrl.
Note: If port 5050 is occupied, the extension will try to run the proxy on
an arbitrary available port. Check the "Looker" Output channel in VS Code for
the exact proxy URL in this case.