Enhanced PostgreSQL MCP Server provides both read and write access to PostgreSQL databases, extending the original read-only implementation by Anthropic. Developed by Gareth Cottrell, it enables LLMs to not only query database schemas and execute read operations but also modify data through insert, update, and delete operations, as well as manage database schema objects like tables, functions, triggers, and indexes. The server implements proper transaction handling with COMMIT/ROLLBACK mechanisms and uses parameterized queries for data modification operations to prevent SQL injection, making it suitable for AI assistants that need to interact with PostgreSQL databases for both data analysis and database management tasks.
아직 리뷰가 없습니다. 첫 번째 리뷰를 작성해 보세요!
대화에 참여하려면 로그인하세요
Execute read-only SQL queries against the connected database. Input: sql (string): The SQL query to execute.
Execute a SQL statement that modifies data (INSERT, UPDATE, DELETE). Input: sql (string): The SQL statement to execute.
Insert a new record into a table. Input: table (string): The table name, data (object): Key-value pairs where keys are column names and values are the data to insert.
Update records in a table. Input: table (string): The table name, data (object): Key-value pairs for the fields to update, where (string): The WHERE condition to identify records to update.
Delete records from a table. Input: table (string): The table name, where (string): The WHERE condition to identify records to delete.
Create a new table with specified columns and constraints. Input: tableName (string): The table name, columns (array): Array of column definitions with name, type, and optional constraints, constraints (array): Optional array of table-level constraints.
Create a PostgreSQL function/procedure. Input: name (string): Function name, parameters (string): Function parameters, returnType (string): Return type, language (string): Language (plpgsql, sql, etc.), body (string): Function body, options (string): Optional additional function options.
Create a trigger on a table. Input: name (string): Trigger name, tableName (string): Table to apply trigger to, functionName (string): Function to call, when (string): BEFORE, AFTER, or INSTEAD OF, events (array): Array of events (INSERT, UPDATE, DELETE), forEach (string): ROW or STATEMENT, condition (string): Optional WHEN condition.
Create an index on a table. Input: tableName (string): Table name, indexName (string): Index name, columns (array): Columns to index, unique (boolean): Whether the index is unique, type (string): Optional index type (BTREE, HASH, GIN, GIST, etc.), where (string): Optional condition.
Alter a table structure. Input: tableName (string): Table name, operation (string): Operation (ADD COLUMN, DROP COLUMN, etc.), details (string): Operation details.