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:
- 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"
]
}
}
}
- 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.
Describe the bug
It's not possible to run multiple instances of
@modelcontextprotocol/server-postgressimultaneously 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:
{ "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" ] } } }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.