MCP ExplorerExplorer

Mcp Vs Promptql

@hasuraon 9 months ago
3 MIT
FreeCommunity
AI Systems
MCP server customization for multiple Postgres DBs and tools.

Overview

What is Mcp Vs Promptql

mcp-vs-promptql is a modified MCP server that supports multiple PostgreSQL databases and SQL tools, allowing for enhanced data management and querying capabilities.

Use cases

Use cases include managing control plane data, handling support ticket information, and integrating SQL tools for data analysis and reporting.

How to use

To use mcp-vs-promptql, set up two PostgreSQL databases named ‘control_plane’ and ‘support_tickets’ on localhost:5432, load the provided SQL dumps, customize the server by replacing the ‘index.ts’ file, and configure the server settings before running it.

Key features

Key features include support for multiple databases, enhanced tool descriptions to prevent errors, and the addition of a Python tool for extended functionality.

Where to use

mcp-vs-promptql can be used in data management, application development, and environments requiring complex SQL queries across multiple databases.

Content

mcp-vs-promptql

Prepare data

  • Go to data directory.
  • Create two postgres DBs at localhost:5432 - control_plane and support_tickets.
  • Complete database dumps are given at control_plane_dump.sql and support_tickets_dump.sql. Load them into the DBs respectively

Customize Postgres MCP Server

Customizations done:

  • Support multiple databases and hence multiple SQL tools. By default it’s not possible since postgres MCP always names the tool “query”.
  • In the tool description add the DB schema so that Claude doesn’t hallucinate / retry all the time.
  • Add python tool (needs python3 in PATH)

Running:

  • The index.ts file contains the modified server. It won’t compile as-is, you have to:
  • Clone the original repo: https://github.com/modelcontextprotocol/servers
  • Replace the src/postgres/index.ts file in there with the index.ts file here.
  • Set the DB URLs correctly in controlPlaneUrl and supportTicketsUrl variables in the file.
  • Then in that directory run:
    • npx tsc
    • Optional: Run node dist/index.js to verify the server starts up fine.

Claude Desktop config

Use MCP instructions here: https://modelcontextprotocol.io/quickstart and modify the configuration like below:

Put this in ~/Library/Application Support/Claude/claude_desktop_config.json on Mac:

{
  "mcpServers": {
    "dbs": {
      "command": "node",
      "args": [
        "<path to cloned servers repo>/src/postgres/dist/index.js"
      ]
    }
  }
}

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers