Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported URL Type "postgresql:" #211

Open
jzillmann opened this issue Dec 3, 2024 · 2 comments
Open

Unsupported URL Type "postgresql:" #211

jzillmann opened this issue Dec 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jzillmann
Copy link

Describe the bug
Getting

/opt/homebrew/lib/node_modules/npx/node_modules/npm-package-arg/npa.js:258
      throw unsupportedURLType(urlparse.protocol, res.rawSpec)
      ^

Error: Unsupported URL Type "postgresql:": postgresql://plex_user:plex@localhost/plex_db_dev
    at unsupportedURLType (/opt/homebrew/lib/node_modules/npx/node_modules/npm-package-arg/npa.js:200:15)
    at fromURL (/opt/homebrew/lib/node_modules/npx/node_modules/npm-package-arg/npa.js:258:13)
    at resolve (/opt/homebrew/lib/node_modules/npx/node_modules/npm-package-arg/npa.js:77:12)
    at npa (/opt/homebrew/lib/node_modules/npx/node_modules/npm-package-arg/npa.js:52:10)
    at Function.parseArgs (/opt/homebrew/lib/node_modules/npx/node_modules/libnpx/parse-args.js:48:23)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/npx/index.js:8:20)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12) {
  code: 'EUNSUPPORTEDPROTOCOL'
}

Node.js v20.18.1

in mcp-server-postgres.log when starting claude desktop.

To Reproduce
Steps to reproduce the behavior:

  1. Configure postgres
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://plex_user:plex@localhost/plex_db_dev"
      ]
    }
  }
}
  1. (Re)start Claude
  2. Look at ~/Library/Logs/Claude/mcp-server-postgres.log

Expected behavior
No error and the postgres should be usable

Logs
see above

Additional context

  • OS
OS X 14.5
Apple M1
  • When going through the inspector everything works fine: npx @modelcontextprotocol/inspector npx -d -y @modelcontextprotocol/server-postgres postgresql://plex_user:plex@localhost/plex_db_dev
@jzillmann jzillmann added the bug Something isn't working label Dec 3, 2024
@jspahrsummers
Copy link
Member

It looks like npx is interpreting the postgresql:// argument. Can you try the following config instead:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "--",
        "postgresql://plex_user:plex@localhost/plex_db_dev"
      ]
    }
  }
}

@jzillmann
Copy link
Author

Having now

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "--",
        "postgresql://plex_user:plex@localhost/plex_db_dev"
      ]
    }
  }
}

but It doesn't make a difference, still getting Error: Unsupported URL Type "postgresql:"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants