Database Assistant MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MODEL | No | LLM model ID | bedrock.claude-sonnet-4-6 |
| DB_HOST | Yes | Database hostname or RDS endpoint | |
| DB_NAME | Yes | Database name | |
| DB_PORT | No | Database port | 5432 |
| DB_TYPE | No | postgresql or mysql | postgresql |
| DB_USER | Yes | Database user (use a read-only user) | |
| MAX_ROWS | No | Maximum rows returned per query | 1000 |
| DB_PASSWORD | Yes | Database password | |
| QUERY_TIMEOUT | No | Max query execution time (seconds) | 10 |
| CSV_EXPORT_DIR | No | Directory for CSV exports | /tmp/db_exports |
| OPENAI_API_KEY | No | LLM API key (for generate_sql) | |
| ALLOWED_SCHEMAS | No | Comma-separated schema allowlist | |
| OPENAI_BASE_URL | No | LLM API endpoint (for generate_sql) |
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 available databases on the connected server. |
| list_schemasA | List all schemas in the connected database. For PostgreSQL returns schema names, for MySQL returns databases. |
| list_tablesA | List all tables in a schema with their types (BASE TABLE or VIEW) and approximate row counts. |
| describe_tableA | Get detailed table information: columns (name, type, nullable, default), constraints (PK, FK, unique), and indexes. |
| describe_relationshipsA | Show foreign key relationships for a table: both outgoing (this table references others) and incoming (others reference this table). |
| sample_dataA | Get a quick preview of data in a table. Returns the first N rows to help understand data format and contents. |
| validate_sqlA | Check if a SQL query is safe to execute. Validates that it is read-only, single-statement, and contains no dangerous operations. Use before run_sql to preview validation. |
| run_sqlA | Execute a read-only SQL query. The query is validated for safety before execution. Supports pagination (100 rows per page). Returns columns, rows, row count, and execution time. |
| explain_queryA | Run EXPLAIN ANALYZE on a SQL query to show the execution plan. Helps understand performance characteristics like index usage, sequential scans, and estimated costs. |
| generate_sqlA | Generate a SQL query from a natural language question. Uses the database schema as context and an LLM to produce a valid SELECT query. The generated query is validated for safety. |
| export_csvA | Execute a SQL query and export results as a CSV file. The query is validated for safety. Returns the file path of the generated CSV. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 11 tools
Each tool has a clearly distinct purpose covering schema browsing, querying, validation, and export. There is no overlap or ambiguity between tools.
All tool names follow a consistent verb_noun pattern using snake_case, making them predictable and easy to navigate.
11 tools provide comprehensive coverage for database exploration and safe querying without being excessive or sparse.
Covers essential CRUD-like operations for a read-only assistant, but lacks a direct row count tool and alternative export formats like JSON.