mcpServer
Verified Safeby gharshit
Overview
Provides a standardized interface for AI assistants to securely interact with PostgreSQL databases through a Model Context Protocol (MCP) server.
Installation
uv run python main.pyEnvironment Variables
- MCP_TRANSPORT
- MCP_HOST
- MCP_PORT
Security Notes
The server implements explicit checks to prevent destructive SQL operations (e.g., DELETE, DROP, TRUNCATE, UPDATE, INSERT) by blacklisting keywords in the `run_sql_query` tool. However, database credentials are directly specified in `config.yaml`, which is a significant security risk if this file is committed to version control. Additionally, while operations are read-only, direct string concatenation for SQL queries (e.g., in `run_sql_query`) without parameterized statements could still be vulnerable to SQL injection for information disclosure if an AI assistant is prompted to craft malicious `SELECT` queries.
Similar Servers
mcp-server-neon
Enables natural language interaction with Neon Postgres databases, facilitating database management, migrations, and query optimization via an LLM agent.
MCP-PostgreSQL-Ops
This MCP server provides comprehensive PostgreSQL database operations, monitoring, and management through natural language queries.
tiger-docs-mcp-server
An MCP server and Claude plugin providing AI assistants with advanced PostgreSQL knowledge through semantic documentation search and curated best practice skills.
metabase-ai-assistant
An AI-powered assistant for Metabase and PostgreSQL databases, facilitating natural language SQL generation, dashboard creation, and direct DDL operations via Model Context Protocol for Claude Desktop/Code.