Skip to main content
Glama
perrypixel

Simple PostgreSQL MCP Server

by perrypixel

Simple PostgreSQL MCP Server

A minimal Model Context Protocol (MCP) server for executing SQL queries on PostgreSQL databases with configurable permissions.

Features

  • Execute SQL queries with optional read-only or write access

  • Server-level mode (read-only/write) configurable via command line

  • Returns structured results with metadata

  • Simple setup using a PostgreSQL connection string

Related MCP server: pg-mcp

Getting Started

  1. Clone the repository

    git clone https://github.com/perrypixel/Simple-Postgres-MCP
    cd Simple-Postgres-MCP
  2. Install dependencies

    npm install
  3. Build the project

    npm run build

MCP Configuration

Add the following to your MCP client configuration (mcp.json):

Write Mode (default)

{
  "mcpServers": {
    "simple-postgresql-mcp": {
      "command": "node",
      "args": [
        "/path/to/build/index.js",
        "postgresql://username:password@localhost:5432/database_name",
        "write"
      ]
    }
  }
}

Read-Only Mode

{
  "mcpServers": {
    "simple-postgresql-mcp": {
      "command": "node",
      "args": [
        "/path/to/build/index.js",
        "postgresql://username:password@localhost:5432/database_name",
        "readonly"
      ]
    }
  }
}

Note: Update the path in the configuration to point to the index.js file inside your build folder.

Usage

  1. Copy the appropriate MCP configuration (read-only or write mode) to your tool’s mcp.json (e.g., Cursor, Windsurf, Copilot, etc.).

  2. Start your MCP client. The server is now ready to use!

Support

If you find this tool helpful, you can support the development by:

Install Server
A
license - permissive license
B
quality
F
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A production-ready MCP server that enables safe, read-only SQL SELECT queries against PostgreSQL databases with built-in security validation. It features connection pooling, automatic row limits, and structured logging to ensure secure and reliable database interactions.
    Last updated
    37
    ISC
  • A
    license
    B
    quality
    D
    maintenance
    A lightweight Postgres MCP server for safe database exploration and query analysis, read-only by default, with multi-database support.
    Last updated
    4
    3
    MIT
  • A
    license
    -
    quality
    C
    maintenance
    An open-source MCP server for PostgreSQL schema introspection and guarded read-only queries. It enables MCP clients to discover schemas, tables, columns, indexes, relationships, and safe queryable data from a configured PostgreSQL database.
    Last updated
    30
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    A lightweight MCP server for relational databases, enabling dynamic connections to PostgreSQL and MySQL, SQL execution, and transaction control.
    Last updated
    7
    66
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for managing Prisma Postgres.

  • MCP server for interacting with the Supabase platform

  • A basic MCP server to operate on the Postman API.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/perrypixel/Simple-Postgres-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server