Skip to content

Unable to run multiple instances of @modelcontextprotocol/server-postgres simultaneously #1219

@jeffmylife

Description

@jeffmylife

Describe the bug
It's not possible to run multiple instances of @modelcontextprotocol/server-postgres simultaneously to connect to different databases (e.g., production and development).

When doing this, the chat always chooses the first one specified in order of mcp.json.

I presume it's an mcp problem since cursor's agent can see both of the servers, it just cannot run the development no matter what i say!

To Reproduce
Steps to reproduce the behavior:

  1. Set up two database connections in your MCP configuration
{
  "mcpServers": {
    "Production Database": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://postgres:password@production-db.example.com:5432/postgres"
      ]
    },
    "Development Database": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://postgres:password@localhost:54322/postgres"
      ]
    }
  }
}
  1. Try to get the chat model to call the second (development one in this case) and it will just always show production data.

Expected behavior
It should be possible to run multiple instances of the server simultaneously, each connecting to a different database, without conflicts or interference.

Or, it should error if there are two.

Additional context
I was doing this in cursor with local and remote supabase databases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions