Feedback

Mcp Postgres Analytics

@archimedes-market Claim

Basic information

Runtime
Python
Category
License
MIT
Transports
stdio
Author
archimedes-market
Submitted by
Community
Quality
25

About Mcp Postgres Analytics Server

Curated by Archimedes Market with a verified Trust Report (security, quality, license, complexity).

Mcp Postgres Analytics is a MCP server in the Data & Analytics category listed in the AddMCP.net directory, published by archimedes-market. It exposes 2 tools, including Reads-only, query_plan. Supported transport: stdio. Runtime: Python. License: MIT. Source code is hosted on github.com. Related topics: analytics, database, mcp, mcp-server, observability.

Setup

{
    "mcpServers": {
        "postgres-analytics": {
            "command": "mcp-postgres-analytics",
            "args": [
                "serve"
            ],
            "env": {
                "MCP_POSTGRES_DSN": "postgresql://reader@host:5432/db"
            }
        }
    }
}

Mcp Postgres Analytics config

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

{
    "mcpServers": {
        "postgres-analytics": {
            "command": "mcp-postgres-analytics",
            "args": [
                "serve"
            ],
            "env": {
                "MCP_POSTGRES_DSN": "postgresql://reader@host:5432/db"
            }
        }
    }
}

Mcp Postgres Analytics tools

  • Reads-only — no DDL, DML, or writes ever
  • query_plan — runs only `EXPLAIN (ANALYZE, BUFFERS, VERBOSE)`—never the query itself

Overview

What is Mcp Postgres Analytics?

Mcp Postgres Analytics is a read-only PostgreSQL analytics agent exposed as an MCP server. It connects to a production database safely—never performing any writes, DDL, or DML—and provides tools for query planning, performance diagnostics, and database statistics.

How to use Mcp Postgres Analytics?

Install via pip install git+https://github.com/archimedes-market/mcp-postgres-analytics, set the environment variable MCP_POSTGRES_DSN to a postgresql:// connection string, then run mcp-postgres-analytics serve.

Key features of Mcp Postgres Analytics

  • Reads-only: no DDL, DML, or writes ever
  • Startup refuses roles with write privileges (CREATE, INSERT, etc.)
  • query_plan runs only EXPLAIN (ANALYZE, BUFFERS, VERBOSE)—never the query itself
  • Provides tools for slow queries, index usage, table bloat, vacuum status, connections, lock waits, and size summaries
  • Connects as a role with minimal pg_read_all_stats and CONNECT privileges

Use cases of Mcp Postgres Analytics

  • Monitor slow queries via pg_stat_statements
  • Analyze query execution plans without running the actual query
  • Detect index bloat and missing-index hints
  • Identify lock contention and blocking transaction chains
  • Track vacuum/autovacuum progress and wraparound risk

Frequently asked questions

1 Is Mcp Postgres Analytics really read-only?

Yes. The server validates at startup that the role in MCP_POSTGRES_DSN has no CREATE, INSERT, UPDATE, DELETE, TRUNCATE, ALTER, or DROP privileges. If it does, the server exits with a clear error. Additionally, the query_plan tool never executes the submitted query—it runs only EXPLAIN (...).

2 What database permissions are required?

The role needs only pg_read_all_stats and CONNECT privileges. No write permissions are allowed.

3 Which tools are available?

Seven tools: query_plan, slow_queries, index_usage, table_bloat, vacuum_status, connection_stats, lock_waits, and size_summary. Each provides production-safe diagnostic information.

4 How do I install Mcp Postgres Analytics?

Run pip install git+https://github.com/archimedes-market/mcp-postgres-analytics. Then set the MCP_POSTGRES_DSN environment variable to your PostgreSQL connection string and start the server with mcp-postgres-analytics serve.

5 Does Mcp Postgres Analytics modify the database?

No. It is designed to be a read-only agent. All tools only query system statistics and views; no data is written to the database.

Comments

No comments yet

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

Sign In

Feedback 💬