Skip to content

Commit ba174a0

Browse files
committed
docs(install): per-OS command blocks for Windows / Linux / macOS
The only per-OS difference in the install flow is how environment variables are set (export vs $env: vs set) and the shell's line-continuation character. Add ready-to-copy Linux/macOS, PowerShell, and Command Prompt blocks for the two quick-starts and the docker run, fronted by a one-time translation table so the later export examples don't need triplicating. README's docker block gets a one-line pointer to the per-OS install-guide blocks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122yLZLJ8t4W43sdN6BmTZc
1 parent b28378d commit ba174a0

3 files changed

Lines changed: 91 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ adheres to [Semantic Versioning](https://semver.org/).
2121

2222
### Changed
2323

24+
- **Install docs: per-OS commands + `docker run --name mcpg`.** The
25+
installation guide's quick-start and Docker sections now carry ready-to-copy
26+
**Linux/macOS, Windows PowerShell, and Windows Command Prompt** blocks (the
27+
only per-OS difference is how environment variables are set and the shell's
28+
line-continuation character), fronted by a one-time translation table. The
29+
`docker run` examples gain `--name mcpg` so the container is addressable by
30+
name.
31+
2432
- **De-vendored the SQL-safety kernel (roadmap 18.1).** The formerly-vendored
2533
`crystaldba/postgres-mcp` `sql/` subpackage (`src/mcpg/_vendor/`) is
2634
replaced by a first-party `src/mcpg/sql/` package — `allowlist.py` (the

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ docker run --rm --name mcpg -p 8000:8000 \
102102
ghcr.io/devopam/mcpg:latest
103103
```
104104

105+
On **Windows PowerShell** replace the trailing `\` with a backtick `` ` ``
106+
(or put the command on one line); the [installation
107+
guide](docs/installation.md#option-2--docker) has ready-to-copy
108+
Linux/macOS, PowerShell, and Command Prompt blocks.
109+
105110
Or build it yourself from source:
106111

107112
```bash

docs/installation.md

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,39 @@ mcpg --version
5252

5353
### Option 2 — Docker
5454

55+
Build the image (identical on every OS):
56+
5557
```bash
5658
docker build -t mcpg https://github.com/devopam/MCPg.git
59+
```
60+
61+
Then run it. The only per-OS difference is the line-continuation
62+
character — pick the block for your shell:
63+
64+
**Linux / macOS (bash/zsh)**
65+
66+
```bash
5767
docker run --rm --name mcpg -p 8000:8000 \
5868
-e MCPG_DATABASE_URL=postgresql://user:pass@host:5432/db \
5969
-e MCPG_ACCESS_MODE=read-only \
6070
mcpg
6171
```
6272

73+
**Windows (PowerShell)**
74+
75+
```powershell
76+
docker run --rm --name mcpg -p 8000:8000 `
77+
-e MCPG_DATABASE_URL=postgresql://user:pass@host:5432/db `
78+
-e MCPG_ACCESS_MODE=read-only `
79+
mcpg
80+
```
81+
82+
**Windows (Command Prompt)**
83+
84+
```bat
85+
docker run --rm --name mcpg -p 8000:8000 -e MCPG_DATABASE_URL=postgresql://user:pass@host:5432/db -e MCPG_ACCESS_MODE=read-only mcpg
86+
```
87+
6388
The image is a hardened multi-stage build: the runtime stage drops
6489
the build toolchain and runs as `uid=10001 / gid=10001` with a
6590
`nologin` shell. Application files are root-owned and read-only to
@@ -81,20 +106,52 @@ or contribute.
81106

82107
## Quick start
83108

84-
The minimum to get running locally:
109+
MCPg is configured entirely through environment variables, and the
110+
**only per-OS difference in this whole guide is how you set them**. The
111+
`mcpg` command itself, `pip`, `uv`, and `docker` are identical on every
112+
platform. Set variables like this:
113+
114+
| Shell | Set a variable |
115+
|---|---|
116+
| **Linux / macOS** (bash/zsh) | `export MCPG_DATABASE_URL=postgresql://…` |
117+
| **Windows — PowerShell** | `$env:MCPG_DATABASE_URL = "postgresql://…"` |
118+
| **Windows — Command Prompt** | `set MCPG_DATABASE_URL=postgresql://…` |
119+
120+
Every `export …` example below uses the Linux/macOS form; translate it
121+
to your shell with the table above.
122+
123+
The minimum to get running locally (stdio transport, read-only mode):
124+
125+
**Linux / macOS (bash/zsh)**
85126

86127
```bash
87128
export MCPG_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/mydb
88129
mcpg
89130
```
90131

132+
**Windows (PowerShell)**
133+
134+
```powershell
135+
$env:MCPG_DATABASE_URL = "postgresql://postgres:postgres@localhost:5432/mydb"
136+
mcpg
137+
```
138+
139+
**Windows (Command Prompt)**
140+
141+
```bat
142+
set MCPG_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/mydb
143+
mcpg
144+
```
145+
91146
That starts MCPg on the **stdio** transport in **read-only** mode,
92147
ready to be consumed by an MCP client (Claude Desktop, Cursor,
93148
Continue, etc.). See the next section for how to wire it into a
94149
specific client.
95150

96151
For HTTP-based clients:
97152

153+
**Linux / macOS (bash/zsh)**
154+
98155
```bash
99156
export MCPG_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/mydb
100157
export MCPG_TRANSPORT=streamable-http
@@ -103,6 +160,26 @@ export MCPG_HTTP_AUTH_TOKEN=... # optional but strongly recommended
103160
mcpg
104161
```
105162

163+
**Windows (PowerShell)**
164+
165+
```powershell
166+
$env:MCPG_DATABASE_URL = "postgresql://postgres:postgres@localhost:5432/mydb"
167+
$env:MCPG_TRANSPORT = "streamable-http"
168+
$env:MCPG_HTTP_PORT = "8000"
169+
$env:MCPG_HTTP_AUTH_TOKEN = "..." # optional but strongly recommended
170+
mcpg
171+
```
172+
173+
**Windows (Command Prompt)**
174+
175+
```bat
176+
set MCPG_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/mydb
177+
set MCPG_TRANSPORT=streamable-http
178+
set MCPG_HTTP_PORT=8000
179+
set MCPG_HTTP_AUTH_TOKEN=...
180+
mcpg
181+
```
182+
106183
---
107184

108185
## Wire it into an MCP client

0 commit comments

Comments
 (0)