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
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • 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
  • DataLens neuroanalyst
  • Gallery in DataLens
    • How to use the Public API
    • Versioning
    • Release notes
  • Audit Trails events

In this article:

  • MCP server
  • Environment requirements
  • Use cases
  1. DataLens Public API
  2. How to use the Public API

Working with the Public API

Written by
Yandex Cloud
Updated at August 20, 2026
View in Markdown
  • MCP server
    • Environment requirements
    • Use cases

DataLens provides a public API, https://api.datalens.tech, to automate operations with dashboards, charts, datasets, and connections.

The DataLens Public API offers methods similar to those used in the DataLens web interface. This API is described using the OpenAPI specification and authenticated via Yandex Cloud IAM tokens.

When using the API, please be aware of the limits in place.

To use the API, you need an IAM token and an organization ID.

For example, substitute your <IAM_TOKEN>, <ORG_ID>, and <ENTRY_ID> values into the following request to get a list of all objects related to the entity:

curl -X 'POST' \
  'https://api.datalens.tech/rpc/getEntriesRelations' \
  -H 'accept: application/json' \
  -H 'x-dl-api-version: 1' \
  -H 'Authorization: Bearer <IAM_TOKEN>' \
  -H 'x-dl-org-id: <ORG_ID>' \
  -H 'Content-Type: application/json' \
  -d '{
  "entryIds": [
    "<ENTRY_ID>"
  ]
}'

MCP serverMCP server

The DataLens MCP server provides LLM agents with access to the public API.

The server uses the MCP protocol via stdio. Add it to the MCP client configuration using one of the following methods:

  • Via npx (recommended). Run this request for npx to download the published package, no manual installation or compilation required:

    {
      "mcpServers": {
        "datalens": {
          "command": "npx",
          "args": ["-y", "@datalens-tech/mcp@latest"],
          "env": {
            "DATALENS_ORG_ID": "<org-id>"
          }
        }
      }
    }
    
  • Using global installation. Install the package once, then use the datalens-mcp command:

    npm install -g @datalens-tech/mcp
    
    {
      "mcpServers": {
        "datalens": {
          "command": "datalens-mcp",
          "env": {
            "DATALENS_ORG_ID": "<org-id>"
          }
        }
      }
    }
    
  • From a local build. Use this option if you cloned the repository. Compile it first:

    npm ci
    npm run build
    

    Then point the client to the compiled file:

    {
      "mcpServers": {
        "datalens": {
          "command": "node",
          "args": ["/absolute/path/to/datalens-mcp/dist/index.js"],
          "env": {
            "DATALENS_ORG_ID": "<org-id>"
          }
        }
      }
    }
    

Where DATALENS_ORG_ID is your organization's ID.

By default, the server runs yc iam create-token to get an IAM token.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

Additional yc settings:

  • DATALENS_YC_PROFILE: Use a specific yc profile instead of the active one.
  • DATALENS_YC_BIN: Full path to the yc binary file if not located in PATH.

If you cannot run yc (e.g., in an isolated environment), you can manage the IAM token yourself: install DATALENS_YC_STATIC_AUTH=1 and put the token in DATALENS_API_AUTH_HEADER="Bearer <iam-token>". The value will be sent on each request, unmodified, and yc will never be called.

Note

IAM tokens expire in 12 hours. With this approach, it is up to you to update DATALENS_API_AUTH_HEADER and restart the server before the token expires.

Environment requirementsEnvironment requirements

To run an MCP server alongside an agent or MCP client, make sure your environment meets these prerequisites:

  • Node.js version 18 or higher.
  • npm and npx, accessible via PATH (usually bundled with Node.js).
  • yc CLI if using the recommended authorization method via Yandex Cloud. When authorizing with a yc static token, the CLI is not required.

Use casesUse cases

  • Use cases on GitHub

Was the article helpful?

Previous
Service plans before December 1, 2025
Next
Versioning
© 2026 Direct Cursus Technology L.L.C.