Skip to main content
Glama
eklemen
by eklemen

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PGHOSTNoDatabase host
PGPORTNoDatabase port
PGUSERNoDatabase user
PGSSLMODENoSSL modedisable
PGDATABASENoDatabase name
PGPASSWORDNoDatabase password
DATABASE_URLNoFull connection string (wins over PG*)
DB_MCP_DRIVERNoDatabase driverpostgres
DB_MCP_MAX_ROWSNoHard cap for run_readonly_query1000
DB_MCP_DEFAULT_SCHEMANoDefault schemapublic
DB_MCP_SAMPLE_MAX_ROWSNoHard cap for sample_rows50
DB_MCP_MAX_QUERY_LENGTHNoMax query length10000
DB_MCP_STATEMENT_TIMEOUT_MSNoPer-statement timeout5000

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_databasesA

List databases the read-only user can connect to, with owner and comment when available.

list_schemasA

List schemas (namespaces) the read-only user can access. Excludes system schemas (pg_*, information_schema).

list_tablesA

List tables and views in a schema. Returns name, type (table/view/materialized view/foreign table), a planner row estimate when available, and any comment. Defaults to the configured default schema.

describe_tableA

Describe a table: columns (type, nullability, default, comment), primary key, foreign keys, unique constraints, check constraints, and indexes.

get_table_ddlA

Return the reconstructed CREATE TABLE DDL for a table (PostgreSQL has no SHOW CREATE TABLE, so this is the closest supported reconstruction from the catalog, including constraints and indexes).

get_relationshipsA

List foreign-key relationships with constraint names, referenced tables/columns, ON UPDATE/DELETE actions, and a cardinality hint (1:1 when the FK columns are uniquely constrained locally, otherwise many:1). Optionally filter by schema and/or table.

get_indexesA

List indexes on a table: name, access method (btree/gin/gist/...), uniqueness, whether it backs the primary key, ordered columns with sort direction and NULLS ordering, and any partial-index predicate.

sample_rowsA

Return a small sample of rows from a table. The limit is capped at the server's hard maximum (default 50) regardless of the requested value.

run_readonly_queryA

Execute a single read-only SQL query (SELECT / EXPLAIN-without-ANALYZE / SHOW). The query is validated with a real PostgreSQL parser and rejected if it contains any write, DDL, data-modifying CTE, multiple statements, or other side effect. Results are capped at the server row maximum. Returns columns, rows, row count, execution time, and a truncation flag.

search_schemaA

Search across the schema for a term (case-insensitive substring). Matches table names, column names, table/column comments, constraint names, and index names. Optionally restrict to a single schema.

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/eklemen/db-mcp'

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