YDB MCP

Official
by ydb-platform
Apache 2.0
17
  • Linux
  • Apple

Integrations

  • Mentioned as part of the uvx tool, which is described as 'an alias for uv run tool' from astral.sh for running Python applications without explicitly installing them

  • Used as the primary development tool, providing commands for development tasks

  • Used as a deployment method for running the MCP server without explicit installation

YDB MCP


YDB模型上下文协议服务器。它允许从任何支持 MCP 的LLM操作 YDB 数据库。此集成支持 AI 驱动的数据库操作以及与 YDB 实例的自然语言交互。

用法

通过 uvx

uvxuv run tool的别名,它允许你运行各种 Python 应用程序,而无需显式安装它们。以下是如何使用uvx配置 YDB MCP 的示例。

示例:使用匿名身份验证
{ "mcpServers": { "ydb": { "command": "uvx", "args": [ "ydb-mcp", "--ydb-endpoint", "grpc://localhost:2136/local" ] } } }
示例:使用登录/密码验证

要使用登录/密码验证,请指定--ydb-auth-mode--ydb-login--ydb-password参数:

{ "mcpServers": { "ydb": { "command": "uvx", "args": [ "ydb-mcp", "--ydb-endpoint", "grpc://localhost:2136/local", "--ydb-auth-mode", "login-password", "--ydb-login", "<your-username>", "--ydb-password", "<your-password>" ] } } }

通过 pipx

pipx允许您从 PyPI 运行各种应用程序,而无需逐个显式安装。但是,必须先安装pipx。以下是如何使用pipx配置 YDB MCP 的示例。

示例:使用匿名身份验证
{ "mcpServers": { "ydb": { "command": "pipx", "args": [ "run", "ydb-mcp", "--ydb-endpoint", "grpc://localhost:2136/local" ] } } }
示例:使用登录/密码验证

要使用登录/密码验证,请指定--ydb-auth-mode--ydb-login--ydb-password参数:

{ "mcpServers": { "ydb": { "command": "pipx", "args": [ "run", "ydb-mcp", "--ydb-endpoint", "grpc://localhost:2136/local", "--ydb-auth-mode", "login-password", "--ydb-login", "<your-username>", "--ydb-password", "<your-password>" ] } } }

通过 pip

YDB MCP 可以使用Python 的软件包安装程序pip进行安装。该软件包可在 PyPI 上获取,并包含所有必要的依赖项。

pip install ydb-mcp

要开始使用 YDB MCP,您需要配置 MCP 客户端以与 YDB 实例通信。以下是示例配置文件,您可以根据自己的设置进行自定义,然后将其添加到 MCP 客户端的设置中。Python 解释器的路径可能也需要调整到安装了ydb-mcp软件包的正确虚拟环境。

示例:使用匿名身份验证
{ "mcpServers": { "ydb": { "command": "python3", "args": [ "-m", "ydb_mcp", "--ydb-endpoint", "grpc://localhost:2136/local" ] } } }
示例:使用登录/密码验证

要使用登录/密码验证,请指定--ydb-auth-mode--ydb-login--ydb-password参数:

{ "mcpServers": { "ydb": { "command": "python3", "args": [ "-m", "ydb_mcp", "--ydb-endpoint", "grpc://localhost:2136/local", "--ydb-auth-mode", "login-password", "--ydb-login", "<your-username>", "--ydb-password", "<your-password>" ] } } }

可用工具

YDB MCP 提供以下与 YDB 数据库交互的工具:

  • ydb_query :针对 YDB 数据库运行 SQL 查询
    • 参数:
      • sql :要执行的 SQL 查询字符串
  • ydb_query_with_params :使用 JSON 参数运行参数化 SQL 查询
    • 参数:
      • sql :带有参数占位符的 SQL 查询字符串
      • params :包含参数值的 JSON 字符串
  • ydb_list_directory :列出 YDB 中的目录内容
    • 参数:
      • path :要列出的 YDB 目录路径
  • ydb_describe_path :获取有关 YDB 路径(表、目录等)的详细信息
    • 参数:
      • path :要描述的 YDB 路径
  • ydb_status :获取 YDB 连接的当前状态

