Skip to main content
Glama
kenningai

Kenning PG MCP

by kenningai

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PG_MCP_HOSTNoHTTP bind host127.0.0.1
PG_MCP_PORTNoHTTP bind port8000
DATABASE_URIYesConnection URI (required)
PG_MCP_SCHEMASNoSchema allowlist (comma-separated), default all non-system
PG_MCP_MAX_ROWSNoMax rows1000
PG_MCP_POOL_MAXNoPool max5
PG_MCP_POOL_MINNoPool min1
PG_MCP_LOG_LEVELNoLog levelINFO
PG_MCP_MAX_BYTESNoMax response bytes1048576
PG_MCP_TRANSPORTNoTransportstdio
PG_MCP_ACCESS_MODENoAccess moderestricted
PG_MCP_ALLOW_REMOTENoAllow remote binding (requires PG_MCP_TRANSPORT=http)
PG_MCP_ALLOWED_HOSTSNoAllowed hosts for HTTP mode
PG_MCP_ALLOWED_ORIGINSNoAllowed origins for HTTP mode
PG_MCP_STATEMENT_TIMEOUTNoStatement timeout30s

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_schemasA

List database schemas visible to this server, honoring the configured schema allowlist. Cheap. Call this first to see what exists; then use list_objects to look inside a schema.

list_objectsA

List tables, views, materialized views, sequences, and foreign tables in a schema, with comments and approximate row counts. Cheap. Filter by object_type and/or a SQL LIKE name_pattern (e.g. 'order%'). Prefer describe_object for the full shape of a single relation.

describe_objectA

Describe one relation: columns (name, type, nullable, default, comment), primary key, foreign keys in both directions, indexes, check and unique constraints, and an approximate row count from pg_class.reltuples. Cheap. Prefer this over querying catalogs by hand; use it before writing queries against unfamiliar tables.

execute_queryA

Run a single read-only SQL statement inside a READ ONLY transaction and return {columns, rows, row_count, truncated, notice?}. Exactly one statement per call. Use %s placeholders with the params list for user-supplied values. Results are capped at the configured row and byte limits with an explicit truncation notice when more data exists — no LIMIT is ever injected into your SQL. Cost depends entirely on the query; run explain_query first for anything potentially expensive.

explain_queryA

Return the PostgreSQL execution plan (EXPLAIN, FORMAT JSON) for a single statement. Cheap without analyze. With analyze=true the statement is actually executed to collect real timing — the transaction is always rolled back, so even in read-write mode nothing persists, but the statement's runtime cost is fully paid. Parameters are not supported here; inline literal values instead.

list_extensionsA

List installed and available PostgreSQL extensions with versions and descriptions. Cheap. Check here whether an extension (pg_stat_statements, postgis, hypopg, ...) exists before writing queries that depend on it.

server_infoA

Report server version, current role and database, effective access mode, and key settings (timeouts, search_path, recovery state). Cheap. Useful for orientation and for diagnosing permission or timeout surprises.

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/kenningai/kenning-pg-mcp'

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