PostgreSQL MCP Server

274 tools. 113 can modify or destroy data without limits.

18 destructive tools with no built-in limits. Policy required.

Last updated:

113 can modify or destroy data
161 read-only
274 tools total

Community server · catalogue entry checked 28/06/2026

How to control PostgreSQL MCP Server ↓

What PostgreSQL MCP Server exposes to your agents

Read (161) Write / Execute (95) Destructive / Financial (18)
Critical Risk

The most dangerous PostgreSQL MCP Server tools

113 of PostgreSQL MCP Server's 274 tools can modify, destroy, or commit something on every call — and an agent calls them with no built-in limits.

How to control PostgreSQL MCP Server

PolicyLayer is an MCP gateway — it sits between your AI agents and PostgreSQL MCP Server, and nothing reaches the server without passing your rules. These are the rules we recommend:

Deny destructive operations
{
  "pg_cascade_simulator": {
    "deny_if": [
      {
        "conditions": [],
        "on_deny": "Blocked by default. Requires approval."
      }
    ]
  }
}

Destructive tools should never be available to autonomous agents without human approval.

Rate limit write operations
{
  "pg_alert_threshold_set": {
    "limits": [
      {
        "counter": "pg_alert_threshold_set_per_hour",
        "window": "hour",
        "max": 30,
        "scope": "grant"
      }
    ]
  }
}

Prevents bulk unintended modifications from agents caught in loops.

Cap read operations
{
  "pg_analyze_db_health": {
    "limits": [
      {
        "counter": "pg_analyze_db_health_per_minute",
        "window": "minute",
        "max": 60,
        "scope": "grant"
      }
    ]
  }
}

Controls API costs and prevents retry loops from exhausting upstream rate limits.

  1. Create a free account and register PostgreSQL MCP Server — nothing to install.
  2. Add these rules — paste them, or build them visually. Tune the limits to your setup.
  3. Point your MCP client (Claude, Cursor, anything) at your gateway URL.
ENFORCE POLICY ON POSTGRESQL →

Instant setup, no code required.

All 274 PostgreSQL MCP Server tools

