Skip to content

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.

uvx cubrid-mcp-server

Why this server

  • Read-only by default. A code-level SQL whitelist allows only SELECT, SHOW, DESC, DESCRIBE, EXPLAIN, and WITH statements; multi-statement input is rejected. 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

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.