Skip to main content

Model Context Protocol server for YDB DBMS

Project description

YDB MCP

Model Context Protocol server for YDB. It allows to work with YDB databases from any LLM that supports MCP. This integration enables AI-powered database operations and natural language interactions with your YDB instances.

Installation

YDB MCP can be installed using pip, Python's package installer. The package is available on PyPI and includes all necessary dependencies.

pip install ydb-mcp

Usage

To get started with YDB MCP, you'll need to configure your MCP client to communicate with the YDB instance. Below is an example configuration file that you can customize according to your setup and then put into MCP client's settings.

{
  "mcpServers": {
    "ydb": {
      "command": "python3",
      "args": [
        "-m", "ydb_mcp",
        "--ydb-endpoint", "grpc://localhost:2136/local"
      ]
    }
  }
}

Example: Using login/password authentication

To use login/password authentication, specify the --ydb-auth-mode, --ydb-login, and --ydb-password arguments:

{
  "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>"
      ]
    }
  }
}

Available tools

YDB MCP provides the following tools for interacting with YDB databases:

  • ydb_query: Run a SQL query against a YDB database

    • Parameters:
      • sql: SQL query string to execute
  • ydb_query_with_params: Run a parameterized SQL query with JSON parameters

    • Parameters:
      • sql: SQL query string with parameter placeholders
      • params: JSON string containing parameter values
  • ydb_list_directory: List directory contents in YDB

    • Parameters:
      • path: YDB directory path to list
  • ydb_describe_path: Get detailed information about a YDB path (table, directory, etc.)

    • Parameters:
      • path: YDB path to describe
  • ydb_status: Get the current status of the YDB connection

Development

The project uses Make as its primary development tool, providing a consistent interface for common development tasks.

Available Make Commands

The project includes a comprehensive Makefile with various commands for development tasks. Each command is designed to streamline the development workflow and ensure code quality:

  • make all: Run clean, lint, and test in sequence (default target)
  • make clean: Remove all build artifacts and temporary files
  • make test: Run all tests using pytest
    • Can be configured with environment variables:
      • LOG_LEVEL (default: WARNING) - Control test output verbosity (DEBUG, INFO, WARNING, ERROR)
  • make unit-tests: Run only unit tests with verbose output
    • Can be configured with environment variables:
      • LOG_LEVEL (default: WARNING) - Control test output verbosity (DEBUG, INFO, WARNING, ERROR)
  • make integration-tests: Run only integration tests with verbose output
    • Can be configured with environment variables:
      • YDB_ENDPOINT (default: grpc://localhost:2136)
      • YDB_DATABASE (default: /local)
      • MCP_HOST (default: 127.0.0.1)
      • MCP_PORT (default: 8989)
      • LOG_LEVEL (default: WARNING) - Control test output verbosity (DEBUG, INFO, WARNING, ERROR)
  • make run-server: Start the YDB MCP server
    • Can be configured with environment variables:
      • YDB_ENDPOINT (default: grpc://localhost:2136)
      • YDB_DATABASE (default: /local)
    • Additional arguments can be passed using ARGS="your args"
  • make lint: Run all linting checks (flake8, mypy, black, isort)
  • make format: Format code using black and isort
  • make install: Install the package in development mode
  • make dev: Install the package in development mode with all development dependencies

Test Verbosity Control

By default, tests run with minimal output (WARNING level) to keep the output clean. You can control the verbosity of test output using the LOG_LEVEL environment variable:

# 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

Available log levels:

  • DEBUG: Show all debug messages, useful for detailed test flow
  • INFO: Show informational messages and above
  • WARNING: Show only warnings and errors (default)
  • ERROR: Show only error messages

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ydb_mcp-0.1.0.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ydb_mcp-0.1.0-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file ydb_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: ydb_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for ydb_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6560c44020c76df548d7d079c4a9bc330317fbe23510560dfb4ad02c2d665db7
MD5 2a4e594ce6eddba8e3638c969eb96c3e
BLAKE2b-256 e98f9f97597b375bb2a4ac730f67200366192f92abca2b151180a8f18cd318be

See more details on using hashes here.

File details

Details for the file ydb_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ydb_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for ydb_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 676aa28e50d79427fa2113653985c820b1a287b0e3d822c378150430d4c88bc2
MD5 0e473e0b8cbd51e87c7f7192ef81a8b6
BLAKE2b-256 e241a5acfae4a530aaeec31dd7a03630af04f290593e0bfcfab0a3285fc9c7fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page