Skip to main content
Glama
mattcat10

postgres-mcp

by mattcat10

Getting started

Setup

Create .env file with your postgres db vars

"DB_HOST": "localhost",
"DB_PORT": "5432",
"DB_NAME": "<table>",
"DB_USER": "<user>",
"DB_PASSWORD": "<password>"
  1. npm i

  2. npm run build

  3. Ensure your server script is executable:

chmod +x ./dist/server.js

  1. Ensure the shebang line at the top of your compiled server.js:

#!/usr/bin/env node

Setup cursor mcp server:

In cursor go to: Settings > MCP Servers

{
  "mcpServers": {
    "postgres": {
      "command": "node",
      "args": ["./dist/server.js"],
      "env": {
        "DB_HOST": "localhost",
        "DB_PORT": "5432",
        "DB_NAME": "<db_name>",
        "DB_USER": "<db_user>",
        "DB_PASSWORD": "<password>"
      }
    }
  }
}

To test run in terminal:

echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | node dist/server.js

Once you add it in cursor settings, restart cursor and then reopen and make sure it loads

To chat

Start a new chat and tell it to use your MCP server

Give me the first record in the table

Do not read my local code files - use the database MCP server instead.

F
license - not found
-
quality - not tested
D
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.

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/mattcat10/postgres-mcp'

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