> 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/user-guide/6.2-user-guide/getting-started/concepts.md).

# Concepts

Understand core concepts of Lenses

## Environments

Environments in Lenses represent your Kafka environments, not only the brokers. They also contain supporting services, such as Kafka Connect clusters and Schema Registries.

In Lenses, you can register one or more environments. Each environment has an agent key.

## Agents

Each environment needs a Lenses Agent. The agent connects to your Kafka brokers and other services. It proxies information and actions to and from Lenses.

Each agent is controlled by a [provisioning file](/latest/devx/6.2/deployment/configuration/agent/automation.md). This file contains the connection details needed to connect to your services.

{% hint style="info" %}
The minimum configuration is an agent key to establish the connection to Lenses. You receive it after you create an environment. You can regenerate a lost key.
{% endhint %}

Once your agent is started, it will connect to HQ and establish connectivity with the services you configured in the provisioning file.

You can also use Lenses to update the agent's configuration. The agent must be started and connected first.

<figure><img src="https://401348485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYESuTxbxhb0ZxoEuq3ka%2Fuploads%2Fv6sf5QDq47YhVU3ID6Gc%2Farchitecture-6.2.png?alt=media&amp;token=97e3daad-a1c8-40eb-87dd-1cefb2d1c5d0" alt="Lenses Agent configuration screen"><figcaption></figcaption></figure>

### MCP Server

Lenses MCP Server makes your Kafka infrastructure accessible to AI tools and agents. It implements the [Model Context Protocol](https://modelcontextprotocol.io/) standard, allowing Claude, Cursor and other AI applications to safely interact with Lenses and your multi-Kafka multi-vendor estate.

#### MCP components

* **MCP Client**: Your AI tool (Claude, Cursor, etc.) that initiates requests. The client discovers what the MCP server can do and calls tools with parameters you specify in natural language.
* **MCP Server**: The Lenses MCP Server runs locally or in your infrastructure and acts as a bridge to Lenses HQ. It:
  * Validates OAuth tokens or API keys
  * Executes tools against Lenses APIs
  * Returns results formatted for AI consumption
* **MCP Tools**: Each capability exposed by the MCP Server (topics, connectors, SQL queries, environments, etc.) is a "tool" that your AI assistant can call.

#### Authentication and security

The MCP Server supports **OAuth 2.1** as the primary authentication method, providing:

* **Secure token-based authentication** without sharing static keys
* **Scope-based authorization** (read, write, delete)
* **Token introspection** for every request
* **Enterprise security** suitable for production

API keys are supported as a fallback for backward compatibility and local testing.

See [OAuth 2.1 Configuration](https://docs.lenses.io/latest/user-guide/using/security/oauth-2.1) for details on setting up OAuth with the MCP server.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lenses.io/latest/user-guide/6.2-user-guide/getting-started/concepts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
