PostgreSQL MCP server for AI agents. Real-time database access over SSE and STDIO via Docker.
234
NihFix.Postgres.Mcp is a lightweight and efficient Model Context Protocol (MCP) server for PostgreSQL, built to allow AI agents to interact with databases easily and in real-time.
It supports two transport types: STDIO for direct process communication and SSE (Server-Sent Events) for streaming data over HTTP.
docker run -i --rm -e McpServerOptions__ServerType=Sse -e McpServerOptions__ConnectionString="Host=host.docker.internal;Port=5432;Database=MyDbName;User ID=dbUser;Password=dbUserPassword;" -p 3002:8080 nihfix/postgres.mcp
Then define server url in your client:
http://localhost:3002/sse
Example MCP client configuration for STDIO:
{
"mcpServers": {
"postgres": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"McpServerOptions__ConnectionString",
"nihfix/postgres.mcp",
"--access-mode=unrestricted"
],
"env": {
"McpServerOptions__ConnectionString": "Host=host.docker.internal;Port=5432;Database=MyDbName;User ID=dbUser;Password=dbUserPassword;"
}
}
}
}
| Variable | Description | Required | Example |
|---|---|---|---|
McpServerOptions__ServerType | Server mode (Sse or Stdio) | Yes (for SSE) | Sse |
McpServerOptions__ConnectionString | PostgreSQL connection string | Yes | Host=host.docker.internal;Port=5432;Database=MyDb;User ID=user;Password=pass; |
MIT License.
Content type
Image
Digest
sha256:8e10ca526…
Size
90 MB
Last updated
11 months ago
docker pull nihfix/postgres.mcp