29 lines
No EOL
897 B
Markdown
29 lines
No EOL
897 B
Markdown
# postgresql-mcp
|
|
|
|
MCP server for PostgreSQL database operations.
|
|
|
|
Source: [`@modelcontextprotocol/server-postgres`](https://npm.im/@modelcontextprotocol/server-postgres)
|
|
|
|
## Environment Variables
|
|
|
|
| Variable | Required | Description |
|
|
|----------|----------|-------------|
|
|
| `DATABASE_URL` | Yes | Full PostgreSQL connection URL (e.g. `postgresql://user:pass@host:5432/db?sslmode=disable`) |
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
docker run -d \
|
|
--name postgresql-mcp \
|
|
-p 8109:8109 \
|
|
-e DATABASE_URL=postgresql://user:pass@host:5432/mydb \
|
|
forgejo.corentic.eu/corentic/mcp-fleet-postgresql:latest
|
|
```
|
|
|
|
## Tools
|
|
|
|
- `query` — Execute read-only SQL queries (SELECT, EXPLAIN, etc.)
|
|
- `execute` — Execute write SQL (INSERT, UPDATE, DELETE, DDL)
|
|
- `list_tables` — List tables in the database
|
|
- `describe_table` — Get schema info for a specific table
|
|
- `get_table_stats` — Row counts and table statistics |