Ai Agents PostgresSAFE
This repo is an extension of PostgreSQL MCP Server providing functionalities to create tables, insert entries, update entries, delete entries, and drop tables.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
A Model Context Protocol server that provides access to PostgreSQL databases. This server enables LLMs to interact with databases to inspect schemas, execute queries, and perform CRUD (Create, Read, Update, Delete) operations on database entries. This repo is an extension of PostgreSQL MCP Server providing functionalities to create tables, insert entries, update entries, delete entries, and drop tables.
Installation
To install the PostgreSQL MCP Server, follow these steps:
- Install Docker and Claude Desktop
- Clone the repository:
git clone https://github.com/vignesh-codes/ai-agents-mcp-pg.git - Run PG Docker container
docker run --name postgres-container -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=admin_password -e POSTGRES_DB=mydatabase -p 5432:5432 -d postgres:latest - Build the mcp server:
docker build -t mcp/postgres -f src/Dockerfile . - Open Claude Desktop and connect to the MCP server by updating the
mcpServersfield inclaude_desktop_config.json:
Usage with Claude Desktop
To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:
Docker
- When running Docker on macOS, use
host.docker.internalif the server is running on the host network (e.g., localhost). - Username/password can be added to the PostgreSQL URL with
postgresql://user:password@host:port/db-name.
{
"mcpServers": {
"postgres": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp/postgres",
"postgresql://username:[email protected]:5432/mydatabase"
]
}
}
}Make sure to restart the claude desktop app after updating the config file.
Features Added
Existing Functionality
- query
- Execute read-only SQL queries against the connected database.
- Input:
sql(str
56eb21e18732OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add server-postgres -- npx -y @modelcontextprotocol/[email protected]
{
"mcpServers": {
"server-postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/[email protected]"
]
}
}
}Exposed tools (6)
0 read · 4 write · 2 destructive. Blast radius: 2 tools can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
create_table | write | Create a new table in the PostgreSQL database with specified columns and data types. Use this tool to define new database tables with custom schemas. Example: Create a users table with id, name, email, and created_at columns. |
delete_entry | destructive | Delete rows/records from a PostgreSQL table that match specified conditions. Use this tool to remove data from your database tables. Example: Delete all inactive users or users who haven |
delete_table | destructive | Permanently delete/drop an entire table from the PostgreSQL database, including all its data. Use with caution as this operation cannot be undone. Example: Delete a temporary_logs table that is no longer needed. |
insert_entry | write | Insert a new row/record into an existing table in the PostgreSQL database. Use this tool to add data to your tables. Example: Add a new user with name |
query | write | Run a read-only SQL query against the PostgreSQL database and return the results as JSON. Use this tool to retrieve data without modifying the database. Only SELECT statements and other non-modifying operations are allowed. Example: Query all users with age greater than 18. |
update_entry | write | Update existing rows in a PostgreSQL table that match specified conditions. Use this tool to modify data that already exists in the database. Example: Update the status to |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (1 observation(s))
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (2)
delete_entry, delete_table
pg, @types/pg, shx, typescript
Gates applied: no_behavioural_pass.
56eb21e18732full audit observations/trust-audit/mcp-server/vignesh-codes__ai-agents-postgres.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 56eb21e18732 | SAFE | B | 89 | first audit |
Questions
What is the Ai Agents Postgres MCP server?
This repo is an extension of PostgreSQL MCP Server providing functionalities to create tables, insert entries, update entries, delete entries, and drop tables.
What tools does Ai Agents Postgres expose?
6 in total: 0 read-only, 4 that write, and 2 that can delete or overwrite (delete_entry, delete_table). Every one is listed on this page with its risk.
Is Ai Agents Postgres safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B. Separately from the audit: 2 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Ai Agents Postgres need?
No credential environment variables were found in its source, so it appears to need none.
How does Ai Agents Postgres run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as @modelcontextprotocol/server-postgres at 0.6.2.
How current is this page?
The grade is for one exact copy of the source (56eb21e18732), read on 2026-10-08. The repository is watched and re-audited when it changes.