db-mcp-server: Cursor Failing to List and Execute Tools

Database MCP Server Tool Registration Issue

Description

The MCP Server is not functioning as expected. While it successfully connects to the PostgreSQL database, it fails to properly register database-specific tools, only registering the list_databases tool. Additionally, when the Cursor Agent attempts to call the tool, the operation hangs.

Environment

  • Docker container running freepeak/db-mcp-server
  • PostgreSQL database
  • Transport mode: stdio

Configuration Files

~/.cursor/mcp.json:

{
    "mcpServers": {
        "multidb_stdio": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "--network=app_network",
                "-v $HOME/postgres_mcp_server_config.json:/app/config.json",
                "-e TRANSPORT_MODE=stdio",
                "-e CONFIG_PATH=/app/config.json",
                "freepeak/db-mcp-server",
                "/app/server",
                "-t",
                "stdio",
                "-c",
                "/app/config.json"
            ]
        }
    }
}

postgres_mcp_server_config.json:

{
    "connections": [
        {
            "id": "mydb",
            "type": "postgres",
            "host": "database",
            "port": 5432,
            "name": "postgres",
            "user": "postgres",
            "password": "postgres"
        }
    ]
}

Logs

2025-04-02 05:21:36] INFO: Loaded database config from file: /app/config.json
[2025-04-02 05:21:36] INFO: Connection [0]: ID=banking_db, Type=postgres, Host=database, Port=5432, Name=postgres
[2025-04-02 05:21:36] INFO: Connected to postgres database at database:5432/postgres
[2025-04-02 05:21:36] INFO: Successfully connected to all 1 databases
[2025-04-02 05:21:36] INFO: Connected to 1 databases: [banking_db]
2025-04-02T05:21:36.762Z ERROR Error registering tools for database banking_db: failed to get database info for banking_db: failed to get schema information: pq: unrecognized configuration parameter "tables"

Expected Behavior

  1. The MCP Server should register all database-specific tools for the PostgreSQL database:
    • query_banking_db
    • execute_banking_db
    • transaction_banking_db
    • performance_banking_db
    • schema_banking_db
  2. The list_databases tool should execute successfully when called

Actual Behavior

  1. Only the list_databases tool is registered
  2. The tool registration fails with error: unrecognized configuration parameter "tables"
  3. When attempting to call the list_databases tool, the operation hangs

Questions

  1. Is there a specific PostgreSQL version requirement for the MCP Server?
  2. Are there any additional PostgreSQL configuration parameters needed?
  3. Is there a way to enable debug logging for more detailed error information?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Hi @linhdmn,

I had other issues while trying to set up and this issue helped me but now, I don’t see a difference from his configuration from what I have.

@PauloFavero

{
    "mcpServers": {
        "multidb_stdio": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "--network=app_network",
                "-v $HOME/postgres_mcp_server_config.json:/app/config.json",
                "-e TRANSPORT_MODE=stdio",
                "-e CONFIG_PATH=/app/config.json",
                "freepeak/db-mcp-server"
            ]
        }
    }
}

I think you should remove this block

"/app/server",
  "-t",
  "stdio",
  "-c",
  "/app/config.json"

And $HOME is real path like : D:/MY/demoDB

Final config should :

{
    "mcpServers": {
        "multidb_stdio": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "--network=app_network",
                "-v D:/MY/demoDB/postgres_mcp_server_config.json:/app/config.json",
                "-e TRANSPORT_MODE=stdio",
                "-e CONFIG_PATH=/app/config.json",
                "freepeak/db-mcp-server"
            ]
        }
    }
}

Thanks @linhdmn for the prompt resolution. I’ll try it later today and let you know.