rdb-mcp

Query and inspect MySQL, PostgreSQL, or SQLite databases through the rdb-mcp MCP server.

Updated Jul 4, 2023
One-click install
npx skills add https://github.com/kohdice/dotfiles --skill rdb-mcp-kohdice
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rdb-mcp
Source: https://github.com/kohdice/dotfiles/tree/main/config/agents/skills/rdb-mcp
Command: npx skills add https://github.com/kohdice/dotfiles --skill rdb-mcp-kohdice

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working against a relational database through the rdb-mcp MCP server requires knowing its exact contract: three tools with runtime-dependent name prefixes, string-only result values, row caps with a truncation flag, single-statement classification rules, and engine-specific differences. This Skill prevents wrong assumptions, fabricated data, and unsafe writes by teaching the correct workflow for exploring schemas, running SQL, and interpreting results. ## Core Features & Use Cases - Schema Exploration: Use list_tables and describe_table to orient against an unknown schema before writing any SQL, including catalog queries for indexes and foreign keys the tools do not expose. - Safe SQL Execution: Learn execute_sql's read-versus-write classification, one-statement-per-call rule, rejected literal forms, and the confirmation discipline required before INSERT, UPDATE, DELETE, or DDL statements. - Honest Result Interpretation: Handle string-only values, the base64 prefix for binary data, empty columns on zero-row results, and the truncated flag that signals an incomplete answer. - Use Case: A user asks "what tables exist and show me recent orders". The Skill guides the agent to list tables, describe the orders table, run a bounded SELECT with ORDER BY and LIMIT, check the truncated flag, and report results without inventing rows. ## Quick Start Ask the AI to list the tables in the connected database and describe the schema of the table you care about before running any queries.

Frequently Asked Questions about rdb-mcp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query a database through an MCP server?▼

Call the execute_sql tool with a single SQL statement after orienting with list_tables and describe_table. Results come back as columns, rows, row_count, and a truncated flag, with every value returned as a string.

How do I explore an unknown database schema with MCP tools?▼

Start with list_tables to see tables in the default schema, then call describe_table on relevant tables to get column names, data types, nullability, defaults, and primary key flags. Indexes and foreign keys require direct catalog queries through execute_sql.

Does rdb-mcp support MySQL, PostgreSQL, and SQLite?▼

Yes, rdb-mcp connects to one MySQL, PostgreSQL, or SQLite database fixed at startup by DATABASE_URL. The three tools and result shape are identical across engines, but data_type strings and catalog queries differ per engine.

Why did my SELECT return rows_affected instead of rows?▼

A semicolon anywhere but at the end makes the server treat the input as a write, so a multi-statement SELECT returns rows_affected. Split statements into separate execute_sql calls, one statement per call.

Can I run INSERT, UPDATE, or DELETE statements through execute_sql?▼

Yes, execute_sql runs arbitrary SQL including writes and DDL with no permission check. Confirm with the user first, preview destructive scope with SELECT COUNT using the same predicate, and never send an unqualified UPDATE or DELETE.

Why are all query result values returned as strings?▼

The server serializes every column value as text to preserve fixed-point decimals, unsigned integers, and dates without lossy conversion. Perform arithmetic, comparison, and aggregation in SQL rather than parsing the returned strings.