DESTRUCTIVE 18 tools
Destructive pg_cascade_simulator Simulate the impact of DELETE, DROP, or TRUNCATE on a table. Returns affected tables, estimated row counts, ca Destructive pg_cron_cleanup_history Delete old job run history records. Helps prevent the cron.job_run_details table from growing too large. By de Destructive pg_cron_unschedule Remove a scheduled cron job by its ID or name. If both are provided, jobName takes precedence. Job ID accepts Destructive pg_detach_partition Detach a partition. Use concurrently: true for non-blocking. Use finalize: true only after an interrupted CONC Destructive pg_doc_drop_collection Drop a document collection (table). Destructive pg_doc_remove Remove documents matching a filter from a collection. Destructive pg_drop_index Drop an index from a table. Supports IF EXISTS, CASCADE, and CONCURRENTLY options. Destructive pg_drop_schema Drop a schema (optionally with all objects). Destructive pg_drop_sequence Drop a sequence. Supports IF EXISTS and CASCADE options. Destructive pg_drop_table Drop a table from the database. Destructive pg_drop_view Drop a view or materialized view. Supports IF EXISTS and CASCADE options. Destructive pg_kcache_reset Reset pg_stat_kcache statistics. Use this to start fresh measurements. Note: This also resets pg_stat_statemen Destructive pg_migration_rollback Roll back a specific migration by ID or version. Destructive pg_partman_set_retention Configure retention policy for a partition set. Partitions older than the retention period will be dropped or Destructive pg_reset_stats Reset statistics counters (requires superuser). Destructive pg_role_drop Drop a PostgreSQL role. Use ifExists (default: true) to skip gracefully if the role does not exist. Destructive pg_text_normalize Remove accent marks (diacritics) from text using PostgreSQL unaccent extension. Note: Does NOT lowercase or tr Destructive pg_truncate Truncate a table, removing all rows quickly. Use cascade to truncate dependent tables.
EXECUTE 43 tools
Execute pg_analyze Update table statistics for the query planner. Execute pg_analyze_query_indexes Analyze a specific query for index recommendations using EXPLAIN ANALYZE. Execute pg_buffer Create a buffer zone around geometries. Default limit: 10 rows, default simplify: 10m (set simplify: 0 to disa Execute pg_cancel_backend Cancel a running query (graceful, preferred over terminate). Execute pg_cluster Physically reorder table data based on an index. Call with no args to re-cluster all previously-clustered tabl Execute pg_cron_create_extension Enable the pg_cron extension for job scheduling. Requires superuser privileges. Execute pg_cron_schedule Schedule a new cron job. Supports standard cron syntax (e.g., Execute pg_cron_schedule_in_database Schedule a cron job to run in a different database. Useful for cross-database maintenance tasks. Returns the j Execute pg_explain_analyze Run query and show actual execution plan with timing. Execute pg_geo_cluster Perform spatial clustering using DBSCAN or K-Means. DBSCAN defaults: eps=100m, minPoints=3. K-Means default: n Execute pg_geo_transform Transform geometry from one spatial reference system (SRID) to another. Execute pg_geometry_transform Transform a WKT or GeoJSON geometry from one SRID to another. Common SRIDs: 4326 (WGS84/GPS), 3857 (Web Mercat Execute pg_jsonb_array Build a JSONB array from values. Accepts {values: [...]} or {elements: [...]}. Returns {array: [...]}. Execute pg_kcache_create_extension Enable the pg_stat_kcache extension for OS-level performance metrics. Requires pg_stat_statements to be instal Execute pg_ltree_create_extension Enable the ltree extension for hierarchical tree-structured labels. Execute pg_migration_apply Execute migration SQL and record it atomically in a single transaction. Execute pg_partman_create_extension Enable the pg_partman extension for automated partition management. Requires superuser privileges. Execute pg_partman_run_maintenance Run partition maintenance to create new child partitions and enforce retention policies. Should be executed re Execute pg_pgcrypto_create_extension Enable the pgcrypto extension for cryptographic functions. Execute pg_pgcrypto_crypt Hash a password using crypt() with a salt from gen_salt(). Execute pg_pgcrypto_decrypt Decrypt data that was encrypted with pg_pgcrypto_encrypt. Execute pg_pgcrypto_encrypt Encrypt data using PGP symmetric encryption. Execute pg_pgcrypto_gen_random_uuid Generate a cryptographically secure UUID v4. Execute pg_pgcrypto_gen_salt Generate a salt for use with crypt() password hashing. Execute pg_pgcrypto_hmac Compute HMAC for data with a secret key. Execute pg_postgis_create_extension Enable the PostGIS extension for geospatial operations. Execute pg_reindex Rebuild indexes to improve performance. For target: database, name defaults to the current database if omitted Execute pg_reload_conf Reload PostgreSQL configuration without restart. Execute pg_restore_command Generate pg_restore command for restoring backups. Execute pg_role_set Set the session Execute pg_security_audit Run a comprehensive security audit checking SSL, password encryption, superuser exposure, logging, and HBA rul Execute pg_set_config Set a configuration parameter for the current session. Execute pg_stats_running_total Calculate cumulative running total (SUM OVER) for a numeric column. Use partitionBy to reset total per group. Execute pg_transaction_begin Begin a new transaction. Returns a transaction ID for subsequent operations. Execute pg_transaction_execute Execute multiple statements atomically in a single transaction. Execute pg_vacuum Run VACUUM to reclaim storage and update visibility map. Use analyze: true to also update statistics. Verbose Execute pg_vacuum_analyze Run VACUUM and ANALYZE together for optimal performance. Verbose output goes to PostgreSQL server logs. Execute pg_vector_cluster Perform K-means clustering on vectors. Returns cluster centroids only (not row assignments). To assign rows to Execute pg_vector_create_extension Enable the pgvector extension for vector similarity search. Execute pg_vector_dimension_reduce Reduce vector dimensions using random projection. Supports direct vector input OR table-based extraction. Execute pg_vector_embed Generate text embeddings. Returns a simple hash-based embedding for demos (use external APIs for production). Execute pg_vector_normalize Normalize a vector to unit length. Execute pg_vector_performance Analyze vector search performance and index effectiveness. Provide testVector for benchmarking (recommended).
WRITE 52 tools
Write pg_alert_threshold_set Get recommended alert thresholds for monitoring key database metrics. Note: This is informational only - retur Write pg_append_insight Append a business insight to the in-memory insights memo. Insights are accessible via the postgres://insights Write pg_attach_partition Attach an existing table as a partition. Write pg_audit_restore_backup Restore a pre-mutation backup snapshot. Executes the captured DDL (and optional data INSERTs) within a transac Write pg_batch_insert Insert multiple rows in a single statement. More efficient than individual inserts. Rows array must not be emp Write pg_citext_convert_column Convert an existing TEXT column to CITEXT for case-insensitive comparisons. This is useful for retrofitting ca Write pg_citext_create_extension Enable the citext extension for case-insensitive text columns. citext is ideal for emails, usernames, and othe Write pg_copy_import Generate COPY FROM command for importing data. Write pg_create_backup_plan Generate a backup strategy recommendation with cron schedule. Write pg_create_fts_index Create a GIN index for full-text search on a column. Write pg_create_index Create an index on a table. Supports btree, hash, gin, gist, brin index types. Write pg_create_partition Create a partition. Use subpartitionBy/subpartitionKey to make it sub-partitionable for multi-level partitioni Write pg_create_partitioned_table Create a partitioned table. Columns: notNull, primaryKey, unique, default. Note: primaryKey/unique must includ Write pg_create_schema Create a new schema. Write pg_create_sequence Create a new sequence with optional START, INCREMENT, MIN/MAX, CACHE, CYCLE, and OWNED BY. Write pg_create_table Create a new table with specified columns and constraints. Supports composite primary keys and table-level con Write pg_create_view Create a view or materialized view. Write pg_cron_alter_job Modify an existing cron job. Can change schedule, command, database, username, or active status. Only specify Write pg_doc_add Add one or more JSON documents to a collection. Write pg_doc_create_collection Create a new JSONB document collection (table with doc JSONB + generated _id primary key). Write pg_doc_create_index Create an expression index on document fields for faster queries. Uses PostgreSQL expression indexes on JSONB Write pg_doc_modify Update documents matching a filter. Set fields with Write pg_geometry_buffer Create a buffer zone around a WKT or GeoJSON geometry. Returns the buffered geometry as GeoJSON and WKT. Write pg_geometry_column Add a geometry column to a table. Returns alreadyExists: true if column exists. Write pg_jsonb_delete Delete a key or array element from a JSONB column. Accepts path as string or array. Note: rowsAffected reflect Write pg_jsonb_insert Insert value into JSONB array or object. For arrays, index -1 inserts BEFORE last element (use insertAfter:tru Write pg_jsonb_merge Merge two JSONB objects. deep=true (default) recursively merges. mergeArrays=true concatenates arrays. Write pg_jsonb_set Set value in JSONB at path. Uses dot-notation by default; for literal dots in keys use array format [\ Write pg_jsonb_strip_nulls Remove null values from a JSONB column. Use preview=true to see changes without modifying data. Write pg_ltree_convert_column Convert an existing TEXT column to LTREE type. Note: If views depend on this column, you must drop and recreat Write pg_ltree_create_index Create a GiST index on an ltree column for efficient tree queries. Write pg_migration_init Initialize or verify the schema version tracking table (_mcp_schema_versions). Write pg_migration_record Record a migration in the schema version tracking table with status Write pg_partman_create_parent Create a new partition set using pg_partman Write pg_restore_validate Generate commands to validate backup integrity and restorability. Write pg_role_assign Assign (grant) a role to a user/role, establishing role membership. Optionally with ADMIN OPTION to allow re-g Write pg_role_create Create a new PostgreSQL role with optional attributes (LOGIN, PASSWORD, SUPERUSER, CREATEDB, CREATEROLE, REPLI Write pg_role_grant Grant privileges (SELECT, INSERT, UPDATE, DELETE, ALL, etc.) on tables, schemas, sequences, or functions to a Write pg_role_revoke Revoke role membership from a user, or revoke specific privileges on objects from a role. For membership: prov Write pg_role_rls_enable Enable or disable row-level security (RLS) on a table. Optionally use FORCE to apply RLS even to the table own Write pg_security_mask_data Apply data masking to sensitive values. Supports email, phone, SSN, credit card, and partial masking. Write pg_spatial_index Create a GiST spatial index for geometry column. Uses IF NOT EXISTS to avoid errors on duplicate names. Write pg_stats_rank Assign rank within an ordered result set. Supports rank (gaps), dense_rank (no gaps), and percent_rank (0-1). Write pg_terminate_backend Terminate a database connection (forceful, use with caution). Write pg_transaction_commit Commit a transaction, making all changes permanent. Write pg_transaction_release Release a savepoint, keeping all changes since it was created. Write pg_transaction_savepoint Create a savepoint within a transaction for partial rollback. Write pg_upsert Insert a row or update if it already exists (INSERT ... ON CONFLICT DO UPDATE). Specify conflict columns for u Write pg_vector_add_column Add a vector column to a table. Requires: table, column, dimensions. Write pg_vector_create_index Create vector index. Requires: table, column, type (ivfflat or hnsw). Write pg_vector_insert Insert a vector into a table, or update an existing row Write pg_write_query Execute a write SQL query (INSERT, UPDATE, DELETE). Returns affected row count. Pass transactionId to execute
READ 161 tools
Read pg_analyze_db_health Comprehensive database health analysis including cache hit ratio, bloat, replication, and connection stats. Read pg_analyze_workload_indexes Analyze database workload using pg_stat_statements to recommend missing indexes. Read pg_audit_diff_backup Compare a backup snapshot Read pg_audit_list_backups List available pre-mutation backup snapshots with metadata (tool, target, timestamp, type, size). Read pg_backup_physical Generate pg_basebackup command for physical (binary) backup. Read pg_backup_schedule_optimize Analyze database activity patterns and recommend optimal backup schedule. Read pg_bloat_check Check for table and index bloat. Returns tables with dead tuples. Read pg_bounding_box Find geometries within a bounding box. Swapped min/max values are auto-corrected. Default limit: 10 rows. Read pg_cache_hit_ratio Get buffer cache hit ratio statistics. Read pg_capacity_planning Analyze database growth trends and provide capacity planning forecasts. Note: Growth estimates are based on pg Read pg_citext_analyze_candidates Find TEXT columns that may benefit from case-insensitive comparisons. Looks for common patterns like email, us Read pg_citext_compare Compare two values using case-insensitive semantics. Useful for testing citext behavior before converting colu Read pg_citext_list_columns List all columns using the citext type in the database. Useful for auditing case-insensitive columns. Read pg_citext_schema_advisor Analyze a specific table and recommend which columns should use citext. Provides schema design recommendations Read pg_connection_pool_optimize Analyze connection usage and provide pool optimization recommendations. Read pg_connection_stats Get connection statistics by database and state. Read pg_constraint_analysis Analyze all constraints for issues: redundant indexes, missing foreign keys, missing NOT NULL, missing primary Read pg_copy_export Export query results using COPY TO. Use query/sql for custom query or table for SELECT . Read pg_count Count rows in a table, optionally with a WHERE clause or specific column. Read pg_cron_job_run_details View execution history for cron jobs. Shows start/end times, status, and return messages. Useful for monitorin Read pg_cron_list_jobs List all scheduled cron jobs. Shows job ID, name, schedule, command, and status. Jobs without names (jobname: Read pg_database_size Get the size of a database. Read pg_dependency_graph Get the full foreign key dependency graph with cascade paths, row counts, circular dependency detection, and s Read pg_describe_table Get detailed table structure including columns, types, and constraints. For tables/views only, not sequences. Read pg_detect_bloat_risk Scores tables by bloat risk using multiple factors: dead tuple ratio, Read pg_detect_connection_spike Detects unusual connection patterns by analyzing concentration Read pg_detect_query_anomalies Detects queries deviating from their historical execution time norms Read pg_diagnose_database_performance Consolidates key performance metrics into a single actionable report: Read pg_distance Find nearby geometries within a distance from a point. Output distance_meters is always in meters; unit parame Read pg_doc_collection_info Get document collection statistics: row count, size, and indexes. Read pg_doc_find Query documents in a JSONB collection with optional filter, field projection, and pagination. Read pg_doc_list_collections List JSONB document collections in a schema. Collections are tables with a Read pg_dump_schema Get the pg_dump command for a schema or database. Read pg_dump_table Generate DDL for a table or sequence. Returns CREATE TABLE for tables, CREATE SEQUENCE for sequences. Read pg_duplicate_indexes Find duplicate or overlapping indexes (same leading columns). Candidates for consolidation. Read pg_exists Check if rows exist in a table. WHERE clause is optional: with WHERE = checks matching rows; without WHERE = c Read pg_explain Show query execution plan without running the query. Read pg_explain_buffers Show query plan with buffer usage statistics. Read pg_fuzzy_match Fuzzy string matching using fuzzystrmatch extension. Levenshtein (default): returns distance; use maxDistance= Read pg_geo_index_optimize Analyze spatial indexes and provide optimization recommendations. Read pg_geocode Create a point geometry from latitude/longitude coordinates. The SRID parameter sets output metadata only; inp Read pg_geometry_intersection Compute the intersection of two WKT or GeoJSON geometries. Returns the intersection geometry and whether they Read pg_get_indexes List indexes with usage statistics. When table is omitted, lists ALL database indexes (can be large). Use sche Read pg_hybrid_search Combined vector similarity and full-text search with weighted scoring. Read pg_index_recommendations Suggest missing indexes based on table statistics or query analysis. When sql is provided and HypoPG is instal Read pg_index_stats Get index usage statistics. Read pg_intersection Find geometries that intersect with a given geometry. Auto-detects SRID from target column if not specified. D Read pg_jsonb_agg Aggregate rows into a JSONB array. With groupBy, returns all groups with their aggregated items. Read pg_jsonb_contains Find rows where JSONB column contains the specified value. Note: Empty object {} matches all rows. Read pg_jsonb_diff Compare two JSONB objects. Returns top-level key differences only (shallow comparison, not recursive). Read pg_jsonb_extract Extract value from JSONB at specified path. Returns null if path does not exist in data structure. Use select Read pg_jsonb_index_suggest Analyze JSONB column and suggest indexes. Only works on object-type JSONB (not arrays). Read pg_jsonb_keys Get all unique keys from a JSONB object column (deduplicated across rows). Read pg_jsonb_normalize Normalize JSONB to key-value pairs. Use idColumn to specify row identifier (default: Read pg_jsonb_path_query Query JSONB using SQL/JSON path expressions (PostgreSQL 12+). Note: Recursive descent (..) syntax is not suppo Read pg_jsonb_pretty Format JSON/JSONB with indentation for readability. Pass raw JSON string via Read pg_jsonb_security_scan Scan JSONB for security issues. Only works on object-type JSONB (not arrays). Use larger sampleSize for thorou Read pg_jsonb_stats Get statistics about JSONB column usage. Note: topKeys only applies to object-type JSONB, not arrays. Read pg_jsonb_typeof Get JSONB type at path. Uses dot-notation (a.b.c), not JSONPath ($). Response includes columnNull to distingui Read pg_jsonb_validate_path Validate a JSONPath expression and test it against sample data. Supports vars for parameterized paths. Read pg_kcache_database_stats Get aggregated OS-level statistics for a database. Shows total CPU time, I/O, and page faults across all queri Read pg_kcache_query_stats Get query statistics with OS-level CPU and I/O metrics. Joins pg_stat_statements with pg_stat_kcache to show w Read pg_kcache_resource_analysis Analyze queries to classify them as CPU-bound, I/O-bound, or balanced. Helps identify the root cause of perfor Read pg_kcache_top_cpu Get top CPU-consuming queries. Shows which queries spend the most time in user CPU (application code) vs syste Read pg_kcache_top_io Get top I/O-consuming queries. Shows filesystem-level reads and writes, which represent actual disk access (no Read pg_like_search Search text using LIKE patterns. Case-insensitive (ILIKE) by default. Read pg_list_constraints List table constraints (primary keys, foreign keys, unique, check). Read pg_list_extensions List installed PostgreSQL extensions with versions. Read pg_list_functions List user-defined functions with optional filtering. Use exclude (array) to filter out extension functions. De Read pg_list_objects List database objects filtered by type. Use type: Read pg_list_partitions List all partitions of a partitioned table. Returns warning if table is not partitioned. Read pg_list_schemas List all schemas in the database. Read pg_list_sequences List all sequences in the database. Read pg_list_tables List all tables, views, and materialized views with metadata. Use limit to restrict results. Read pg_list_triggers List all triggers. Read pg_list_views List all views and materialized views. Read pg_locks View current lock information. Read pg_ltree_lca Find the longest common ancestor of multiple ltree paths. Read pg_ltree_list_columns List all columns using the ltree type in the database. Read pg_ltree_match Match ltree paths using lquery pattern syntax. Read pg_ltree_query Query hierarchical relationships in ltree columns. Supports exact paths (descendants/ancestors) and lquery pat Read pg_ltree_subpath Extract a portion of an ltree path. Read pg_migration_history Query migration history with optional filtering by status and source system. Read pg_migration_risks Analyze proposed DDL statements for risks: data loss, lock contention, constraint violations, and breaking cha Read pg_migration_status Get current migration tracking status: latest version, counts by status, Read pg_object_details Get detailed metadata for a specific database object (table, view, function, sequence, index). Read pg_partition_info Get detailed information about a partitioned table. Returns warning if table is not partitioned. Read pg_partition_strategy_suggest Analyze a table and suggest optimal partitioning strategy. Read pg_partman_analyze_partition_health Analyze the health of partition sets managed by pg_partman. Checks for issues like data in default partitions, Read pg_partman_check_default Check if any data exists in the default partition that should be moved to child partitions. Data in default in Read pg_partman_partition_data Move data from the default partition to appropriate child partitions. Creates new partitions if needed for the Read pg_partman_show_config View the configuration for a partition set from part_config table. Read pg_partman_show_partitions List all child partitions for a partition set managed by pg_partman. Read pg_performance_baseline Capture current database performance metrics as a baseline for comparison. Read pg_pgcrypto_gen_random_bytes Generate cryptographically secure random bytes. Read pg_pgcrypto_hash Hash data using various algorithms (SHA-256, SHA-512, MD5, etc.). Read pg_point_in_polygon Check if a point is within any polygon in a table. The geometry column should contain POLYGON or MULTIPOLYGON Read pg_query_plan_compare Compare execution plans of two SQL queries to identify performance differences. Read pg_query_plan_stats Get query plan statistics showing planning time vs execution time (requires pg_stat_statements). Read pg_read_query Execute a read-only SQL query (SELECT, WITH). Returns rows as JSON. Pass transactionId to execute within a tra Read pg_recovery_status Check if server is in recovery mode (replica). Read pg_regexp_match Match text using POSIX regular expressions. Read pg_replication_status Check replication status and lag. Read pg_role_attributes Get detailed attributes for a PostgreSQL role: login, superuser, createdb, createrole, replication, bypassrls, Read pg_role_grants Show privileges and memberships for a PostgreSQL role. Includes role attributes, membership in other roles, an Read pg_role_list List PostgreSQL roles with attributes (login, superuser, createdb, etc.) and optional name filtering. Read pg_role_rls_policies List row-level security (RLS) policies for a table or all tables in a schema. Shows policy name, command, role Read pg_schema_snapshot Get a complete schema snapshot in a single agent-optimized JSON structure. Includes tables, columns, types, co Read pg_security_encryption_status Get encryption status including SSL configuration, password encryption method, and pgcrypto availability. Read pg_security_firewall_rules List detailed pg_hba.conf authentication rules with optional filtering by user or rule type. Read pg_security_firewall_status Get PostgreSQL host-based authentication (pg_hba.conf) summary — the PostgreSQL equivalent of a firewall. Read pg_security_password_validate Validate password strength against configurable policy. Uses local analysis (no database query). Read pg_security_sensitive_tables Identify tables and columns that may contain sensitive data based on column name patterns. Read pg_security_ssl_status Get SSL/TLS connection and certificate status for active connections. Read pg_security_user_privileges Get comprehensive privilege report for PostgreSQL roles including attributes, membership, and object grants. Read pg_seq_scan_tables Find tables with high sequential scan counts (potential missing indexes). Default minScans=10; use higher valu Read pg_server_version Get PostgreSQL server version information. Read pg_show_settings Show current PostgreSQL configuration settings. Filter by name pattern or exact setting name. Accepts: pattern Read pg_stat_activity Get currently running queries and connections. Read pg_stat_statements Get query statistics from pg_stat_statements (requires extension). Read pg_stats_correlation Calculate Pearson correlation coefficient between two numeric columns. Use groupBy to get correlation per cate Read pg_stats_descriptive Calculate descriptive statistics (count, min, max, avg, stddev, variance, sum) for a numeric column. Use group Read pg_stats_distinct Get distinct values from a column with count. Useful for understanding cardinality and unique value distributi Read pg_stats_distribution Analyze data distribution with histogram buckets, skewness, and kurtosis. Use groupBy to get distribution per Read pg_stats_frequency Get value frequency distribution (count per unique value) ordered by frequency descending. Shows the most comm Read pg_stats_hypothesis Perform one-sample t-test or z-test against a hypothesized mean. For z-test, provide populationStdDev (sigma) Read pg_stats_lag_lead Access data from previous (LAG) or next (LEAD) rows in an ordered set. Useful for comparisons, deltas, and cha Read pg_stats_moving_avg Calculate moving average (AVG OVER sliding window) for a numeric column. Specify windowSize for the number of Read pg_stats_ntile Divide ordered rows into N equal buckets (e.g., quartiles with buckets=4). Returns bucket assignment per row. Read pg_stats_outliers Detect statistical outliers in a numeric column using IQR (interquartile range) or Z-score method. IQR is robu Read pg_stats_percentiles Calculate percentiles (quartiles, custom percentiles) for a numeric column. Use groupBy to get percentiles per Read pg_stats_regression Perform linear regression analysis (y = mx + b) between two columns. Use groupBy to get regression per categor Read pg_stats_row_number Assign sequential row numbers within an ordered result set. Use partitionBy to restart numbering per group. Read pg_stats_sampling Get a random sample of rows. Use sampleSize for exact row count (any method), or percentage for approximate sa Read pg_stats_summary Get summary statistics (count, avg, min, max, stddev) for multiple numeric columns. Defaults to all numeric co Read pg_stats_time_series Aggregate data into time buckets for time series analysis. Use groupBy to get separate time series per categor Read pg_stats_top_n Get the top N rows ranked by a column. Auto-excludes long-content columns (text, json, bytea) from output unle Read pg_system_health Analyze current system health and resource usage including CPU, memory, and I/O patterns. Read pg_table_sizes Get sizes of all tables with indexes and total. Read pg_table_stats Get table access statistics. Read pg_text_headline Generate highlighted snippets from full-text search matches. Use select param for stable row identification (e Read pg_text_rank Get relevance ranking for full-text search results. Returns matching rows only with rank score. Read pg_text_search Full-text search using tsvector and tsquery. Read pg_text_search_config List available full-text search configurations (e.g., english, german, simple). Read pg_text_sentiment Perform basic sentiment analysis on text using keyword matching. Read pg_text_to_query Convert text to tsquery for full-text search. Modes: plain (default), phrase (proximity matching), websearch ( Read pg_text_to_vector Convert text to tsvector representation for full-text search operations. Read pg_topological_sort Get tables in safe DDL execution order. Read pg_transaction_rollback Rollback a transaction, undoing all changes. Read pg_transaction_rollback_to Rollback to a savepoint, undoing changes made after it. Read pg_transaction_status Check the status of an active transaction without modifying it. Read pg_trigram_similarity Find similar strings using pg_trgm trigram matching. Returns similarity score (0-1). Default threshold 0.3; us Read pg_unused_indexes Find indexes that have never been used (idx_scan = 0). Candidates for removal. Read pg_uptime Get server uptime and startup time. Read pg_user_roles List all roles assigned to a user/role, including admin option and SET option (PG 16+). Read pg_vacuum_stats Get detailed vacuum statistics including dead tuples, last vacuum times, and wraparound risk. Read pg_vector_aggregate Calculate average vector. Requires: table, column. Optional: groupBy, where. Read pg_vector_distance Calculate distance between two vectors. Valid metrics: l2 (default), cosine, inner_product. Read pg_vector_index_optimize Analyze vector column and recommend optimal index parameters for IVFFlat/HNSW. Read pg_vector_search Search for similar vectors. Requires: table, column, vector. Use select param to include identifying columns ( Read pg_vector_validate Validate vector dimensions against column. Pass any combination of: vector (to check), table+column (for colum

Related servers

Other MCP servers with similar tools — same risk classification, starter policies for each.

Questions about PostgreSQL MCP Server

Can an AI agent delete data through the PostgreSQL MCP Server MCP server? +

Yes. The PostgreSQL MCP Server server exposes 18 destructive tools including pg_cascade_simulator, pg_cron_cleanup_history, pg_cron_unschedule. These permanently remove resources with no undo. PolicyLayer blocks destructive tools by default so they never reach the upstream server.

How do I prevent bulk modifications through PostgreSQL MCP Server? +

The PostgreSQL MCP Server server has 52 write tools including pg_alert_threshold_set, pg_append_insight, pg_attach_partition. Set a rate limit in your policy -- for example, 10 calls per hour prevents an agent from making more than 10 modifications per hour. PolicyLayer enforces this at the gateway, before calls reach PostgreSQL MCP Server.

How many tools does the PostgreSQL MCP Server MCP server expose? +

274 tools across 4 categories: Destructive, Execute, Read, Write. 161 are read-only. 113 can modify, create, or delete data.

How do I enforce a policy on PostgreSQL MCP Server? +

Register the PostgreSQL MCP Server MCP server in PolicyLayer, apply the suggested rules above (adjust the limits to your use case), and point your AI client at the PolicyLayer proxy URL instead of the server directly. Your agents keep the same tools; PolicyLayer evaluates every call against policy before it executes. Nothing to install, live in minutes.

Enforce policy on every PostgreSQL MCP Server tool call.

Deterministic rules across all 274 PostgreSQL MCP Server tools. Per-identity grants. Full audit log. Live in minutes. Nothing to install.

Instant setup, no code required.

274 PostgreSQL MCP Server tools catalogued and risk-classified — across an index of 46,500+ MCP servers.

// WHERE THIS COMES FROM

These policies come from PostgreSQL MCP Server's registry record.

The record behind this page: verified identity, auth posture, risk grade, every tool classified, recommended policy — re-checked continuously.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.