Skip to main content
Glama

PostgreSQL MCP Server

by sreedhag
database.ts558 B
import pg from "pg"; import { config } from "./env.js"; const c = config.postgres; export const databaseUrl = c.connectionString ?? `postgresql://${encodeURIComponent(c.username)}:${encodeURIComponent(c.password)}@${c.host}:${c.port}/${c.database}?sslmode=require`; export const resourceBaseUrl = new URL(databaseUrl); resourceBaseUrl.protocol = "postgres:"; resourceBaseUrl.password = ""; // Clear password for constructing resource URIs export const pool = new pg.Pool({ connectionString: databaseUrl, }); export const SCHEMA_PATH = "schema";

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

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