# ydb-mcp

> ydb-mcp is an open-source MCP server for databases. MCP server that lets AI clients run queries and inspect schemas in YDB databases. It is available on CLI, API, Linux, macOS and Windows.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Linux, macOS, Windows
- **Repository:** https://github.com/ydb-platform/ydb-mcp
- **GitHub stars:** 29
- **License:** Apache-2.0
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-01

## About

YDB MCP exposes a YDB database to any client that speaks the Model Context Protocol, so a language model can run SQL, check query plans, browse directories and inspect table definitions without custom glue code. It connects over gRPC or gRPCS and supports anonymous, login and password, access token and service account authentication.

Queries run in read-only snapshot mode by default, and YDB itself rejects writes in that mode. Writes must be turned on explicitly with a flag or environment variable. Developers can also subclass the server to publish a fixed set of domain-specific tools in place of raw SQL execution, and can switch off the built-in tools they do not want exposed.

It suits teams that run YDB and want assistants to answer data questions, explore schemas or prototype queries from an editor or chat client.

## Features

- **Core SQL tools:** Provides tools to run plain and parameterized SQL queries against a YDB database.
- **Query plan explanation:** Returns execution plans for queries so their performance can be reviewed.
- **Schema browsing:** Lists directories and describes tables and other paths within a YDB database.
- **Read-only by default:** Runs queries in snapshot read-only transactions unless writes are explicitly enabled.
- **Multiple authentication modes:** Supports anonymous, login and password, access token and service account access.
- **TLS connections:** Connects over grpcs with a custom root certificate file when needed.
- **Subclassable server:** Lets developers add their own tools and turn off built-in ones for a restricted server.

## Good for

- Letting an assistant answer questions about data stored in YDB
- Exploring table schemas and directory layouts from a chat client
- Reviewing query execution plans during development
- Building a restricted, domain-specific MCP server on top of a YDB database

## Tools

From the tool list in its README, going by the names, all 7 tools only read data. From the server's own tool labels and tool names; not verified by us.

- `ydb_query` (name suggests: reads): Run a SQL query against a YDB database
- `ydb_query_with_params` (name suggests: reads): Run a parameterized SQL query with JSON parameters
- `ydb_explain_query` (name suggests: reads): Explain a SQL query and return the execution plan
- `ydb_explain_query_with_params` (name suggests: reads): Explain a parameterized SQL query
- `ydb_list_directory` (name suggests: reads): List directory contents in YDB
- `ydb_describe_path` (name suggests: reads): Get detailed information about a YDB path
- `ydb_status` (name suggests: reads): Get the current status of the YDB connection

## FAQ

### Can the server modify data by default?

No. Queries run in read-only mode by default, and writes require setting the allow-write option or the YDB_ALLOW_WRITE environment variable.

### How is the server installed?

It can be run with uvx, pipx, or installed from PyPI with pip and started as a Python module.

### Which authentication methods are supported?

Anonymous access, login and password, access token and service account keys. Service account support needs the yandexcloud package installed separately.

### Can I restrict which tools are exposed?

Yes. By subclassing the server you can add custom tools and disable any of the built-in generic tools.

### Is ydb-mcp free?

Yes. ydb-mcp is open source, so you can use and self-host it for free.

### What are the best alternatives to ydb-mcp?

The closest alternatives to ydb-mcp are SmartDB_MCP, sql-query-mcp, xiyan_mcp_server, db-mcp (SQLite MCP Server) and mysql_mcp_server.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [SmartDB_MCP](https://ai-powered.com/mcp/smartdb-mcp): SmartDB_MCP is an open-source MCP server for databases.
- [sql-query-mcp](https://ai-powered.com/mcp/sql-query-mcp): sql-query-mcp is an open-source MCP server for databases.
- [xiyan_mcp_server](https://ai-powered.com/mcp/xiyan-mcp-server): xiyan_mcp_server is an open-source MCP server for databases.
- [db-mcp (SQLite MCP Server)](https://ai-powered.com/mcp/db-mcp-sqlite-mcp-server): db-mcp (SQLite MCP Server) is an open-source MCP server for databases.
- [mysql_mcp_server](https://ai-powered.com/mcp/mysql-mcp-server-4): mysql_mcp_server is an open-source MCP server for databases.
- [db-mcp-server](https://ai-powered.com/mcp/db-mcp-server-2): db-mcp-server is an open-source MCP server for databases.
- [simple_snowflake_mcp](https://ai-powered.com/mcp/simple-snowflake-mcp): simple_snowflake_mcp is an open-source MCP server for databases.
- [Db Access MCP](https://ai-powered.com/mcp/db-access-mcp): Db Access MCP is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/ydb-mcp
