postgresql-server-mcp

postgresql-server-mcp

0

The project is an MCP server that facilitates the connection and management of local PostgreSQL instances, making it useful for development and prototyping. It provides a range of tools for database and table management, as well as query execution.

postgreSQL-mcp-server MCP Server

An mcp server that connects to local postgreSQL instances - this is intended as a local development/prototyping aid

Development

Install dependencies:

npm install

Build the server:

npm run build

Run integration test:

npm test

Capabilities

This MCP server provides the following PostgreSQL tools:

ToolDescription
list_tablesList tables in a specified database
execute_queryExecute an arbitrary SQL query
create_databaseCreate a new database
drop_databaseDrop an existing database
create_tableCreate a new table with specified columns and constraints
drop_tableDrop a table from a database
create_indexCreate an index on specified table columns
drop_indexDrop an index from a table

Installation

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "postgresql-tools": {
      "command": "node",
      "args": ["/pathtoyourlocalfolder/build/index.js"],
      "env": {
        "POSTGRESQL_HOST": "localhost",
        "POSTGRESQL_PORT": "5432",
        "POSTGRESQL_USER": "adamjackson",
        "POSTGRESQL_PASSWORD": "",
        "POSTGRESQL_DATABASE": "seoanalysis"
      }
    }
  }
}