Getting started with Lenses MCP

Learn how to get started with Lenses MCP server.

1

Get Lenses Community Edition

To install follow the instructions here.

2

Clone the Repository

git clone [email protected]:lensesio/lenses-mcp.git
3

Install uv and Python

You can skip this is you already have it.

If you don't have uv installed, follow the official installation guide.

Make sure you have the correct version of Python

uv run python --version

Requires Python 3.12

4

Configure access to Lenses

The MCP server uses a Lenses Service Account in the form of an environment variables. Login into Lenses and create a service account. Follow the instructions here. Make sure you assign the service account to a group that has access.

The repo contains a sample .env , copy it and add an entry for LENSES_API_KEY with the value of your service account token.

cp .env.example .env
5

Install Dependencies & Run

Use uv to create a virtual environment, install the project dependencies in it and then run the MCP server with the FastMCP CLI using the default stdio transport.

uv sync
uv run src/lenses_mcp/server.py
6

Configure in your IDE

To run in Claude Desktop, Gemini CLI, Cursor, etc. use the following JSON configuration.

{
  "mcpServers": {
    "Lenses.io": {
      "command": "uv",
      "args": [
        "run",
        "--project", "<ABSOLUTE_PATH_TO_THIS_REPO>",
        "--with", "fastmcp",
        "fastmcp",
        "run",
        "<ABSOLUTE_PATH_TO_THIS_REPO>/src/lenses_mcp/server.py"
      ],
      "env": {
        "LENSES_API_KEY": "<YOUR_LENSES_API_KEY>"
      },
      "transport": "stdio"
    }
  }
}

7

Context7

Lenses documentation is available on Context7. Use the Context7 MCP Server and adjust your prompts with use context7 to ensure the documentation available to the LLM is up to date.

Last updated

Was this helpful?