Feedback

local_pgsql MCP Server

@z-waterking Claim

Basic information

Category
License
Not specified
Transports
stdio
Author
z-waterking
Submitted by
Community
Quality
10

About local_pgsql MCP Server

一个本地访问PGSQL的MCP Server

local_pgsql is a MCP server in the Other category listed in the AddMCP.net directory, published by z-waterking. Supported transport: stdio. Source code is hosted on github.com. Related topics: analysis, database, pgsql.

Setup

{
    "mcpServers": {
        "github": {
            "command": "docker",
            "args": [
                "build",
                "-t",
                "mcp-pgsql-python-service",
                ".",
                "&&",
                "docker",
                "run",
                "-p",
                "8000:8000",
                "-e",
                "DB_HOST=${DB_HOST}",
                "-e",
                "DB_PORT=${DB_PORT:-5432}",
                "-e",
                "DB_NAME=${DB_NAME}",
                "-e",
                "DB_USER=${DB_USER}",
                "-e",
                "DB_PASSWORD=${DB_PASSWORD}",
                "mcp-pgsql-python-service"
            ],
            "env": {
                "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_TOKEN",
                "DB_HOST": "postgres",
                "DB_PORT": "5432",
                "DB_NAME": "postgres",
                "DB_USER": "postgres",
                "DB_PASSWORD": "postgres"
            }
        }
    }
}

local_pgsql MCP Server config

Add this server to your MCP-compatible client using the configuration below.

{
    "mcpServers": {
        "github": {
            "command": "docker",
            "args": [
                "build",
                "-t",
                "mcp-pgsql-python-service",
                ".",
                "&&",
                "docker",
                "run",
                "-p",
                "8000:8000",
                "-e",
                "DB_HOST=${DB_HOST}",
                "-e",
                "DB_PORT=${DB_PORT:-5432}",
                "-e",
                "DB_NAME=${DB_NAME}",
                "-e",
                "DB_USER=${DB_USER}",
                "-e",
                "DB_PASSWORD=${DB_PASSWORD}",
                "mcp-pgsql-python-service"
            ],
            "env": {
                "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_TOKEN",
                "DB_HOST": "postgres",
                "DB_PORT": "5432",
                "DB_NAME": "postgres",
                "DB_USER": "postgres",
                "DB_PASSWORD": "postgres"
            }
        }
    }
}

local_pgsql MCP Server tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is local_pgsql?

local_pgsql is a database analytics and query automation toolkit that provides structured data access for analysis, reporting, and AI-augmented workflows. It is designed for developers and data analysts who need to explore PostgreSQL databases, run parameterized SQL queries, and perform statistical analysis through a modular tool interface.

How to use local_pgsql?

Initialize the MCP with a database connection string, register tools and prompts using the provided API, then call any of the built-in tools or prompts by name. For example, register a DatabaseManager for a PostgreSQL URI and enable tools such as list_tables, run_query, or get_summary_statistics.

Key features of local_pgsql

  • List all tables and get their schemas
  • Preview table contents with data sampling
  • Execute parameterized SQL queries
  • Compute numerical summaries and correlation matrices
  • Perform group-by aggregations with multiple functions
  • Run temporal aggregation and anomaly detection

Use cases of local_pgsql

  • Data exploration to rapidly understand dataset structure and content
  • Automated reporting with scheduled statistical summaries
  • Anomaly monitoring for real-time data quality checks
  • AI-augmented analysis via structured data access for LLMs

Frequently asked questions

1 What database systems does local_pgsql support?

The toolkit includes a DatabaseManager interface for backend-agnostic operations, and the integration example shows a PostgreSQL connection string.

2 What tools are available for statistical analysis?

Tools include get_summary_statistics (mean, standard deviation), analyze_correlations (correlation matrices), and group_by_analysis (multi-function aggregations).

3 Does local_pgsql include built-in prompts?

Yes, it provides a basic SQL guide (basic_sql_guide) and analysis task templates (data_analysis_tasks).

4 How are tools registered and invoked?

Tools are dynamically registered via the @mcp.tool decorator and called using mcp.call_tool with the tool name and parameters.

5 What type of anomaly detection is supported?

It offers Z-score and IQR based anomaly detection through the detect_anomalies tool.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