PostgreSQL MCP Server
@SwanHtetAungPhyo
PostgreSQL MCP Server について
概要はまだありません
基本情報
設定
ツール
ツールは検出されませんでした
ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。
概要
What is PostgreSQL MCP Server?
PostgreSQL MCP Server is a Go-based MCP (Model Context Protocol) server that lets AI assistants interact with PostgreSQL databases through a standardized interface. It provides three main capabilities: executing SELECT queries, managing database schema with DDL, and modifying data with INSERT/UPDATE/DELETE — all with built-in security validation to prevent dangerous operations.
How to use PostgreSQL MCP Server?
Install by building the Go binary from source (requires Go 1.19+). Update the database connection string in main.go or use environment variables for credentials. Run the binary as a stdio transport server. Connect any MCP client (e.g., Claude Desktop) by adding the server to its configuration file, specifying the path to the binary. Use the three tools — execute_query, ddl_query, modify_query — for respective operations.
Key features of PostgreSQL MCP Server
- Three validated SQL tools: query, DDL, and modify.
- Blocks dangerous commands like TRUNCATE and GRANT.
- Uses GORM for input sanitization and SQL injection protection.
- Supports SSL for database connection security.
- Compatible with all MCP clients using stdio transport.
Use cases of PostgreSQL MCP Server
- Let an AI assistant answer business intelligence queries from a PostgreSQL database.
- Enable AI to create and modify database tables for schema management.
- Allow AI to insert, update, or delete records with validation.
- Give AI read-only access to user analytics or inventory data.
FAQ from PostgreSQL MCP Server
How do I install the PostgreSQL MCP Server?
Create a Go project, add dependencies (mcp-golang, gorm, Postgres driver), copy the server code into main.go, update the connection string, then build and run the binary.
What types of database operations are supported?
Three operations: execute_query for SELECT queries, ddl_query for CREATE/ALTER/DROP statements, and modify_query for INSERT/UPDATE/DELETE commands.
How does PostgreSQL MCP Server ensure security?
Every query is validated before execution; only specific SQL types are allowed per tool. Commands like TRUNCATE and GRANT are blocked. All queries are sanitized through GORM's SQL injection protections.
How do I configure the database connection?
Set the connection string in the dbConn constant (e.g., host=localhost user=postgres password=yourpassword dbname=yourdb port=5432 sslmode=require) or read it from environment variables.
How do I connect PostgreSQL MCP Server to an MCP client like Claude Desktop?
Add an entry to the client’s configuration file (e.g., claude_desktop_config.json) with the command set to the path of the built binary. The server communicates over stdio.
「データベース」の他のコンテンツ
mcp-server-duckdb
ktanaka101A Model Context Protocol (MCP) server implementation for DuckDB, providing database interaction capabilities
mcp_mysql_server
wenb1n-devModel Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
Multi Database MCP Server
FreePeakA powerful multi-database server implementing the Model Context Protocol (MCP) to provide AI assistants with structured access to databases.
Meilisearch MCP Server
meilisearchA Model Context Protocol (MCP) server for interacting with Meilisearch through LLM interfaces.
MCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
コメント