Skip to content

Commit 8b861e5

Browse files
tadasantclaude
andauthored
docs: add production database connection guide for admins (#808)
Drafted by Claude Code, reviewed and tested by me. Add instructions for maintainers to connect to the production PostgreSQL database, including Cloud Shell (recommended) and local machine methods, plus read-only session configuration for safety. --------- Co-authored-by: Claude <[email protected]>
1 parent ca6912c commit 8b861e5

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

docs/administration/admin-operations.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This is a brief guide for admins and moderators managing content on the registry
88
- If you are a maintainer and would like an account, ask in the Discord
99
- `gcloud` CLI installed and configured
1010
- `curl` and `jq` installed
11+
- `kubectl` installed with `gke-gcloud-auth-plugin` (for database access)
1112

1213
## Authentication
1314

@@ -138,9 +139,46 @@ curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NA
138139
done
139140
```
140141

142+
## Connecting to the Production Database
143+
144+
For debugging or data analysis, you can connect directly to the production PostgreSQL database. Use caution and prefer read-only access.
145+
146+
### Prerequisites
147+
148+
Install the GKE auth plugin if you haven't already:
149+
150+
```bash
151+
gcloud components install gke-gcloud-auth-plugin
152+
```
153+
154+
### Connect
155+
156+
```bash
157+
# Get cluster credentials
158+
gcloud container clusters get-credentials mcp-registry-prod --zone us-central1-b --project mcp-registry-prod
159+
160+
# Get the database password
161+
kubectl get secret registry-pg-app -o jsonpath='{.data.password}' | base64 -d
162+
163+
# Port-forward and connect (enter the password from above)
164+
kubectl port-forward svc/registry-pg-rw 15432:5432 &
165+
sleep 2
166+
psql -h localhost -p 15432 -U app -d app
167+
```
168+
169+
### Read-Only Access
170+
171+
To prevent accidental writes, set your session to read-only after connecting:
172+
173+
```sql
174+
SET default_transaction_read_only = on;
175+
```
176+
177+
Any write attempts will fail with an error until you disconnect.
178+
141179
## Notes
142180

143181
- **Version-specific changes**: Only affect that particular version
144-
- **Server-wide changes**: Must be applied to each version individually
182+
- **Server-wide changes**: Must be applied to each version individually
145183
- **Content scrubbing**: Use the version-specific edit workflow to scrub sensitive content
146184
- **Server name**: Cannot be changed in any version (it's the immutable identifier)

0 commit comments

Comments
 (0)