Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex DataLens
    • Using DataLens with AI agents
    • AI agents in DataLens
    • DataLens neuroanalyst
  • DataLens Gallery
  • Audit Trails events

In this article:

  • Getting started
  • Connect DataLens to the AI agent
  • Install skills
  • Send your request
  • Common scenarios
  • Useful links
  1. AI agents
  2. Using DataLens with AI agents

Using Yandex DataLens with AI agents

Written by
Yandex Cloud
Updated at October 27, 2026
View in Markdown
  • Getting started
  • Connect DataLens to the AI agent
  • Install skills
  • Send your request
    • Common scenarios
  • Useful links

You can use AI agents to work with DataLens. These include Claude Code, Codex, OpenCode, and more. To do this, you need to connect DataLens to an AI agent using an MCP server or Python SDK and install skills.

Getting startedGetting started

  • Make sure you have access to Yandex Cloud and DataLens.
  • Prepare the object in DataLens the AI agent will use: create a workbook or select an existing one. To test the chart creation scenario, your workbook must contain an accessible dataset.
  • Make sure you have the permissions to edit this workbook and the objects the AI agent will use.

Note

We do not recommend using both MCP and SDK for the same task.

Connect DataLens to the AI agentConnect DataLens to the AI agent

To connect DataLens to your AI agent, add your MCP server to the AI agent, or install datalens-sdk, a type-safe Python SDK for the DataLens API.

Claude Code
Codex
OpenCode
Python SDK

Add the server by running this command:

claude mcp add datalens \
  --env DATALENS_ORG_ID=<organization_ID> \
  -- npx -y @datalens-tech/mcp@latest

Alternatively, describe the server in the .mcp.json file in the project's root folder to make this configuration general for the command:

{
  "mcpServers": {
    "datalens": {
      "command": "npx",
      "args": ["-y", "@datalens-tech/mcp@latest"],
      "env": {
        "DATALENS_ORG_ID": "<organization_ID>"
      }
    }
  }
}

The same configuration format is used in Claude Desktop in the claude_desktop_config.json file.

Add this section to the ~/.codex/config.toml file:

[mcp_servers.datalens]
command = "npx"
args = ["-y", "@datalens-tech/mcp@latest"]

[mcp_servers.datalens.env]
DATALENS_ORG_ID = "<organization_ID>"

Add the mcp section to the opencode.json file:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "datalens": {
      "type": "local",
      "command": ["npx", "-y", "@datalens-tech/mcp@latest"],
      "environment": {
        "DATALENS_ORG_ID": "<organization_ID>"
      }
    }
  }
}

Tip

We recommend using npx for running Node.js, as the package is downloaded on demand and does not require installation. Alternatives include a local build from the repository or global installation using npm install -g @datalens-tech/mcp and the datalens-mcp command.

Run this command:

pip install datalens-sdk

Example

This example assumes that the user uses an active Yandex Cloud CLI profile and refreshes IAM tokens themselves:

from datalens_sdk import DataLensClientYC

with DataLensClientYC() as client:
    dataset = client.get.dataset(by_id="<dataset_ID>")
    print(dataset.name)

Main features:

  • client.get: Downloading objects, such as datasets, charts, dashboards, workbooks, and collections.
  • transfer_enabled: Type-safe fluent builders to create objects.
  • Operations on objects: .rename(), .update(), .delete().
  • Exporting objects' JSON shots to files and creating objects from shots (client.raw).
  • Exporting a dashboard together with its dependencies, i.e., charts and datasets.

Authorization methods:

  • Yandex Cloud CLI profile (default).
  • Service account key, static IAM token.

Warning

The SDK is currently at the alpha version stage (0.x): until release 1.0, minor versions may include incompatible updates. Therefore, we recommend using the SDK together with the datalens-sdk skill for working with AI agents.

Note

The MCP server and SDK support static authorization with a ready-made IAM token. Therefore, you can use AI agents when the Yandex Cloud CLI is not accessible, e.g., in an isolated runtime. The IAM token lifetime is 12 hours. You should refresh it yourself.

Install skillsInstall skills

Install datalens-skills for your AI agent to consider the DataLens object model and select task-appropriate tools.

Universal method
Claude Code
Codex
Manually

The skills CLI detects installed AI agents automatically.

Run the following commands:

npx skills add datalens-tech/datalens-skills --skill datalens
npx skills add datalens-tech/datalens-skills --skill datalens-sdk

Tip

Use these flags:

  • --agent '*': Install all detected AI agents.
  • -g: Globally for all projects.
  • --list: Show the list of available skills.

The repository works as a plugin marketplace.

Run the following commands:

/plugin marketplace add datalens-tech/datalens-skills
/plugin install datalens-skills@datalens
  1. Install the CLI version 0.142.0 or higher.

  2. Run these installation commands:

    codex plugin marketplace add datalens-tech/datalens-skills
    codex plugin add datalens-skills@datalens
    

    When installed using a plugin, skill names are prefixed, e.g., datalens-skills:datalens-sdk.

Copy the relevant folders from skills/ to the folder scanned by the AI agent:

AI agent In projects Globally
Claude Code .claude/skills/ ~/.claude/skills/
Codex .agents/skills/ ~/.agents/skills/
OpenCode .opencode/skills/ ~/.config/opencode/skills/

Tip

The .agents/skills/ folder is vendor-neutral: both Codex and OpenCode can read it. OpenCode can also read .claude/skills/; therefore, one installation is often enough for multiple AI agents.

Send your requestSend your request

After connecting DataLens to the AI agent and installing the skills, write a natural language task and specify the IDs of the objects to use.

  1. Run a new AI agent session.
  2. Send your request via the AI agent.

Common scenariosCommon scenarios

Below you can find examples of requests to an AI agent with installed skills and an MCP server.

  • Dependency audit

    Request:

    Find all charts and dashboards that use <dataset_ID>.
    

    Result: The AI agent will call the navigation commands and Relations API via the MCP.

  • Content cloning

    Request:

    Clone <dashboard_ID> with all its charts and datasets
    to <workbook_ID>.
    

    Result: The AI agent will write an SDK script with dependency export.

  • Creating from scratch

    Request:

    Connect to the database, create a dataset with a calculated field for the margin,
    and build a dashboard with sales by region.
    

    Result: The AI agent will create the following chain: connection → dataset → charts → dashboard.

  • Bulk changes

    An SDK task: a loop for objects with typed updates.

    Request:

    In all the workbook's datasets, rename the _revenue_ field to _Revenue_.
    

    Result: The AI agent will rename the specified fields.

  • AI report

    Request:

    Create an HTML report on the quarter results and publish it in DataLens.
    

    Result: The datalens-html-pages skill will let the agent create, validate, and publish a page.

Useful linksUseful links

  • AI agents in Yandex DataLens
  • Working with the Public API in Yandex DataLens
  • @datalens-tech/mcp MCP server
  • npm
  • datalens-skills collection
  • Python SDK datalens-sdk
  • Agent Skills standard
  • Model Context Protocol

Was the article helpful?

Previous
Errors and warnings during export and import
Next
AI agents in DataLens
© 2026 Direct Cursus Technology L.L.C.