Return PostgreSQL server settings (pg_settings) grouped by category, each with current value, unit, description, context, type, source, and pending_restart flag.
read-onlyany connectionsweeps replication groupsweeps groupcan return data values
serverSettings([all], [pattern])
Return PostgreSQL server settings (pg_settings) grouped by category, each with current value, unit, description, context, type, source, and pending_restart flag. By DEFAULT only settings that differ from their built-in default -- the set that describes THIS server rather than PostgreSQL, which is the same set EXPLAIN (SETTINGS) reports and for the same reason. A full dump is hundreds of settings and on a cluster with extensions it exceeds the client's payload limit, at which point the tool returns nothing and the forty settings that describe the machine are lost with the four hundred that describe the software.
Pass all:true for everything, or 'pattern' to search by setting name or category (case-insensitive substring).
Also accepts connection, replication_group, group, role, described once under arguments every tool takes.
Keyed by settings category; each value is a map of setting name to its value and metadata. An absent extension or a missing grant is reported as {error, hint} in place of the map.
This reading is instance-wide -- every database on the same postmaster returns it identically, so asking each of them in turn repeats one answer. The counters here are each server's own, so members of a replication group legitimately disagree and the answer is their sum, not the primary's copy.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "serverSettings",
"arguments": {
"pattern": "work_mem"
}
}
}
{
"Resource Usage / Memory": {
"work_mem": {
"setting": "32768",
"unit": "kB",
"short_desc": "Sets the maximum memory to be used for query workspaces.",
"context": "user",
"vartype": "integer",
"source": "configuration file",
"pending_restart": false
},
"maintenance_work_mem": {
"setting": "524288",
"unit": "kB",
"short_desc": "Sets the maximum memory to be used for maintenance operations.",
"context": "user",
"vartype": "integer",
"source": "configuration file",
"pending_restart": false
}
}
}
Invented values on a fictional shop database, shaped by and checked against this tool's output schema. Real output is returned as structuredContent to clients that negotiate MCP 2025-06-18 or later.
diskUsage, databaseSize, currentActivity, currentLocks, databaseStats, statementStats, wraparoundStatus, progressStats, ioStats, checkpointStats, tableIOStats, hostCapacity, bufferCacheSummary, bufferCacheContents