YDB MCP
๐ License
๐ PyPI version
YDB๋ฅผ ์ํ Model Context Protocol ์๋ฒ์ ๋๋ค. MCP๋ฅผ ์ง์ํ๋ ๋ชจ๋ LLM์์ YDB ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์์ ํ ์ ์๊ฒ ํด์ค๋๋ค. ์ด ํตํฉ์ ํตํด YDB ์ธ์คํด์ค์ ๋ํ AI ๊ธฐ๋ฐ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์์ ๋ฐ ์์ฐ์ด ์ํธ์์ฉ์ด ๊ฐ๋ฅํด์ง๋๋ค.
์ฌ์ฉ๋ฒ
uvx ์ฌ์ฉ
uv run tool์ ๋ณ์นญ์ธ uvx๋ฅผ ์ฌ์ฉํ๋ฉด ๋ช
์์ ์ผ๋ก ์ค์นํ์ง ์๊ณ ๋ ๋ค์ํ ํ์ด์ฌ ์ ํ๋ฆฌ์ผ์ด์
์ ์คํํ ์ ์์ต๋๋ค. ์๋๋ uvx๋ฅผ ์ฌ์ฉํ์ฌ YDB MCP๋ฅผ ๊ตฌ์ฑํ๋ ์์์
๋๋ค.
์์: ์ต๋ช ์ธ์ฆ ์ฌ์ฉ
{
"mcpServers": {
"ydb": {
"command": "uvx",
"args": [
"ydb-mcp",
"--ydb-endpoint", "grpc://localhost:2136",
"--ydb-database", "/local"
]
}
}
}pipx ์ฌ์ฉ
pipx๋ฅผ ์ฌ์ฉํ๋ฉด ๊ฐ๊ฐ ๋ช
์์ ์ผ๋ก ์ค์นํ์ง ์๊ณ ๋ PyPI์์ ๋ค์ํ ์ ํ๋ฆฌ์ผ์ด์
์ ์คํํ ์ ์์ต๋๋ค. ๋จ, ๋จผ์ ์ค์น๋์ด ์์ด์ผ ํฉ๋๋ค. ์๋๋ pipx๋ฅผ ์ฌ์ฉํ์ฌ YDB MCP๋ฅผ ๊ตฌ์ฑํ๋ ์์์
๋๋ค.
์์: ์ต๋ช ์ธ์ฆ ์ฌ์ฉ
{
"mcpServers": {
"ydb": {
"command": "pipx",
"args": [
"run", "ydb-mcp",
"--ydb-endpoint", "grpc://localhost:2136",
"--ydb-database", "/local"
]
}
}
}pip ์ฌ์ฉ
YDB MCP๋ Python ํจํค์ง ์ค์น ํ๋ก๊ทธ๋จ์ธ pip๋ฅผ ์ฌ์ฉํ์ฌ ์ค์นํ ์ ์์ต๋๋ค. ํจํค์ง๋ PyPI์์ ์ ๊ณต๋๋ฉฐ ํ์ํ ๋ชจ๋ ์ข
์์ฑ์ ํฌํจํฉ๋๋ค.
pip install ydb-mcpYDB MCP๋ฅผ ์์ํ๋ ค๋ฉด YDB ์ธ์คํด์ค์ ํต์ ํ๋๋ก MCP ํด๋ผ์ด์ธํธ๋ฅผ ๊ตฌ์ฑํด์ผ ํฉ๋๋ค. ์๋๋ ์ค์ ์ ๋ฐ๋ผ ์ฌ์ฉ์ ์ ์ํ๊ณ MCP ํด๋ผ์ด์ธํธ ์ค์ ์ ๋ฃ์ ์ ์๋ ๊ตฌ์ฑ ํ์ผ ์์์
๋๋ค. ํ์ด์ฌ ์ธํฐํ๋ฆฌํฐ ๊ฒฝ๋ก๋ ydb-mcp ํจํค์ง๊ฐ ์ค์น๋ ์ฌ๋ฐ๋ฅธ ๊ฐ์ ํ๊ฒฝ์ผ๋ก ์กฐ์ ํด์ผ ํ ์๋ ์์ต๋๋ค.
์์: ์ต๋ช ์ธ์ฆ ์ฌ์ฉ
{
"mcpServers": {
"ydb": {
"command": "python3",
"args": [
"-m", "ydb_mcp",
"--ydb-endpoint", "grpc://localhost:2136",
"--ydb-database", "/local"
]
}
}
}์ธ์ฆ
์ฌ์ฉ ๋ฐฉ๋ฒ(uvx, pipx ๋๋ pip)์ ๊ด๊ณ์์ด YDB ์ค์น์ ๋ํ ์ธ์ฆ์ ๊ตฌ์ฑํ ์ ์์ต๋๋ค. ์ด๋ฅผ ์ํด ํน์ ๋ช
๋ น์ค ์ธ์๋ฅผ ์ ๋ฌํ์ญ์์ค.
๋ก๊ทธ์ธ/๋น๋ฐ๋ฒํธ ์ธ์ฆ ์ฌ์ฉ
๋ก๊ทธ์ธ/๋น๋ฐ๋ฒํธ ์ธ์ฆ์ ์ฌ์ฉํ๋ ค๋ฉด --ydb-auth-mode, --ydb-login ๋ฐ --ydb-password ์ธ์๋ฅผ ์ง์ ํ์ญ์์ค:
{
"mcpServers": {
"ydb": {
"command": "uvx",
"args": [
"ydb-mcp",
"--ydb-endpoint", "grpc://localhost:2136",
"--ydb-database", "/local",
"--ydb-auth-mode", "login-password",
"--ydb-login", "<your-username>",
"--ydb-password", "<your-password>"
]
}
}
}์ก์ธ์ค ํ ํฐ ์ธ์ฆ ์ฌ์ฉ
์ก์ธ์ค ํ ํฐ ์ธ์ฆ์ ์ฌ์ฉํ๋ ค๋ฉด --ydb-auth-mode ๋ฐ --ydb-access-token ์ธ์๋ฅผ ์ง์ ํ์ญ์์ค:
{
"mcpServers": {
"ydb": {
"command": "uvx",
"args": [
"ydb-mcp",
"--ydb-endpoint", "grpc://localhost:2136",
"--ydb-database", "/local",
"--ydb-auth-mode", "access-token",
"--ydb-access-token", "qwerty123"
]
}
}
}์๋น์ค ๊ณ์ ์ธ์ฆ ์ฌ์ฉ
์๋น์ค ๊ณ์ ์ธ์ฆ์ ์ฌ์ฉํ๋ ค๋ฉด --ydb-auth-mode ๋ฐ --ydb-sa-key-file ์ธ์๋ฅผ ์ง์ ํ์ญ์์ค:
{
"mcpServers": {
"ydb": {
"command": "uvx",
"args": [
"ydb-mcp",
"--ydb-endpoint", "grpc://localhost:2136",
"--ydb-database", "/local",
"--ydb-auth-mode", "service-account",
"--ydb-sa-key-file", "~/sa_key.json"
]
}
}
}Related MCP server: GreptimeDB MCP Server
์ฌ์ฉ ๊ฐ๋ฅํ ๋๊ตฌ
YDB MCP๋ YDB ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ํธ์์ฉํ๊ธฐ ์ํด ๋ค์ ๋๊ตฌ๋ฅผ ์ ๊ณตํฉ๋๋ค:
ydb_query: YDB ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋ํด SQL ์ฟผ๋ฆฌ ์คํ๋งค๊ฐ๋ณ์:
sql: ์คํํ SQL ์ฟผ๋ฆฌ ๋ฌธ์์ด
ydb_query_with_params: JSON ๋งค๊ฐ๋ณ์๋ฅผ ์ฌ์ฉํ์ฌ ๋งค๊ฐ๋ณ์ํ๋ SQL ์ฟผ๋ฆฌ ์คํ๋งค๊ฐ๋ณ์:
sql: ๋งค๊ฐ๋ณ์ ์๋ฆฌ ํ์์๊ฐ ์๋ SQL ์ฟผ๋ฆฌ ๋ฌธ์์ดparams: ๋งค๊ฐ๋ณ์ ๊ฐ์ด ํฌํจ๋ JSON ๋ฌธ์์ด
ydb_explain_query: SQL ์ฟผ๋ฆฌ ์ค๋ช (์คํ ๊ณํ ๋ฐํ)๋งค๊ฐ๋ณ์:
sql: ์ค๋ช ํ SQL ์ฟผ๋ฆฌ ๋ฌธ์์ด
ydb_explain_query_with_params: ๋งค๊ฐ๋ณ์ํ๋ SQL ์ฟผ๋ฆฌ ์ค๋ช๋งค๊ฐ๋ณ์:
sql: ๋งค๊ฐ๋ณ์ ์๋ฆฌ ํ์์๊ฐ ์๋ SQL ์ฟผ๋ฆฌ ๋ฌธ์์ดparams: JSON ๋ฌธ์์ด
ydb_list_directory: YDB์ ๋๋ ํ ๋ฆฌ ๋ด์ฉ ๋์ด๋งค๊ฐ๋ณ์:
path: ๋์ดํ YDB ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก
ydb_describe_path: YDB ๊ฒฝ๋ก(ํ ์ด๋ธ, ๋๋ ํ ๋ฆฌ ๋ฑ)์ ๋ํ ์์ธํ ์ ๋ณด ๊ฐ์ ธ์ค๊ธฐ๋งค๊ฐ๋ณ์:
path: ์ค๋ช ํ YDB ๊ฒฝ๋ก
ydb_status: ํ์ฌ YDB ์ฐ๊ฒฐ ์ํ ๊ฐ์ ธ์ค๊ธฐ
์ฌ์ฉ์ ์ ์ MCP ์๋ฒ ๊ตฌ์ถ
YDBMCPServer๋ ์๋ธํด๋์ฑ๋๋๋ก ์ค๊ณ๋์์ต๋๋ค. ์ค์ ๋ YDB ์ฐ๊ฒฐ ์์ ์์ ๋ง์ ๋๊ตฌ๋ฅผ ์ถ๊ฐํ ์ ์์ผ๋ฉฐ, ์ ํ์ ์ผ๋ก ๋ด์ฅ๋ ์ผ๋ฐ ๋๊ตฌ๋ฅผ ๋นํ์ฑํํ์ฌ ์ ํ๋ฆฌ์ผ์ด์
์ ํ์ํ ์ฟผ๋ฆฌ๋ง ๋
ธ์ถํ ์ ์์ต๋๋ค.
์ ์ฌ์ฉ์ ์ ์ ์๋ฒ๋ฅผ ๊ตฌ์ถํ๋์?
๋ณด์ โ ์์์ SQL ์คํ์ ๋ ธ์ถํ๋ ๋์ LLM์ ๊ณ ์ ๋ ์ฝ๊ธฐ ์ ์ฉ ์ฟผ๋ฆฌ ์ธํธ๋ก ์ ํํฉ๋๋ค.
๋๋ฉ์ธ ํน์์ฑ โ ์์ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๊ธฐ๋ณธ ์์๊ฐ ์๋ ๋น์ฆ๋์ค ๋ก์ง์ ๋ง๋ ๋๊ตฌ๋ฅผ ๋ชจ๋ธ์ ์ ๊ณตํฉ๋๋ค.
๋จ์์ฑ โ ๋๊ตฌ๊ฐ ์ ์์๋ก ๋ชจ๋ธ์ ๋ชจํธ์ฑ์ด ์ค์ด๋ญ๋๋ค.
์ฌ์ฉ ๊ฐ๋ฅํ ๋ฉ์๋
์๋ธํด๋์ค์์ ๋ค์์ ์ฌ์ ์ํ๊ฑฐ๋ ํธ์ถํ์ญ์์ค:
๋ฉ์๋ | ์ค๋ช |
| SQL ์ฟผ๋ฆฌ๋ฅผ ์คํํฉ๋๋ค. |
| ์ฟผ๋ฆฌ ์คํ ๊ณํ์ |
| YDB ๋๋ ํ ๋ฆฌ๋ฅผ ๋์ดํฉ๋๋ค. |
| YDB ๊ฒฝ๋ก(ํ
์ด๋ธ ์คํค๋ง, ๋๋ ํ ๋ฆฌ ๋ฑ)๋ฅผ ์ค๋ช
ํฉ๋๋ค. |
params ์ธ์๋ ์ผ๋ฐ dict์
๋๋ค. $ ์ ๋์ฌ๊ฐ ์๋ ํค์๋ ์๋์ผ๋ก ์ถ๊ฐ๋ฉ๋๋ค. ๋ช
์์ ์ธ YDB ์ ํ์ ์ง์ ํ๋ ค๋ฉด (value, "TypeName") ํํ์ ์ฌ์ฉํ์ญ์์ค(์: {"id": (42, "Int64")}).
์ผ๋ฐ ๋๊ตฌ ์ ์ด
generic_tools ํด๋์ค ์์ฑ์ ์ฌ์ฉํ์ฌ ๋ฑ๋ก๋ ๋ด์ฅ ๋๊ตฌ๋ฅผ ์ ์ดํ์ญ์์ค:
๊ฐ | ํจ๊ณผ |
| ๋ชจ๋ ๋ด์ฅ ๋๊ตฌ(๊ธฐ๋ณธ๊ฐ) |
| ๋ด์ฅ ๋๊ตฌ ์์ โ ์ฌ์ฉ์ ์ ์ ๋๊ตฌ๋ง ์ฌ์ฉ |
| ๋์ด๋ ๋๊ตฌ๋ง ์ฌ์ฉ |
YDBGenericTool์ ๋ฌธ์์ด ์ด๊ฑฐํ์ด๋ฉฐ ์ฌ์ฉ ๊ฐ๋ฅํ ๊ฐ์ QUERY, QUERY_WITH_PARAMS, EXPLAIN, EXPLAIN_WITH_PARAMS, STATUS, LIST_DIRECTORY, DESCRIBE_PATH์
๋๋ค.
์์
# my_server.py
from ydb_mcp import YDBMCPServer, YDBGenericTool, serialize_ydb_response
class OrdersServer(YDBMCPServer):
"""Minimal read-only MCP server for the orders service."""
generic_tools = {YDBGenericTool.STATUS} # keep status check for diagnostics
def __init__(self, **kwargs):
super().__init__(**kwargs)
@self.tool()
async def get_order(order_id: str) -> str:
"""Fetch a single order by ID."""
rows = await self.execute(
"SELECT * FROM orders WHERE id = $id",
{"id": order_id},
)
return serialize_ydb_response(rows)
@self.tool()
async def list_recent_orders(limit: int = 10) -> str:
"""Return the most recent orders."""
rows = await self.execute(
"SELECT * FROM orders ORDER BY created_at DESC LIMIT $limit",
{"limit": limit},
)
return serialize_ydb_response(rows)
if __name__ == "__main__":
OrdersServer(
endpoint="grpc://localhost:2136",
database="/local",
).run()์ง์ ์คํ:
python my_server.py๋๋ ํด๋ผ์ด์ธํธ ๊ตฌ์ฑ์์ MCP ์๋ฒ๋ก ์ฐ๊ฒฐ:
{
"mcpServers": {
"orders": {
"command": "python",
"args": ["my_server.py"]
}
}
}๊ฐ๋ฐ
์ด ํ๋ก์ ํธ๋ ์ฃผ์ ๊ฐ๋ฐ ๋๊ตฌ๋ก 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: ๋ชจ๋ ๋ฆฐํธ ๊ฒ์ฌ ์คํ(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: ์ค๋ฅ ๋ฉ์์ง๋ง ํ์
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ydb-platform/ydb-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
