PawSQL MCP Server

by pawsql

Not rated
GitHub

About

A SQL optimization service providing performance analysis and optimization suggestions through an API.

Details

Author
pawsql
Categories
Database, Other

Setup

Install PawSQL MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/pawsql/pawsql-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

PawSQL MCP Server is a SQL optimization service developed based on Spring AI, providing SQL performance analysis and optimization suggestions. It runs as an MCP (Model Control Protocol) server and provides SQL optimization capabilities through API interfaces.

- Supports both workspace and workspace-free optimization modes
- Provides SQL rewriting and index optimization suggestions
- Visual execution plan analysis (for database-connected workspaces)
- Performance evaluation reports

- MySQL
- PostgreSQL
- Oracle
- KingbaseES
- openGauss
- MogDB
- GaussDB
- DWS

- Open Claude Desktop
- Select "Settings", click "Developer" tab
- Click "Edit Config"
- Add MCP server configuration
- Save the file
- Restart Claude Desktop

{ "mcpServers": { "pawsql": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "PAWSQL_EDITION=<edition>", "-e", "PAWSQL_API_BASE_URL=<api-url>", "-e", "PAWSQL_API_EMAIL=<email>", "-e", "PAWSQL_API_PASSWORD=<password>", "pawsql/pawsql-mcp-server:latest" ] } } }

- <edition>: Choose one of the following editions

- enterprise- Enterprise Edition
- cloud- Cloud Edition
- community- Community Edition

{ "mcpServers": { "pawsql": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "PAWSQL_EDITION=enterprise", "-e", "PAWSQL_API_BASE_URL=https://your-enterprise-api.com", "-e", "PAWSQL_API_EMAIL=admin@company.com", "-e", "PAWSQL_API_PASSWORD=your-password", "pawsql/pawsql-mcp-server:latest" ] } } }
{ "mcpServers": { "pawsql": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "PAWSQL_EDITION=cloud", "-e", "PAWSQL_API_EMAIL=user@example.com", "-e", "PAWSQL_API_PASSWORD=your-password", "pawsql/pawsql-mcp-server:latest" ] } } }
{ "mcpServers": { "pawsql": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "PAWSQL_EDITION=community", "-e", "PAWSQL_API_BASE_URL=https://community-api.pawsql.com", "pawsql/pawsql-mcp-server:latest" ] } } }

After configuration, you can use PawSQL MCP Server in different ways. Here are some examples:

Before using workspace-based optimization, you need to get the workspace information:

User: What workspaces are available? Assistant: Here are the available workspaces: | Workspace Name | Workspace ID | Database Type | Can Validate Optimization | Status | |---------------|--------------|--------------|------------------------|--------| | WS_MySQL_202505241801 | 1926217077522944002 | mysql | Yes | success |
Help me optimize this mysql query: select  from customer where c_custkey = (select max(o_custkey) from orders where subdate(o_orderdate, interval '1' DAY) < '2022-12-20')

Method 2: Optimization with Table Structure

Provide database type, table structure (DDL), and SQL query:

I want to optimize this mysql query, here's the table structure: CREATE TABLE customer ( C_CUSTKEY int NOT NULL, C_NAME varchar(25) NOT NULL, C_ADDRESS varchar(40) NOT NULL, C_NATIONKEY int NOT NULL, C_PHONE char(15) NOT NULL, C_ACCTBAL decimal(15,2) NOT NULL, C_MKTSEGMENT char(10) NOT NULL, C_COMMENT varchar(117) NOT NULL, PRIMARY KEY PK_IDX1614428511 (C_CUSTKEY) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; CREATE TABLE orders ( O_ORDERKEY int NOT NULL, O_CUSTKEY int NOT NULL, O_ORDERSTATUS char(1) NOT NULL, O_TOTALPRICE decimal(15,2) NOT NULL, O_ORDERDATE date NOT NULL, O_ORDERPRIORITY char(15) NOT NULL, O_CLERK char(15) NOT NULL, O_SHIPPRIORITY int NOT NULL, O_COMMENT varchar(79) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; select  from customer where c_custkey = (select max(o_custkey) from orders where subdate(o_orderdate, interval '1' DAY) < '2022-12-20')

Provide workspace name/ID and SQL query for more accurate optimization with actual database context:

Optimize this query in workspace WS_MySQL_202505241801: select * from customer where c_custkey = (select max(o_custkey) from orders where subdate(o_orderdate, interval '1' DAY) < '2022-12-20')

You can obtain workspace information through two methods:
- Using PawSQL MCP Tools: Ask the AI assistant to list available workspaces using built-in commands
- Web Interface: Visit your configured PawSQL service web interface to view and manage workspaces

The system will return an optimization report containing the following:

- Contains SQL analysis context information

- SQL rewriting suggestions
- Index optimization suggestions
- Execution plan analysis (for validation-enabled workspaces only)
- Performance improvement estimates

An MCP server for PostgreSQL providing index tuning, explain plans, health checks, and safe SQL execution.

An MCP interface for the rails-pg-extras gem, providing PostgreSQL metadata and performance analysis through LLM prompts.

Official MCP server for dbt (data build tool) providing integration with dbt Core/Cloud CLI, project metadata discovery, model information, and semantic layer querying capabilities.

Open source MCP server specializing in easy, fast, and secure tools for Databases.

Query and analyze data with MotherDuck and local DuckDB

Query Streams securely connects MCP clients to live databases through the Query Streams Cloud Network, with no VPNs, inbound ports, or complex setup.

Interact with the SingleStore database platform

Official Supabase MCP server for managing Supabase projects, databases, auth, storage, edge functions, and SQL workflows from AI agents.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.