mcp-database
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_MAX_ROWS | No | Maximum rows returned per query | 100 |
| MCP_DATABASE_URL | No | Database connection URL | sqlite:///:memory: |
| MCP_DATABASE_TYPE | No | Database type: sqlite, postgresql, mysql | sqlite |
| MCP_DATABASE_READ_ONLY | No | Enable read-only mode | true |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_databasesA | List all configured database connections and their status. Returns JSON with connection names, types, status, and masked URLs. |
| list_tablesB | List all tables in a database. Args: database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default"). |
| get_table_infoB | Get detailed information about a table: columns, types, row count. Args: table: Table name. database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default"). |
| get_schemaA | Get the full database schema (CREATE TABLE statements for all tables). Args: database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default"). |
| queryA | Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN) and return results. Args: sql: SQL query to execute. database: Name of the database within the connection (optional). max_rows: Maximum number of rows to return (default: 100). connection_name: Name of the database connection (default: "default"). |
| executeA | Execute a write SQL statement (INSERT, UPDATE, DELETE). Only works if writes are enabled. Args: sql: SQL statement to execute. database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default"). |
| sample_rowsB | Get a sample of rows from a table to understand its data. Args: table: Table name. limit: Number of rows to sample (default: 5, max: 20). database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default"). |
| search_tablesB | Search for tables or columns matching a keyword. Args: keyword: Keyword to search for in table and column names. database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default"). |
| schema_diffA | Compare schemas between two database connections. Args: source_connection: Source connection name. target_connection: Target connection name. table_name: Optional table name to diff. If empty, diff all tables. |
| check_healthA | Check database health: latency, table count, row count, largest tables. Args: connection_name: Name of the database connection (default: "default"). |
| generate_er_diagramA | Generate an ER (Entity-Relationship) diagram in Mermaid format. Args: connection_name: Name of the database connection (default: "default"). format: Output format. Currently only 'mermaid' is supported. |
| explain_queryA | Explain the execution plan for a SELECT query. Args: query: SQL SELECT or WITH...SELECT statement to explain. connection_name: Name of the database connection (default: "default"). |
| diagnose_connectionB | Diagnose a database connection with detailed status and troubleshooting hints. Args: connection_name: Name of the database connection (default: "default"). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| resource_mergewall_audit_schema | Return the suggested Mergewall audit table schema. |
TDQS
Scored across 13 tools
Most tools have clearly distinct purposes: query vs execute, get_table_info vs get_schema, and search_tables vs sample_rows are all well separated. However, list_databases, check_health, and diagnose_connection all overlap somewhat around connection status and health reporting.
The majority of tools follow a clear verb_noun pattern such as list_tables, get_schema, sample_rows, and search_tables. Minor deviations include the bare verbs query and execute, plus the noun_noun schema_diff, but these do not seriously harm predictability.
With 13 tools, the server is well within the ideal range for a database-focused MCP server. Each tool contributes a distinct capability from schema introspection to querying, health checks, diffs, and ER diagram generation.
The toolset covers the core database workflow well: listing connections and tables, inspecting schemas, sampling data, running read/write SQL, checking health, and comparing schemas. The main gap is lack of DDL or schema modification operations, though execute could partially cover writes if extended.