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
Serves as an AI assistant backend to perform comprehensive statistical analysis, econometric modeling, machine learning, time series analysis, and data science tasks using R through natural language conversations.
ls-mcp
A command-line tool for discovering, analyzing, and reporting on Model Context Protocol (MCP) server configurations in a local development environment, including their status, versioning, and potential credential exposures.
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
Provides a plug-and-play Knowledge Graph service via the Model Context Protocol (MCP), allowing AI agents to store, retrieve, and manage structured and unstructured knowledge (entities, relations, observations).