listForeignServers

Return cluster-wide foreign servers with their FDW, owner, and options (host/port/dbname-style options only, never user mapping credentials).

read-onlyany connectionsweeps instancesweeps group

Synopsis

listForeignServers()

Description

Return cluster-wide foreign servers with their FDW, owner, and options (host/port/dbname-style options only, never user mapping credentials).

Parameters

None of its own.

Also accepts connection, instance, group, described once under arguments every tool takes.

Output

Keyed by server name; each value is its wrapper, options and user mappings. An absent extension or a missing grant is reported as {error, hint} in place of the map.

Scope

A physical replica is byte-identical here, so asking each member of a replication group adds nothing.

Example mocked data

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "listForeignServers",
    "arguments": {}
  }
}

Result

{
  "erp": {
    "fdw": "postgres_fdw",
    "owner": "migrator",
    "type": null,
    "version": null,
    "options": [
      "host=erp.internal.example",
      "port=5432",
      "dbname=erp"
    ]
  }
}

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.

See also

replicationStats, listForeignTables, listPublications, listSubscriptions, subscriptionStats, replicationSlots