Skip to main content
Glama
vinycoolguy2015

Database Assistant MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MODELNoLLM model IDbedrock.claude-sonnet-4-6
DB_HOSTYesDatabase hostname or RDS endpoint
DB_NAMEYesDatabase name
DB_PORTNoDatabase port5432
DB_TYPENopostgresql or mysqlpostgresql
DB_USERYesDatabase user (use a read-only user)
MAX_ROWSNoMaximum rows returned per query1000
DB_PASSWORDYesDatabase password
QUERY_TIMEOUTNoMax query execution time (seconds)10
CSV_EXPORT_DIRNoDirectory for CSV exports/tmp/db_exports
OPENAI_API_KEYNoLLM API key (for generate_sql)
ALLOWED_SCHEMASNoComma-separated schema allowlist
OPENAI_BASE_URLNoLLM API endpoint (for generate_sql)

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
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

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/vinycoolguy2015/database_mcp_server'

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