For the complete documentation index, see llms.txt. This page is also available as Markdown.

Run with Docker

You can run Lenses MCP Server by cloning the source code, building a Docker image and running it as a remote MCP server (using the HTTP transport).

1

Clone the repository

Run:

git clone git@github.com:lensesio/lenses-mcp.git
2

Build and tag image

Build and tag a Docker image using the Dockerfile included at the root of the repository.

Run:

docker build -t lenses-mcp:local
3

Run using Docker

Run using Docker by passing in configuration as environment variables for the default setup that uses OAuth for authentication and authorization. This example runs the MCP server using HTTP transport, available on port 8000 on the local machine. Set this in the MCP_ADVERTISED_URL variable:

docker run --rm -it --name lenses-mcp \
-p 8000:8000 \
-e TRANSPORT=http \
-e HOST=0.0.0.0 \
-e PORT=8000 \
-e OAUTH_ENABLED=True \
-e LENSES_URL=https://your-lenses.io \
-e LENSES_ADVERTISED_URL=https://your-publicly-available-lenses.io \
-e MCP_ADVERTISED_URL=http://localhost:8000 \
lenses-mcp:local
4

Configure in your AI tool

To run in Cursor, Claude, Codex, or another client, use this mcp.json configuration. It connects the client using HTTP transport:

{
  "mcpServers": {
    "Lenses": {
      "type": "http",
      "url": "http://localhost:8000/mcp"
    }
}

The MCP server endpoint is the advertised URL with /mcp on the end

5

Authenticate with OAuth

Navigate to your AI tool's MCP server settings and connect to authenticate with the Lenses OAuth authorization server (visible to your AI tool's client and configured with LENSES_ADVERTISED_URL). Here is an example using Cursor.

Cursor MCP server settings

This opens a web browser at LENSES_ADVERTISED_URL/oauth2/authorize and passes OAuth parameters. Log in with your username/password or SSO (example shown is the Community Edition screen).

Lenses login screen

The authorization server displays an OAuth consent screen. Set the read, write, and delete scopes.

OAuth authorization consent screen

After you complete this flow, your AI tool authenticates with Lenses MCP Server using the granted scopes.

Authenticated Lenses MCP Server connection in Cursor

Lenses documentation is available on Context7. Use the Context7 MCP Server and adjust your prompts with use context7 to ensure your AI tool has the latest documentation.

Last updated

Was this helpful?