# PostgreSQL Performance (read-only)

> PostgreSQL Performance (read-only) is an open-source MCP server for databases. Read-only PostgreSQL performance diagnostics: slow queries, EXPLAIN, index advice, locks, functions. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Open source
- **Repository:** https://github.com/gouranshul/pg-perf-mcp
- **MCP Registry name:** io.github.gouranshul/pg-perf-mcp
- **Categories:** databases
- **Listing updated:** 2026-11-13

## About

Read-only PostgreSQL performance diagnostics: slow queries, EXPLAIN, index advice, locks, functions

## Install

### Claude Code (Terminal)

```sh
claude mcp add pg-perf-mcp --env PGPERF_DB_URL='<PGPERF_DB_URL>' --env PGPERF_DB_USER='<PGPERF_DB_USER>' --env PGPERF_DB_PASSWORD='<PGPERF_DB_PASSWORD>' --env MCP_API_KEY='<MCP_API_KEY>' -- docker run -i --rm -e PGPERF_DB_URL -e PGPERF_DB_USER -e PGPERF_DB_PASSWORD -e MCP_API_KEY ghcr.io/gouranshul/pg-perf-mcp:0.1.0
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "pg-perf-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PGPERF_DB_URL",
        "-e",
        "PGPERF_DB_USER",
        "-e",
        "PGPERF_DB_PASSWORD",
        "-e",
        "MCP_API_KEY",
        "ghcr.io/gouranshul/pg-perf-mcp:0.1.0"
      ],
      "env": {
        "PGPERF_DB_URL": "<PGPERF_DB_URL>",
        "PGPERF_DB_USER": "<PGPERF_DB_USER>",
        "PGPERF_DB_PASSWORD": "<PGPERF_DB_PASSWORD>",
        "MCP_API_KEY": "<MCP_API_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "pg-perf-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PGPERF_DB_URL",
        "-e",
        "PGPERF_DB_USER",
        "-e",
        "PGPERF_DB_PASSWORD",
        "-e",
        "MCP_API_KEY",
        "ghcr.io/gouranshul/pg-perf-mcp:0.1.0"
      ],
      "env": {
        "PGPERF_DB_URL": "<PGPERF_DB_URL>",
        "PGPERF_DB_USER": "<PGPERF_DB_USER>",
        "PGPERF_DB_PASSWORD": "<PGPERF_DB_PASSWORD>",
        "MCP_API_KEY": "<MCP_API_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "pg-perf-mcp": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PGPERF_DB_URL",
        "-e",
        "PGPERF_DB_USER",
        "-e",
        "PGPERF_DB_PASSWORD",
        "-e",
        "MCP_API_KEY",
        "ghcr.io/gouranshul/pg-perf-mcp:0.1.0"
      ],
      "env": {
        "PGPERF_DB_URL": "<PGPERF_DB_URL>",
        "PGPERF_DB_USER": "<PGPERF_DB_USER>",
        "PGPERF_DB_PASSWORD": "<PGPERF_DB_PASSWORD>",
        "MCP_API_KEY": "<MCP_API_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "pg-perf-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PGPERF_DB_URL",
        "-e",
        "PGPERF_DB_USER",
        "-e",
        "PGPERF_DB_PASSWORD",
        "-e",
        "MCP_API_KEY",
        "ghcr.io/gouranshul/pg-perf-mcp:0.1.0"
      ],
      "env": {
        "PGPERF_DB_URL": "<PGPERF_DB_URL>",
        "PGPERF_DB_USER": "<PGPERF_DB_USER>",
        "PGPERF_DB_PASSWORD": "<PGPERF_DB_PASSWORD>",
        "MCP_API_KEY": "<MCP_API_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "pg-perf-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PGPERF_DB_URL",
        "-e",
        "PGPERF_DB_USER",
        "-e",
        "PGPERF_DB_PASSWORD",
        "-e",
        "MCP_API_KEY",
        "ghcr.io/gouranshul/pg-perf-mcp:0.1.0"
      ],
      "env": {
        "PGPERF_DB_URL": "<PGPERF_DB_URL>",
        "PGPERF_DB_USER": "<PGPERF_DB_USER>",
        "PGPERF_DB_PASSWORD": "<PGPERF_DB_PASSWORD>",
        "MCP_API_KEY": "<MCP_API_KEY>"
      }
    }
  }
}
```

## FAQ

### Is PostgreSQL Performance (read-only) free?

Yes. PostgreSQL Performance (read-only) is open source, so you can use and self-host it for free.

### How do I add PostgreSQL Performance (read-only) to Claude Code?

Run this command in your terminal: claude mcp add pg-perf-mcp --env PGPERF_DB_URL='<PGPERF_DB_URL>' --env PGPERF_DB_USER='<PGPERF_DB_USER>' --env PGPERF_DB_PASSWORD='<PGPERF_DB_PASSWORD>' --env MCP_API_KEY='<MCP_API_KEY>' -- docker run -i --rm -e PGPERF_DB_URL -e PGPERF_DB_USER -e PGPERF_DB_PASSWORD -e MCP_API_KEY ghcr.io/gouranshul/pg-perf-mcp:0.1.0

### What are the best alternatives to PostgreSQL Performance (read-only)?

The closest alternatives to PostgreSQL Performance (read-only) are Midplane, PlatypusDB, Lorebase, Sovaria and model2data studio.

## Alternatives

- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [PlatypusDB](https://ai-powered.com/mcp/platypusdb): PlatypusDB is an open-source MCP server for databases.
- [Lorebase](https://ai-powered.com/mcp/lorebase): Lorebase is an open-source MCP server for knowledge and memory.
- [Sovaria](https://ai-powered.com/mcp/sovaria): Sovaria is a freemium MCP server for databases.
- [model2data studio](https://ai-powered.com/mcp/model2data-studio): model2data studio is a freemium MCP server for databases.
- [semlayer](https://ai-powered.com/mcp/semlayer): semlayer is a free MCP server for databases.
- [bricksentry](https://ai-powered.com/mcp/bricksentry): bricksentry is an open-source MCP server for databases.
- [MCP Toolbox for Databases](https://ai-powered.com/mcp/mcp-toolbox-for-databases-2): MCP Toolbox for Databases is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/postgresql-performance-read-only
