cubrid-mcp-server¶
A Model Context Protocol server for the CUBRID database. It lets LLM clients such as Claude Desktop, Claude Code, and Cursor safely inspect schemas and run read-only queries through the pure-Python pycubrid driver.
Why this server¶
- Read-only by default. A code-level SQL whitelist allows only
SELECT,SHOW,DESC,DESCRIBE, andWITHstatements; multi-statement input is rejected; execution plans come from theexplain_querytool. Write access is a separate, opt-in tool. - Schema-aware. Twelve tools cover table discovery, column metadata, indexes, serials, class hierarchy, row counts, execution plans, and health checks — plus the same metadata as MCP Resources.
- Multi-database. One server process can serve several CUBRID databases, each with independent read-only, write, and audit settings.
- Operations-friendly. All logging goes to stderr (stdout is reserved for the MCP protocol stream), errors returned to the client are sanitized, and an opt-in audit log records every executed statement without ever logging raw SQL.
Tool surface¶
| Tool | Description |
|---|---|
all_table_names |
List every user table in the database |
filter_table_names |
Substring search over table names |
schema_definitions |
Column types, nullability, defaults, and primary key info |
describe_table |
Full metadata: columns, primary key, and indexes in one call |
list_indexes |
Indexes for a table with key columns and flags |
explain_query |
Execution plan/trace for a SELECT/WITH (via CUBRID SHOW TRACE) |
table_row_counts |
COUNT(*) for one or many tables |
list_serials |
CUBRID SERIAL sequences with current value and bounds |
list_class_hierarchy |
CUBRID CLASS inheritance relationships |
execute_query |
Run read-only SQL with automatic output truncation |
health_check |
Verify database connectivity on demand |
execute_write |
Single INSERT/UPDATE/DELETE in an atomic transaction (only registered when opt-in write mode is enabled) |
See the full Tools reference for parameters and return shapes, the Security Model for the safety design, and Multi-Connection for serving several databases from one process.
Documentation¶
- Start here: Quick Start — a disposable lab, a read-only account, one MCP client and a first query, then a safe clean-up
- How-to guides: Serve several databases — named connections and per-connection settings; chat-client setup is at the end of the Quick Start
- Reference: Tools, resources and prompts, configuration settings and the Security Model — read-only enforcement, opt-in writes, audit logging
- Help: Troubleshooting; questions and bugs through the issue forms (never paste passwords, connection strings or query results you would not publish); vulnerabilities privately as described in SECURITY.md
- 한국어: 한국어 README, 빠른 시작, 도구 참조, 보안 모델, 멀티커넥션, 문제 해결
License¶
MIT — see LICENSE.
This project is part of CUBRID Lab, an independent open-source initiative for CUBRID developer tooling, and is not affiliated with, sponsored by, or endorsed by CUBRID Corporation or the official CUBRID project.
Ecosystem¶
Part of the cubrid-lab Python ecosystem:
- cubrid-mcp-server — MCP server — natural-language access for LLM clients
- pycubrid — Pure-Python DB-API 2.0 driver for CUBRID (sync + native asyncio)
- sqlalchemy-cubrid — SQLAlchemy 2.0–2.2 dialect + Alembic
- cubrid-cookbook-python — 68 runnable examples and application templates