发展

该项目使用Make作为其主要开发工具,为常见的开发任务提供一致的界面。

可用的 Make 命令

该项目包含一个全面的 Makefile,其中包含用于开发任务的各种命令。每个命令都旨在简化开发工作流程并确保代码质量:

  • make all :按顺序运行 clean、lint 和 test(默认目标)
  • make clean :删除所有构建工件和临时文件
  • make test :使用 pytest 运行所有测试
    • 可以配置环境变量:
      • LOG_LEVEL (默认值:WARNING)- 控制测试输出详细程度(DEBUG、INFO、WARNING、ERROR)
  • make unit-tests :仅运行具有详细输出的单元测试
    • 可以配置环境变量:
      • LOG_LEVEL (默认值:WARNING)- 控制测试输出详细程度(DEBUG、INFO、WARNING、ERROR)
  • make integration-tests :仅运行具有详细输出的集成测试
    • 可以配置环境变量:
      • YDB_ENDPOINT (默认值:grpc://localhost:2136)
      • YDB_DATABASE (默认值:/local)
      • MCP_HOST (默认值:127.0.0.1)
      • MCP_PORT (默认值:8989)
      • LOG_LEVEL (默认值:WARNING)- 控制测试输出详细程度(DEBUG、INFO、WARNING、ERROR)
  • make run-server :启动 YDB MCP 服务器
    • 可以配置环境变量:
      • YDB_ENDPOINT (默认值:grpc://localhost:2136)
      • YDB_DATABASE (默认值:/local)
    • 可以使用ARGS="your args"传递附加参数
  • make lint :运行所有 linting 检查(flake8、mypy、black、isort)
  • make format :使用 black 和 isort 格式化代码
  • make install :以开发模式安装包
  • make dev :以开发模式安装包含所有开发依赖项的软件包

测试详细程度控制

默认情况下,测试以最小输出(WARNING 级别)运行,以保持输出清晰。您可以使用LOG_LEVEL环境变量控制测试输出的详细程度:

# Run all tests with debug output make test LOG_LEVEL=DEBUG # Run integration tests with info output make integration-tests LOG_LEVEL=INFO # Run unit tests with warning output (default) make unit-tests LOG_LEVEL=WARNING

可用的日志级别:

  • DEBUG :显示所有调试消息,对详细测试流程有用
  • INFO :显示信息性消息及以上
  • WARNING :仅显示警告和错误(默认)
  • ERROR :仅显示错误消息

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

YDB 数据库的模型上下文协议服务器,支持任何支持 MCP 的 LLM 的 AI 驱动数据库操作以及与 YDB 实例的自然语言交互。

  1. 用法
    1. 通过 uvx
    2. 通过 pipx
    3. 通过 pip
  2. 可用工具
    1. 发展
      1. 可用的 Make 命令
      2. 测试详细程度控制

    Related MCP Servers

    • -
      security
      F
      license
      -
      quality
      A generic Model Context Protocol framework for building AI-powered applications that provides standardized ways to create MCP servers and clients for integrating LLMs with support for Ollama and Supabase.
      Last updated -
      TypeScript
    • -
      security
      A
      license
      -
      quality
      A Model Context Protocol (MCP) server that wraps the dbt CLI tool, enabling AI coding agents to interact with dbt projects through standardized MCP tools. Developed by Mammoth Growth.
      Last updated -
      8
      Python
      MIT License
      • Linux
      • Apple
    • -
      security
      F
      license
      -
      quality
      An integration server implementing the Model Context Protocol that enables LLM applications to interact with Milvus vector database functionality, allowing vector search, collection management, and data operations through natural language.
      Last updated -
      91
      Python
      • Apple
    • -
      security
      A
      license
      -
      quality
      A Model Context Protocol (MCP) server that enables AI assistants to interact with MySQL databases by executing SQL queries and checking database connectivity.
      Last updated -
      TypeScript
      MIT License
      • Apple
      • Linux

    View all related MCP servers

    ID: 5f9hipc1tz