Skip to main content
Glama
mir-shakir

readonly-db-mcp

by mir-shakir

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
RODB_HOSTNoServer host (enables the zero-file path when set with RODB_USER)
RODB_PORTNoServer port (default 3306)
RODB_USERNoUsername for the single env connection
RODB_CONFIGNoPath to config.toml (default ~/.config/readonly-db-mcp/config.toml)
RODB_LOG_DIRNoAudit-log directory (default <config dir>/logs/)
RODB_DATABASENoDefault schema for the single env connection
RODB_ENV_FILENoPath to a .env file (default beside config.toml)
RODB_PASSWORDNoPassword for the single env connection
RODB_DISABLE_LOGNoSet to '1' to disable the audit log0
RODB_ENABLE_GATEDNoAllowlist of gated connections to enable, e.g. 'warehouse' or 'all'

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
run_selectA

Run a single read-only SELECT (or WITH...SELECT / UNION) against a database.

connection is a named server from your config (defaults to the configured default_connection). schema sets the default database/namespace for the query (defaults to that connection's default_schema); table names can still be schema- qualified to read across schemas on the same connection. Call list_connections() if unsure what's available, list_schemas(connection) to see schemas on one.

Writes, DDL, multiple statements, INTO OUTFILE and dangerous functions are rejected. Output is capped; when truncated is true, pass the suggested offset to page.

explainA

EXPLAIN FORMAT=JSON for a SELECT — query plan (indexes, join order, estimated rows) without executing it. Same connection/schema routing as run_select.

list_connectionsA

List the connections you can query, with each one's default schema, any described schemas, whether it is gated (require_opt_in) and currently enabled.

Call this FIRST when unsure what to target. Query one with run_select(..., connection=, schema=). Gated connections show enabled=false until RODB_ENABLE_GATED opts them in.

list_schemasA

List the schemas (databases) visible on a connection's server, with any descriptions you configured. System schemas are hidden. Use this to discover which schema to pass to the other tools.

list_tablesB

List tables and views in the resolved schema (name, type, engine, approx rows).

describe_tableC

Columns of a table: name, type, nullability, key, default, extra, comment.

get_indexesC

Indexes of a table: name, columns (in order), uniqueness, type, cardinality.

get_foreign_keysB

Foreign keys on a table (outbound) and FKs pointing to it (inbound).

table_statsC

Approximate size of a table: row estimate, data/index bytes, engine, timestamps.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/mir-shakir/readonly-db-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server