Skip to main content
Glama

PostgreSQL MCP Server

AGPL 3.0
498
94
  • Linux
  • Apple

pg_manage_users

Create, drop, alter, and manage PostgreSQL user permissions, including granting or revoking access to databases, tables, and schemas. Simplify user administration and access control.

Instructions

Manage PostgreSQL users and permissions - create, drop, alter users, grant/revoke permissions. Examples: operation="create" with username="testuser", operation="grant" with username, permissions, target, targetType

Input Schema

NameRequiredDescriptionDefault
cascadeNoInclude CASCADE to drop owned objects (for drop/revoke operations)
connectionLimitNoMaximum number of connections (for create/alter operations)
connectionStringNoPostgreSQL connection string (optional)
createdbNoAllow user to create databases (for create/alter operations)
createroleNoAllow user to create roles (for create/alter operations)
ifExistsNoInclude IF EXISTS clause (for drop operation)
includeSystemRolesNoInclude system roles (for list operation)
inheritNoInherit privileges from parent roles (for create/alter operations)
loginNoAllow user to login (for create/alter operations)
operationYesOperation: create (new user), drop (remove user), alter (modify user), grant (permissions), revoke (permissions), get_permissions (view permissions), list (all users)
passwordNoPassword for the user (for create operation)
permissionsNoPermissions to grant/revoke: ["SELECT", "INSERT", "UPDATE", "DELETE", "TRUNCATE", "REFERENCES", "TRIGGER", "ALL"]
replicationNoAllow replication privileges (for create/alter operations)
schemaNoFilter by schema (for get_permissions operation)
superuserNoGrant superuser privileges (for create/alter operations)
targetNoTarget object name (for grant/revoke operations)
targetTypeNoType of target object (for grant/revoke operations)
usernameNoUsername (required for create/drop/alter/grant/revoke/get_permissions, optional filter for list)
validUntilNoPassword expiration date YYYY-MM-DD (for create/alter operations)
withGrantOptionNoAllow user to grant these permissions to others (for grant operation)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "cascade": { "description": "Include CASCADE to drop owned objects (for drop/revoke operations)", "type": "boolean" }, "connectionLimit": { "description": "Maximum number of connections (for create/alter operations)", "type": "number" }, "connectionString": { "description": "PostgreSQL connection string (optional)", "type": "string" }, "createdb": { "description": "Allow user to create databases (for create/alter operations)", "type": "boolean" }, "createrole": { "description": "Allow user to create roles (for create/alter operations)", "type": "boolean" }, "ifExists": { "description": "Include IF EXISTS clause (for drop operation)", "type": "boolean" }, "includeSystemRoles": { "description": "Include system roles (for list operation)", "type": "boolean" }, "inherit": { "description": "Inherit privileges from parent roles (for create/alter operations)", "type": "boolean" }, "login": { "description": "Allow user to login (for create/alter operations)", "type": "boolean" }, "operation": { "description": "Operation: create (new user), drop (remove user), alter (modify user), grant (permissions), revoke (permissions), get_permissions (view permissions), list (all users)", "enum": [ "create", "drop", "alter", "grant", "revoke", "get_permissions", "list" ], "type": "string" }, "password": { "description": "Password for the user (for create operation)", "type": "string" }, "permissions": { "description": "Permissions to grant/revoke: [\"SELECT\", \"INSERT\", \"UPDATE\", \"DELETE\", \"TRUNCATE\", \"REFERENCES\", \"TRIGGER\", \"ALL\"]", "items": { "enum": [ "SELECT", "INSERT", "UPDATE", "DELETE", "TRUNCATE", "REFERENCES", "TRIGGER", "ALL" ], "type": "string" }, "type": "array" }, "replication": { "description": "Allow replication privileges (for create/alter operations)", "type": "boolean" }, "schema": { "description": "Filter by schema (for get_permissions operation)", "type": "string" }, "superuser": { "description": "Grant superuser privileges (for create/alter operations)", "type": "boolean" }, "target": { "description": "Target object name (for grant/revoke operations)", "type": "string" }, "targetType": { "description": "Type of target object (for grant/revoke operations)", "enum": [ "table", "schema", "database", "sequence", "function" ], "type": "string" }, "username": { "description": "Username (required for create/drop/alter/grant/revoke/get_permissions, optional filter for list)", "type": "string" }, "validUntil": { "description": "Password expiration date YYYY-MM-DD (for create/alter operations)", "type": "string" }, "withGrantOption": { "description": "Allow user to grant these permissions to others (for grant operation)", "type": "boolean" } }, "required": [ "operation" ], "type": "object" }

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/HenkDz/postgresql-mcp-server'

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