postgresql
MCP server from nahmanmate/postgresql-mcp-server
claude mcp add --transport stdio nahmanmate-postgresql-mcp-server node /path/to/postgresql-mcp-server/build/index.js
How to use
This PostgreSQL MCP Server exposes three core capabilities: analyze_database, get_setup_instructions, and debug_database. You can feed it a PostgreSQL connection string to analyze performance, configuration, and security, receiving targeted recommendations for optimization. Use get_setup_instructions to obtain platform-specific installation and configuration steps for PostgreSQL, including security considerations and post-install tasks. If you encounter issues with connections, performance, locks, or replication, the debug_database tool helps diagnose common PostgreSQL problems with adjustable log verbosity. Typical workflows involve running analyze_database to assess a live database, following get_setup_instructions to provision or tune PostgreSQL, and using debug_database to troubleshoot any arising issues.
How to install
Prerequisites:
- Node.js >= 18.0.0
- PostgreSQL server accessible for target database operations
- Network access to target PostgreSQL instances
Installation via Smithery (automatic):
- Install the MCP server using Smithery:
npx -y @smithery/cli install @nahmanmate/postgresql-mcp-server --client claude
Manual installation:
- Clone the repository
- Install dependencies:
npm install
- Build the server:
npm run build
- Add to MCP settings file (example):
{
"mcpServers": {
"postgresql-mcp": {
"command": "node",
"args": ["/path/to/postgresql-mcp-server/build/index.js"],
"disabled": false,
"alwaysAllow": []
}
}
}
Notes:
- Replace /path/to/... with the actual path to the built index.js file.
- Ensure your MCP runner has access to the Node.js process and the target PostgreSQL instances.
Additional notes
Tips and considerations:
- Ensure secure connection strings when providing credentials (use SSL/TLS where possible).
- When using analyze_database, specify a clear analysisType (configuration, performance, or security) to tailor the report.
- For get_setup_instructions, select platform (linux/macos/windows) and optional version/useCase to customize the guidance.
- In debug_database, you can adjust logLevel (info, debug, trace) to capture sufficient details for troubleshooting.
- Review the security considerations in the README, including authentication methods and role-based access control.
- If integrating with MCP settings, keep your index.js path up to date after builds and re-run MCP registration if needed.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud