PostgreSQL MCP Server

by vignesh-codes

27 642 downloads Not rated yet MIT
GitHub

About

This repo is an extension of PostgreSQL MCP Server providing functionalities to create tables, insert entries, update entries, delete entries, and drop tables.

Details

License
MIT

Explore

- Execute read-only SQL queries via the query tool.
- Create tables dynamically with specified columns and data types.
- Insert new entries into any table.
- Update existing entries based on conditions.
- Delete entries from tables using conditions.
- Drop entire tables from the database.
- Provides JSON schema information for each table as a resource.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name PostgreSQL MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

To install the PostgreSQL MCP Server, follow these steps:

1. Install Docker and Claude Desktop
2. Clone the repository: git clone https://github.com/vignesh-codes/ai-agents-mcp-pg.git
3. Run PG Docker container docker run --name postgres-container -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=admin_password -e POSTGRES_DB=mydatabase -p 5432:5432 -d postgres:latest
4. Build the mcp server: docker build -t mcp/postgres -f src/Dockerfile .
5. Open Claude Desktop and connect to the MCP server by updating the mcpServers field in claude_desktop_config.json:

To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "postgresql mcp server": {
            "postgres": {
                "command": "docker",
                "args": [
                    "run",
                    "-i",
                    "--rm",
                    "mcp/postgres",
                    "postgresql://username:[email protected]:5432/mydatabase"
                ]
            }
        }
    }
}

McpServers

{
    "postgres": {
        "command": "docker",
        "args": [
            "run",
            "-i",
            "--rm",
            "mcp/postgres",
            "postgresql://username:[email protected]:5432/mydatabase"
        ]
    }
}
A Model Context Protocol server that provides access to PostgreSQL databases. This server enables LLMs to interact with databases to inspect schemas, execute queries, and perform CRUD (Create, Read, Update, Delete) operations on database entries. This repo is an extension of PostgreSQL MCP Server providing functionalities to create tables, insert entries, update entries, delete entries, and drop tables.
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.

Videos about PostgreSQL MCP Server

Relevant YouTube tutorials, setups, and demos