Mmcp.market

PostgreSQL MCP Server

by neverinfamous·io.github.neverinfamous/postgres-mcp·v1.0.2·12 stars

PostgreSQL MCP server with 203 tools, connection pooling, HTTP/SSE, OAuth 2.1, and tool filtering

A85/100grade A
What users say
No reviews yet
Be the first
Safety scan
A85/100

full report

Adoption
Growing

12 stars65 downloads/wk

Reviews

Write one

Nobody has reviewed PostgreSQL MCP Server yet.

If you have run it, two minutes of your experience saves the next person an afternoon.

PostgreSQL MCP Server tools (100, 26 write)

write = sends, deletes, buys or posts

Read from the package source without running it. The installed server may list more.

  • pg_alert_threshold_set

    Get recommended alert thresholds for monitoring key database metrics. Note: This is informational only - returns suggested warning/critical thresholds for external monitoring tools. Does not configure alerts in PostgreSQL itself.

  • pg_analyzewrite action

    Update table statistics for the query planner.

  • pg_analyze_db_health

    Comprehensive database health analysis including cache hit ratio, bloat, replication, and connection stats.

  • pg_analyze_query_indexes

    Analyze a specific query for index recommendations using EXPLAIN ANALYZE.

  • pg_analyze_workload_indexes

    Analyze database workload using pg_stat_statements to recommend missing indexes.

  • pg_backup_physical

    Generate pg_basebackup command for physical (binary) backup.

  • pg_backup_schedule_optimize

    Analyze database activity patterns and recommend optimal backup schedule.

  • pg_batch_insertwrite action

    Insert multiple rows in a single statement. More efficient than individual inserts. Rows array must not be empty.

  • pg_cancel_backendwrite action

    Cancel a running query (graceful, preferred over terminate).

  • pg_capacity_planning

    Analyze database growth trends and provide capacity planning forecasts. Note: Growth estimates are based on pg_stat_user_tables counters since last stats reset; accuracy depends on how long stats have been accumulating.

  • pg_citext_analyze_candidates

    Find TEXT columns that may benefit from case-insensitive comparisons. Looks for common patterns like email, username, name, slug, etc.

  • pg_citext_compare

    Compare two values using case-insensitive semantics. Useful for testing citext behavior before converting columns.

  • pg_citext_convert_column

    Convert an existing TEXT column to CITEXT for case-insensitive comparisons. This is useful for retrofitting case-insensitivity to existing columns like email or username. Note: If views depend on this column, you must drop and recreate them manually before conversion.

  • pg_citext_create_extensionwrite action

    Enable the citext extension for case-insensitive text columns. citext is ideal for emails, usernames, and other identifiers where case shouldn't matter.

  • pg_citext_list_columns

    List all columns using the citext type in the database. Useful for auditing case-insensitive columns.

  • pg_citext_schema_advisor

    Analyze a specific table and recommend which columns should use citext. Provides schema design recommendations based on column names and existing data patterns. Requires the 'table' parameter to specify which table to analyze.

  • pg_cluster

    Physically reorder table data based on an index. Call with no args to re-cluster all previously-clustered tables.

  • pg_connection_stats

    Get connection statistics by database and state.

  • pg_copy_export

    Export query results using COPY TO. Use query/sql for custom query or table for SELECT *.

  • pg_copy_import

    Generate COPY FROM command for importing data.

  • pg_count

    Count rows in a table, optionally with a WHERE clause or specific column.

  • pg_create_backup_planwrite action

    Generate a backup strategy recommendation with cron schedule.

  • pg_create_indexwrite action

    Create an index on a table. Supports btree, hash, gin, gist, brin index types.

  • pg_create_tablewrite action

    Create a new table with specified columns and constraints. Supports composite primary keys and table-level constraints.

  • pg_cron_alter_job

    Modify an existing cron job. Can change schedule, command, database, username, or active status. Only specify the parameters you want to change.

  • pg_cron_cleanup_historywrite action

    Delete old job run history records. Helps prevent the cron.job_run_details table from growing too large. By default, removes records older than 7 days.

  • pg_cron_create_extensionwrite action

    Enable the pg_cron extension for job scheduling. Requires superuser privileges.

  • pg_cron_job_run_detailswrite action

    View execution history for cron jobs. Shows start/end times, status, and return messages. Useful for monitoring and debugging scheduled jobs.

  • pg_cron_list_jobs

    List all scheduled cron jobs. Shows job ID, name, schedule, command, and status. Jobs without names (jobname: null) must be referenced by jobId. Default limit: 50 rows.

  • pg_cron_schedule

    Schedule a new cron job. Supports standard cron syntax (e.g., "0 2 * * *" for 2 AM daily) or interval syntax (e.g., "30 seconds"). Note: pg_cron allows duplicate job names; use unique names to avoid confusion. Returns the job ID.

  • pg_cron_schedule_in_database

    Schedule a cron job to run in a different database. Useful for cross-database maintenance tasks. Returns the job ID.

  • pg_cron_unschedulewrite action

    Remove a scheduled cron job by its ID or name. If both are provided, jobName takes precedence. Job ID accepts numbers or numeric strings. Works for both active and inactive jobs.

  • pg_database_size

    Get the size of a database.

  • pg_describe_table

    Get detailed table structure including columns, types, and constraints. For tables/views only, not sequences.

  • pg_drop_indexwrite action

    Drop an index from a table. Supports IF EXISTS, CASCADE, and CONCURRENTLY options.

  • pg_drop_tablewrite action

    Drop a table from the database.

  • pg_dump_schema

    Get the pg_dump command for a schema or database.

  • pg_dump_table

    Generate DDL for a table or sequence. Returns CREATE TABLE for tables, CREATE SEQUENCE for sequences.

  • pg_execute_codewrite action

    Execute TypeScript/JavaScript code in a sandboxed environment with access to all PostgreSQL tools via the pg.* API. Available API groups: - pg.core: readQuery, writeQuery, listTables, describeTable, createTable, createIndex, etc. (18 methods) - pg.transactions: begin, commit, rollback, savepoint, execute (7 methods) - pg.jsonb: extract, set, insert, delete, contains, pathQuery (19 methods) - pg.te

  • pg_exists

    Check if rows exist in a table. WHERE clause is optional: with WHERE = checks matching rows; without WHERE = checks if table has any rows at all. For table *schema* existence, use pg_list_tables.

  • pg_get_indexes

    List indexes with usage statistics. When table is omitted, lists ALL database indexes (can be large). Use schema/limit to filter.

  • pg_jsonb_agg

    Aggregate rows into a JSONB array. With groupBy, returns all groups with their aggregated items.

  • pg_jsonb_array

    Build a JSONB array from values. Accepts {values: [...]} or {elements: [...]}. Returns {array: [...]}.

  • pg_jsonb_contains

    Find rows where JSONB column contains the specified value. Note: Empty object {} matches all rows.

  • pg_jsonb_deletewrite action

    Delete a key or array element from a JSONB column. Accepts path as string or array. Note: rowsAffected reflects matched rows, not whether key existed.

  • pg_jsonb_diff

    Compare two JSONB objects. Returns top-level key differences only (shallow comparison, not recursive).

  • pg_jsonb_extract

    Extract value from JSONB at specified path. Returns null if path does not exist in data structure. Use select param to include identifying columns.

  • pg_jsonb_index_suggest

    Analyze JSONB column and suggest indexes. Only works on object-type JSONB (not arrays).

  • pg_jsonb_insertwrite action

    Insert value into JSONB array. Index -1 inserts BEFORE last element; use insertAfter:true with -1 to append at end.

  • pg_jsonb_keys

    Get all unique keys from a JSONB object column (deduplicated across rows).

  • pg_jsonb_merge

    Merge two JSONB objects. deep=true (default) recursively merges. mergeArrays=true concatenates arrays.

  • pg_jsonb_normalize

    Normalize JSONB to key-value pairs. Use idColumn to specify row identifier (default: "id" if exists, else ctid).

  • pg_jsonb_object

    Build a JSONB object. Use data: {name: "John", age: 30} or object: {name: "John"}. Returns {object: {...}}.

  • pg_jsonb_path_query

    Query JSONB using SQL/JSON path expressions (PostgreSQL 12+). Note: Recursive descent (..) syntax is not supported by PostgreSQL.

  • pg_jsonb_security_scan

    Scan JSONB for security issues. Only works on object-type JSONB (not arrays). Use larger sampleSize for thorough scans.

  • pg_jsonb_set

    Set value in JSONB at path. Uses dot-notation by default; for literal dots in keys use array format ["key.with.dots"]. Use empty path ('' or []) to replace entire column value.

  • pg_jsonb_stats

    Get statistics about JSONB column usage. Note: topKeys only applies to object-type JSONB, not arrays.

  • pg_jsonb_strip_nullswrite action

    Remove null values from a JSONB column. Use preview=true to see changes without modifying data.

  • pg_jsonb_typeof

    Get JSONB type at path. Uses dot-notation (a.b.c), not JSONPath ($). Response includes columnNull to distinguish NULL columns.

  • pg_jsonb_validate_path

    Validate a JSONPath expression and test it against sample data. Supports vars for parameterized paths.

  • pg_kcache_create_extensionwrite action

    Enable the pg_stat_kcache extension for OS-level performance metrics. Requires pg_stat_statements to be installed first. Both extensions must be in shared_preload_libraries.

  • pg_kcache_database_stats

    Get aggregated OS-level statistics for a database. Shows total CPU time, I/O, and page faults across all queries.

  • 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 what SQL did AND what system resources it consumed. orderBy options: 'total_time' (default), 'cpu_time', 'reads', 'writes'. Use minCalls parameter to filter by call count.

  • pg_kcache_reset

    Reset pg_stat_kcache statistics. Use this to start fresh measurements. Note: This also resets pg_stat_statements statistics.

  • pg_kcache_resource_analysis

    Analyze queries to classify them as CPU-bound, I/O-bound, or balanced. Helps identify the root cause of performance issues - is the query computation-heavy or disk-heavy?

  • pg_kcache_top_cpu

    Get top CPU-consuming queries. Shows which queries spend the most time in user CPU (application code) vs system CPU (kernel operations).

  • pg_kcache_top_io

    Get top I/O-consuming queries. Shows filesystem-level reads and writes, which represent actual disk access (not just shared buffer hits).

  • pg_list_extensions

    List installed PostgreSQL extensions with versions.

  • pg_list_objects

    List database objects filtered by type. Use type: "table" (singular) or types: ["table","view"] (array). Supports: table, view, materialized_view, function, procedure, sequence, index, trigger.

  • pg_list_partitions

    List all partitions of a partitioned table. Returns warning if table is not partitioned.

  • pg_list_tables

    List all tables, views, and materialized views with metadata. Use limit to restrict results.

  • pg_ltree_convert_column

    Convert an existing TEXT column to LTREE type. Note: If views depend on this column, you must drop and recreate them manually before conversion.

  • pg_ltree_create_extensionwrite action

    Enable the ltree extension for hierarchical tree-structured labels.

  • pg_ltree_create_indexwrite action

    Create a GiST index on an ltree column for efficient tree queries.

  • pg_ltree_lca

    Find the longest common ancestor of multiple ltree paths.

  • pg_ltree_list_columns

    List all columns using the ltree type in the database.

  • pg_ltree_match

    Match ltree paths using lquery pattern syntax.

  • pg_ltree_query

    Query hierarchical relationships in ltree columns. Supports exact paths (descendants/ancestors) and lquery patterns with wildcards.

  • pg_ltree_subpath

    Extract a portion of an ltree path.

  • pg_object_details

    Get detailed metadata for a specific database object (table, view, function, sequence, index).

  • pg_read_querywrite action

    Execute a read-only SQL query (SELECT, WITH). Returns rows as JSON. Pass transactionId to execute within a transaction.

  • pg_recovery_status

    Check if server is in recovery mode (replica).

  • pg_reindex

    Rebuild indexes to improve performance. For target: database, name defaults to the current database if omitted.

  • pg_reload_conf

    Reload PostgreSQL configuration without restart.

  • pg_replication_status

    Check replication status and lag.

  • pg_reset_stats

    Reset statistics counters (requires superuser).

  • pg_resource_usage_analyze

    Analyze current resource usage including CPU, memory, and I/O patterns.

  • pg_restore_command

    Generate pg_restore command for restoring backups.

  • pg_restore_validate

    Generate commands to validate backup integrity and restorability.

  • pg_server_version

    Get PostgreSQL server version information.

  • pg_set_config

    Set a configuration parameter for the current session.

  • pg_show_settings

    Show current PostgreSQL configuration settings. Filter by name pattern or exact setting name. Accepts: pattern, setting, or name parameter.

  • pg_table_sizes

    Get sizes of all tables with indexes and total.

  • pg_terminate_backend

    Terminate a database connection (forceful, use with caution).

  • pg_truncatewrite action

    Truncate a table, removing all rows quickly. Use cascade to truncate dependent tables.

  • pg_upsertwrite action

    Insert a row or update if it already exists (INSERT ... ON CONFLICT DO UPDATE). Specify conflict columns for uniqueness check. Use data or values for column-value pairs.

  • pg_uptime

    Get server uptime and startup time.

  • pg_vacuumwrite action

    Run VACUUM to reclaim storage and update visibility map. Use analyze: true to also update statistics. Verbose output goes to PostgreSQL server logs.

  • pg_vacuum_analyzewrite action

    Run VACUUM and ANALYZE together for optimal performance. Verbose output goes to PostgreSQL server logs.

  • pg_write_querywrite action

    Execute a write SQL query (INSERT, UPDATE, DELETE). Returns affected row count. Pass transactionId to execute within a transaction.

