mcpg
Verified Safeby compilotbv
Overview
A Model Context Protocol (MCP) server that provides a secure, API-driven interface for interacting with PostgreSQL databases, enabling AI agents and IDEs to manage and query data.
Installation
docker run -i --rm -e MCP_API_KEY=your_api_key -e POSTGRES_HOST=your_postgres_host -e POSTGRES_PORT=5432 -e POSTGRES_DB=your_database_name -e POSTGRES_USER=your_database_user -e POSTGRES_PASSWORD=your_database_password postgresql-mcp-serverEnvironment Variables
- MCP_API_KEY
- POSTGRES_HOST
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
Security Notes
The server uses parameterized queries (`psycopg2`) to prevent SQL injection. All sensitive credentials are sourced from environment variables, preventing hardcoding. API key authentication is enforced. Subprocess calls for `pg_dump` and `pg_restore` are constructed with explicit arguments, minimizing command injection risks. The option for read-only mode further enhances security for exploratory use cases. Ensure necessary `pg_dump` and `pg_restore` binaries are present in the Docker image for backup/restore functionality.
Similar Servers
rmcp
Perform sophisticated statistical analysis, econometrics, machine learning, and time series tasks using natural language conversations with AI assistants, demonstrating capabilities through a web interface.
ls-mcp
Command-line tool for discovering, analyzing, and reporting on Model Context Protocol (MCP) server configurations in a local development environment.
company-docs-mcp
Transforms organizational documentation into an AI-powered knowledge base for semantic search, Q&A via chat interface, Claude Desktop, and Slack integration.
karma
A modern, dark-themed chat interface demonstrating the Karma Memory system for AI agents, enabling context-aware conversations and dynamic switching of memory retrieval and caching strategies.