> For the complete documentation index, see [llms.txt](https://docs.lenses.io/latest/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lenses.io/latest/mcp/lenses-mcp-server/getting-started/configuration.md).

# Configuration

The MCP server will load the configuration from a `.env` file.

<table><thead><tr><th width="232.21484375">VARIABLE NAME</th><th width="267.40625">DESCRIPTION</th><th width="281.38671875">DEFAULT</th><th width="122.1015625">REQUIRED</th></tr></thead><tbody><tr><td>TRANSPORT</td><td>MCP server transport</td><td>http (if <code>OAUTH_ENABLED</code> is <code>True</code>)<br>stdio (if <code>OAUTH_ENABLED</code> is <code>False</code>)</td><td>No</td></tr><tr><td>HOST</td><td>MCP server host address</td><td>0.0.0.0</td><td>No</td></tr><tr><td>PORT</td><td>MCP server port</td><td>8000</td><td>No</td></tr><tr><td>OAUTH_ENABLED</td><td>Switch to enable/disable OAuth</td><td>False</td><td>No</td></tr><tr><td>LENSES_URL</td><td>Lenses HTTP Endpoint</td><td>http://localhost:9991</td><td>Yes</td></tr><tr><td>LENSES_ADVERTISED_URL</td><td>The publicly available Lenses HTTP endpoint (needs to be accessibly by MCP clients for OAuth)</td><td><code>LENSES_URL</code> value</td><td>No</td></tr><tr><td>MCP_ADVERTISED_URL</td><td>The publicly available URL for this MCP server (needs to be accessible to MCP clients)</td><td></td><td>Yes if <code>OAUTH_ENABLED</code> is <code>True</code></td></tr><tr><td>MCP_SCOPES</td><td>OAuth scopes required by Lenses resources. Published in protected-resource metadata so compliant clients include them in their /authorize request</td><td>read,write,delete</td><td>No</td></tr><tr><td>LENSES_API_KEY</td><td>Alternative authentication using a Lenses Service Account API key</td><td></td><td>Yes if <code>OAUTH_ENABLED</code> is <code>False</code></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lenses.io/latest/mcp/lenses-mcp-server/getting-started/configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
