Skip to content

Conversation

@valdezm
Copy link

@valdezm valdezm commented May 14, 2025

This adds WSL UVX instruction

@jssmith
Copy link
Contributor

jssmith commented May 15, 2025

Thank you for providing these instructions. I have edited them somewhat to conform to the style of the page.

@valdezm please confirm that the changes look good to you.

surajmandalcell referenced this pull request in surajmandalcell/pgsql-mcp Dec 14, 2025
This commit addresses the following issues:

- #118: Add percentile_cont, percentile_disc, mode to ALLOWED_FUNCTIONS
- #111: Fix PostgreSQL ≤12 compatibility for stddev_exec_time column
- #110: Fix Docker entrypoint (add exec) and create app user in Dockerfile
- #109 & #94: Fix double quote parsing and sequence name escaping
- #99: Add configurable query timeout via QUERY_TIMEOUT env var or --query-timeout
- #95: Redirect logging to stderr to avoid interfering with stdio MCP transport
- #93: Update broken README links to archived MCP servers repo
- #100 & #74: Add uvx and WSL instructions to README
- #71: Add table/column comments to metadata tools (list_objects, get_object_details)

Changes:
- safe_sql.py: Add ordered-set aggregate functions
- top_queries_calc.py: Use version-appropriate column name for stddev
- docker-entrypoint.sh: Use exec for proper signal handling
- Dockerfile: Create app user before COPY with --chown
- sequence_health_calc.py: Fix parsing of quoted identifiers
- server.py: Add configurable timeout, table/column comments in metadata
- __init__.py: Configure logging to stderr
- README.md: Add uvx/WSL instructions, fix broken links
@jssmith
Copy link
Contributor

jssmith commented Jan 20, 2026

Thanks for the contribution! WSL instructions are definitely needed since PR #100 (now merged) only covers native uvx usage.

A few suggestions to improve this:

1. Use bash -lc instead of bash -c

Using bash -c doesn't source the user's profile, so ~/.local/bin won't be in PATH. This is why you need to hardcode the full path. Using bash -lc (login shell) would load the user's environment properly.

2. Use PyPI instead of git

PR #100 established that the PyPI package (postgres-mcp) is available and up to date. For consistency with the rest of the README, this should use uvx postgres-mcp rather than --from git+https://...@main.

3. The $WSL_USER placeholder is confusing

/home/$WSL_USER/.local/bin/uvx looks like a shell variable that would be expanded, but it's actually a placeholder for manual replacement. With the bash -lc fix above, this hardcoded path isn't needed anyway.

4. Note about pip is incorrect

"If you do not have uvx installed, you may install it using pip"

uvx comes from uv, not pip. Should link to the uv installation instructions like the rest of the README.

Suggested config

{
  "mcpServers": {
    "postgres": {
      "command": "wsl.exe",
      "args": [
        "bash",
        "-lc",
        "DATABASE_URI='postgresql://username:password@localhost:5432/dbname' uvx postgres-mcp --access-mode=unrestricted"
      ]
    }
  }
}

This:

  • Uses login shell so PATH is set up correctly
  • Uses PyPI package for consistency
  • No hardcoded paths needed
  • Inline env var is a reasonable compromise for WSL (proper env passthrough via WSLENV is more complex)

Let me know if you'd like help updating the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants