PostgreSQL MCP Server
A Model Context Protocol (MCP) server for PostgreSQL that enables LLMs (including GLM 4.7 via z.ai) to interact deeply with PostgreSQL databases — query data, manage schema, analyze performance, and administer the database.
Power your agent
การติดตั้งจากผู้เผยแพร่ ไม่ใช่เอนด์พอยต์ของ PlugMCP
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิดจากผู้เผยแพร่
A Model Context Protocol (MCP) server for PostgreSQL that enables LLMs (including GLM 4.7 via z.ai) to interact deeply with PostgreSQL databases — query data, manage schema, analyze performance, and administer the database.
Production-grade PostgreSQL MCP Server. Empowers LLMs with 40+ tools for deep database interaction, including schema inspection, secure query execution, performance analysis, and administrative tasks. Built for reliable AI-driven development.
npm install
npm run build
Copy .env.example to .env and fill in your PostgreSQL credentials:
cp .env.example .env
npm run start
npm run dev # watch TypeScript changes
npm run typecheck # type-check only
npm run clean # remove dist/
npm test # run all tests (vitest)
npm run test:watch # watch mode
npm run test:coverage # with v8 coverage report
189 tests across 14 test files covering tools, guards, resources, prompts, validation, utils, and DB layer.
npm run check # typecheck + build
npm run healthcheck # verify DB connectivity
npm run start now runs prestart automatically to ensure fresh build output before launch.
npm run check # must pass before publish
npm pack # verify package contents locally
# npm publish # publish when ready
prepublishOnly is configured to run npm run check automatically.
Add to your MCP settings:
{
"mcpServers": {
"postgres": {
"command": "node",
"args": ["/path/to/postgres-mcp/dist/index.js"],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_DATABASE": "mydb",
"POSTGRES_USER": "postgres",
"POSTGRES_PASSWORD": "secret",
"PERMISSION_LEVEL": "read_write"
}
}
}
}
Or use a connection string:
{
"mcpServers": {
"postgres": {
"command": "node",
"args": ["/path/to/postgres-mcp/dist/index.js"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://user:pass@localhost:5432/mydb"
}
}
}
}
Use OpenAI-compatible API to connect GLM 4.7 with this MCP server's tools converted to function calling format:
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'YOUR_Z_AI_API_KEY',
baseURL: 'https://open.z.ai/api/paas/v4'
});
const response = await client.chat.completions.create({
model: 'glm-4-plus',
messages: [
{ role: 'system', content: 'You are a database assistant.' },
{ role: 'user', content: 'Show me all tables' }
],
});
Set via PERMISSION_LEVEL env var. ENABLE_DANGEROUS_OPERATIONS=true is also required for dangerous ops.
MIT
Production-grade PostgreSQL MCP Server. Empowers LLMs with 40+ tools for deep database interaction, including schema inspection, secure query execution, performance analysis, and administrative tasks.
ภาพรวม
Production-grade PostgreSQL MCP Server. Empowers LLMs with 40+ tools for deep database interaction, including schema inspection, secure query execution, performance analysis, and administrative tasks. Built for reliable AI-driven development.
เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Postgres ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-10-28 Production-grade PostgreSQL MCP Server. Empowers LLMs with 40+ tools for deep database interaction, including schema inspection, secure query execution, performance analysis, and administrative tasks. Built for reliable AI-driven development.