Software bug in the database connection system

OS Linux Debian Bookworm
Cursor version 0.47.9
mcp.json:

{
  "mcpServers": {
    "pgLocal_postgres": {
      "command": "npx",
      "args": ["-y", "@smithery/cli@latest", "run", "@smithery-ai/postgres", "--config", "{\"databaseUrl\":\"postgresql://postgres:postgres@localhost:5432/postgres\"}"]
    },
    "pg79_sp_admin": {
      "command": "npx",
      "args": ["-y", "@smithery/cli@latest", "run", "@smithery-ai/postgres", "--config", "{\"databaseUrl\":\"postgresql://developer:[email protected]:5432/sp_admin\"}"]
    },
    "pg79_spo_online": {
      "command": "npx",
      "args": ["-y", "@smithery/cli@latest", "run", "@smithery-ai/postgres", "--config", "{\"databaseUrl\":\"postgresql://developer:[email protected]:5432/spo_online\"}"]
    },
    "pg79_vo_online": {
      "command": "npx",
      "args": ["-y", "@smithery/cli@latest", "run", "@smithery-ai/postgres", "--config", "{\"databaseUrl\":\"postgresql://developer:[email protected]:5432/vo_online\"}"]
    }
  }
}

All db connections are green.
Together with AI we came to the conclusion that this is a software error. This is what he wrote:

I discovered a software bug in the database connection system:

Bug Description:

  1. Issue: The system ignores the requested connector name and always uses the configuration of the first connection from the list of available connectors

  2. Expected behavior: The system should use the configuration of the connector that is explicitly requested by name

  3. Actual behavior: The system only uses the configuration of the first connector in the list

  4. Steps to reproduce:

  • When calling mcp_pg79_spo_online_query, the system connects to the database whose configuration is first in the list

  • When moving the desired connector to the beginning of the list, the system starts using its configuration

  • When moving the connector to another position, its configuration is ignored, system uses the first connection in the list any way

This is a serious issue that can lead to:

  • Connecting to the wrong database

  • Using incorrect data schemas

  • Potential data handling errors

I recommend registering this bug in the issue tracking system for further fixing.


We check the connection:
SELECT current_database();

The agent’s capabilities differ from the documentation. It cannot select a specific mcp tool. If I specify the required tool by name (pg79_spo_online), the agent selects mcp_pg79_spo_online_query (technical name?), but the chat simply displays just “query” and sql query is executed with the first tool in the list, not with the one I selected.

This is a bug description from Agent:

Bug Description: MCP Tool Name Inconsistency

  1. Issue: There is a discrepancy between MCP server names in configuration and tool names provided to the agent
  • In mcp.json, MCP servers are configured with clean names (e.g. pg79_spo_online)

  • But the agent receives tools with technical names (e.g. mcp_pg79_spo_online_query)

  1. Expected behavior:
  • The agent should be able to use MCP server names as defined in configuration

  • OR documentation should clearly state that tool names differ from MCP server configuration names

  • The naming convention should be consistent across configuration and tool usage

  1. Actual behavior:
  • Agent sees tools with added prefixes (mcp_) and suffixes (_query)

  • Cannot directly use MCP server names from configuration

  • No clear mapping between configuration names and tool names

  1. Impact:
  • Confusion in tool selection and usage

  • Potential errors when trying to use configuration names directly

  • Inconsistent developer experience

  1. Steps to reproduce:
  • Define MCP server in config: pg79_spo_online

  • Try to use this name directly: Error calling tool: Unknown tool: pg79_spo_online

  • System only recognizes: mcp_pg79_spo_online_query

Reference: Cursor MCP Documentation

This appears to be a disconnect between the MCP configuration layer and the tool abstraction layer provided to the agent.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.