Public scan report

scanner v0.1.10 · 2026-10-01 · same rubric, same numbers if you re-run it

1 medium
  • Code scan279 source files scanned20/25
  • –Live reliabilityno gateway calls yet and no remote to proben/a
  • –Tool poisoningtools not inspected (local package is not executed); not countedn/a
  • Auth qualitylocal package, no credentials required12/15
  • Maintenancelast push 3 days ago15/15
  • Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10

Findings (1)

  • mediumeval / new Function usedexec.eval
    dist/codemode/types.js: …his access /\beval\s*\(/, // No eval() /\bFunction\s*\(/, // No Funct…
Overall 85/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

Install PostgreSQL MCP Server in Claude Code, Cursor or VS Code

Runs npx -y @neverinfamous/postgres-mcp on your machine. Read the scan report first; the gateway never runs local packages.

claude mcp add postgres-mcp -- npx -y @neverinfamous/postgres-mcp
Add to Cursor

What the publisher says

From the PostgreSQL MCP Server repository's README, as published. We do not edit it. Read it on GitHub

postgres-mcp

<!-- mcp-name: io.github.neverinfamous/postgres-mcp -->

PostgreSQL MCP Server binding the Model Context Protocol to a secure PostgreSQL sandbox.

Features Code Mode — a revolutionary approach that provides access to all 278 tools through a secure, true V8 isolate (workerthreads), eliminating the massive token overhead of multi-step tool calls. Also includes schema introspection, migration tracking, smart tool filtering, deterministic error handling, connection pooling, HTTP/SSE Transport, OAuth 2.1 authentication, and extension support for citext, ltree, pgcrypto, pgcron, pgstatkcache, pgvector, PostGIS, and HypoPG.

278 Specialized Tools · 24 Resources · 21 AI-Powered Prompts

Docker Hub • npm Package • MCP Registry • Wiki • Tool Reference • Changelog

🎯 What Sets Us Apart

Shortened. The full README is on GitHub.

Nothing above is checked by us. What we check is on the safety report.

PostgreSQL MCP Server: common questions

Is PostgreSQL MCP Server safe?
Yes, by our scan: it is graded A (85/100). Read the PostgreSQL MCP Server safety report
How do I install PostgreSQL MCP Server?
It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
Does PostgreSQL MCP Server need an API key?
Not as far as the registry entry and our scan can tell: no credentials are declared or required.
Is PostgreSQL MCP Server maintained?
The last commit was 15 days ago (2026-09-28). The latest release is v1.0.2.
What can I use instead of PostgreSQL MCP Server?
Servers from other publishers that do the same job: PostgreSQL MCP server, PostgreSQL MCP Server and Postgres MCP server. Compare all PostgreSQL MCP Server alternatives.

Alternatives to PostgreSQL MCP Server

Same job from other publishers: the closest match first, then the best rated.

All PostgreSQL MCP Server alternatives →
  • PostgreSQL
    MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.
    B
  • PostgreSQL MCP Server
    PostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants
    B
  • Postgres
    Enterprise PostgreSQL MCP server with NL queries, hybrid search (pgvector+BM25), and web UI
    A
  • PostgreSQL (hardened, read-only)
    Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.
    C
  • Read Only Local Postgres
    MCP server for read-only PostgreSQL database queries in Claude Desktop
    A

More from neverinfamous →