Skip to content
Agentmart
Submit a tool

PostgreSQL MCP Server

Python MCP server for PostgreSQL database inspection and querying

Connector by musaddiq-dev · GitHub account verified by the MCP Registry

IndexedMITLocal (stdio)★ 1
Write a review

Install

Works with Claude Code, Codex, VS Code, Cursor, Windsurf, Claude Desktop. Read the repository before you give any tool access to your data.

npx agentmarket install connector/musaddiq-dev-postgresql-mcp-server

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Python MCP server for PostgreSQL database inspection and querying

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this server can do and what it asks for, from its tool list, install config and code. Checked Oct 25, 2026.

Tools
9 read · 0 write · 1 delete
Secrets
1 (API keys, tokens or passwords)
Install scripts
None found
Runs as
Python package

Tools by what they do 10

Read from the source code; the running server may list different tools.

Read 9 · Look things up without changing anything.

  • postgresql_analyze_indexes
  • postgresql_describe_table
  • postgresql_execute_read_query
  • postgresql_explain_query
  • postgresql_get_database_summary
  • postgresql_get_relationships
  • postgresql_list_tables
  • postgresql_preview_table
  • postgresql_search_sql_definitions

Delete 1 · Delete, drop, revoke or wipe things.

  • postgresql_execute_write_query

Secrets and settings it asks for

Secrets: values you paste in that let it act as you.

  • POSTGRES_PASSWORD

Other settings (environment variables or headers).

  • POSTGRES_DB
  • POSTGRES_HOST
  • POSTGRES_PORT
  • POSTGRES_READ_QUERY_LIMIT
  • POSTGRES_USER

Network hosts it talks to 1

  • github.com · found in code

Tools (10)

Read from the source code; the running server may differ. Descriptions are the server’s own words; hidden characters are shown as [U+…].

  • postgresql_analyze_indexesAnalyze PostgreSQL Indexesread-only

    Returns all indexes, their columns, and sizes for the specified table. Uses pg_size_pretty to display human-readable sizes. Args: table_name (str): The name of the table to analyze indexes for Returns: List[Dict[str, Any]]: List of indexes with: - index_name: Name of the index - columns: List of column names in the index - is_unique: Whether the index enforces uniqueness - is_primary: Whether this is a primary key index - index_type: Type of index (btree, hash, etc.) - size: Human-readable size of the index

  • postgresql_describe_tableDescribe PostgreSQL Tableread-only

    Queries information_schema.columns to return column details for a table. Args: table_name (str): The name of the table to describe Returns: List[Dict[str, Any]]: List of column dictionaries with name, type, and nullability

  • postgresql_execute_read_queryExecute PostgreSQL Read Queryread-only

    Executes read-only SQL queries (SELECT, etc). Safe to auto-approve. Uses READ ONLY transaction mode to ensure no data modification can occur. Automatically rolls back any transaction to prevent accidental commits. Args: query (str): The SQL query to execute Returns: List[Dict[str, Any]]: Query results as a list of dictionaries, or a string with error hints Raises: ValueError: If query attempts to modify data

  • postgresql_execute_write_queryExecute PostgreSQL Write Querycan change or delete data

    Executes data modification queries (INSERT, UPDATE, DELETE, DROP). Requires manual approval. Executes the query and explicitly commits the transaction. This tool should be used for any SQL statements that modify data or database structure. Args: query (str): The SQL query to execute Returns: str: A success message with the number of rows affected (if applicable)

  • postgresql_explain_queryExplain PostgreSQL Queryread-only

    Prepends EXPLAIN to the query to return the execution plan without running it. Args: query (str): The SQL query to explain Returns: List[Dict[str, Any]]: The EXPLAIN plan results

  • postgresql_get_database_summaryGet PostgreSQL Database Summaryread-only

    Returns a comprehensive summary of the database. Returns: Dict[str, Any]: Dictionary containing database name, PostgreSQL version, and table count

  • postgresql_get_relationshipsGet PostgreSQL Relationshipsread-only

    Queries information_schema to find Foreign Keys pointing TO and FROM this table. Args: table_name (str): The name of the table to analyze for relationships Returns: List[Dict[str, Any]]: List of foreign key relationships including: - relationship_type: 'incoming' or 'outgoing' - foreign_table_name: The other table involved in the relationship - constraint_name: Name of the foreign key constraint - column_name: The column in this table - foreign_column_name: The column in the referenced table

  • postgresql_list_tablesList PostgreSQL Tablesread-only

    Returns a list of all table names in the public schema. Filters out system tables and returns only user-created tables. Returns: List[str]: List of table names in the public schema

  • postgresql_preview_tablePreview PostgreSQL Tableread-only

    Returns the first 10 rows of a table (LIMIT 10). Useful for quickly inspecting table data without running full queries. Args: table_name (str): The name of the table to preview Returns: List[Dict[str, Any]]: List of up to 10 rows as dictionaries

  • postgresql_search_sql_definitionsSearch PostgreSQL SQL Definitionsread-only

    Searches information_schema.routines or pg_proc for code containing the search_term. Finds functions, procedures, and other database objects that contain the search term in their definitions or bodies. Args: search_term (str): The term to search for in SQL definitions Returns: List[Dict[str, Any]]: List of matching routines with: - routine_name: Name of the function/procedure - routine_type: Type of routine (FUNCTION, PROCEDURE, etc.) - schema_name: Schema containing the routine - definition: The routine definition (truncated if too long)

Compare and alternatives

    Featured in

    Signals

    Stars
    1
    Forks
    0
    Open issues
    0
    Weekly downloads
    3,567
    Last commit
    May 23, 2026 (5 months ago)
    Last release
    May 23, 2026 (5 months ago)
    Last package publish
    May 23, 2026 (5 months ago)

    From GitHub (fetched Oct 24, 2026) and the package registry.

    Details

    Registry name
    io.github.musaddiq-dev/postgresql-mcp-server
    Version
    0.1.2
    Auth
    API key
    License
    MIT
    First seen
    Oct 24, 2026
    Last checked
    Oct 24, 2026

    More from musaddiq-dev

    Cite this page

    PostgreSQL MCP Server. Agent Mart. https://agentmart.dev/connectors/musaddiq-dev-postgresql-mcp-server (last updated 2026-10-24)