circle-playRun 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

git clone [email protected]: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.

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. This is set 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, etc. use the following mcp.json configuration to configure the client to connect using HTTP transport.

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

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.

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).

You will be presented with an OAuth authorization consent screen where you can set read, write and delete scopes.

Completing this flow should take you back to your AI tool, authenticated and ready to use Lenses MCP Server with the granted authorization scopes.

circle-info

Lenses documentation is available on Context7arrow-up-right. Use the Context7 MCP Serverarrow-up-right and adjust your prompts with use context7 to ensure the documentation available to your AI tool is up to date

Last updated

Was this helpful?