Skip to main content
PawSQL MCP makes PawSQL optimization capabilities available as tools inside MCP-compatible coding assistants. From a conversation, a developer can submit a query, attach schema definitions, or select an existing PawSQL workspace and receive query rewrites, index recommendations, execution-plan analysis, and performance findings. PawSQL MCP is neither an IDE extension nor a replacement for PawSQL Cloud or PawSQL Server. It is enabled exclusively as a remote SSE service and acts as the integration layer between an MCP client and PawSQL.

Goal

Connect PawSQL to an MCP-compatible coding assistant so you can submit SQL from a conversation and receive query rewrites, index recommendations, and performance findings, with reliable database context.

How the integration works

Treat MCP responses as analysis and recommendations. Do not allow the coding assistant to execute rewritten SQL, CREATE INDEX, or other database changes automatically.

What you can do

  • Discover PawSQL workspaces available to your account.
  • Analyze a query by supplying only its database type.
  • Improve analysis quality by including table definitions, indexes, and constraints.
  • Tune SQL against the metadata of an existing workspace.
  • Receive query rewrite and index recommendations.
  • Inspect execution plans when the workspace has a live database connection.
  • Review a detailed report, analysis context, and available performance evidence.
The current public release lists MySQL, PostgreSQL, Oracle, KingbaseES, openGauss, MogDB, GaussDB, and DWS. The effective compatibility set is determined by both the MCP server version and the PawSQL service it connects to.

Choose the right analysis mode

Prefer a correctly scoped workspace when one is available. Otherwise, include the database product and version together with complete DDL for every referenced table.

Prerequisites

  • You can access PawSQL Cloud, PawSQL Server, or PawSQL Community Edition.
  • Your coding assistant supports remote MCP servers over SSE.
  • You have received the MCP SSE URL from your PawSQL administrator or service provider.
  • You have the authentication details required by the deployment.
  • Your PawSQL account can access the intended organization, project, and workspace.
  • Corporate network policy permits HTTPS access to the PawSQL MCP SSE service.

Configure PawSQL MCP

1. Obtain the SSE connection details

PawSQL MCP is available only through SSE. Before configuring a client, obtain the following details from your administrator or PawSQL service provider:
SSE endpoints may differ across PawSQL Cloud, Server, and Community Edition deployments. Use the complete URL supplied for the target environment; do not infer its port or path from an example.

2. Register the remote service

Configuration locations and field names vary by client. For clients that use an mcpServers object for remote SSE connections, the structure typically looks like this:
Replace <pawsql-mcp-sse-url> with the actual endpoint. If authentication is required, configure the credentials or request headers according to the instructions for your PawSQL deployment and MCP client.
Never commit SSE credentials, access tokens, or authentication headers to Git, paste them into shared conversations, or distribute them in project templates. Protect authentication values with client secret storage or an approved enterprise secrets solution.

3. Reload and verify the connection

1

Save the configuration

Validate the JSON syntax, SSE URL, and authentication settings.
2

Restart or reload MCP servers

Let the client reread the configuration and connect to the PawSQL MCP SSE service.
3

Confirm tool discovery

Open the client’s MCP status or tool list and verify that PawSQL is connected.
4

Run a sanitized test

Use a non-production query to confirm dialect selection, workspace discovery, and report delivery.

Run your first optimization

Option 1: Supply the query and database type

Use this mode for a quick first pass. Always name the database product and, when relevant, its version.

Option 2: Include schema definitions

When no workspace is available, provide complete table definitions, indexes, and constraints for the objects used by the query.

Option 3: Use a PawSQL workspace

Ask the assistant to list available workspaces first, then identify the target by name or ID.
If workspace names are similar, use the workspace ID and verify the organization, project, database type, and environment before the call. Never infer production or test scope from a name alone.

Review the response

Use the following order to avoid accepting a plausible-looking result with the wrong context:
  1. Analysis environment — database product, version, workspace, and schema.
  2. Resolved objects — tables, columns, indexes, and constraints.
  3. Query rewrite — predicates, joins, aggregation, ordering, null behavior, and duplicate-row semantics.
  4. Index advice — overlap with existing indexes, key order, write overhead, and storage impact.
  5. Execution plan — access paths, join methods, estimated rows, and cost.
  6. Performance evidence — measured or estimated results and the representativeness of test parameters.
  7. Detailed report — retain the report link or exported evidence for review and traceability.

Apply recommendations safely

1

Prove semantic equivalence

Compare the original and rewritten query with boundary values, nulls, duplicates, and representative business data.
2

Assess index impact

Check for redundant indexes, DML overhead, storage requirements, locking, and database-specific online build options.
3

Validate outside production

Test repeatedly with realistic data volumes, parameter distributions, and statistics.
4

Complete change review

Put query and index changes through code review, database change approval, and rollback planning.
5

Release under observation

Monitor latency, throughput, resource usage, and plan stability after deployment.

Troubleshooting

PawSQL tools do not appear

Check the JSON syntax, configuration location, remote SSE support in the client, and whether the client was reloaded after the change.

The SSE connection fails or repeatedly disconnects

Confirm that the complete SSE URL and protocol are correct. Then review DNS, TLS certificates, proxy or VPN settings, gateway idle timeouts, and firewall policy. Do not substitute the regular PawSQL web URL for the MCP SSE endpoint.

PawSQL is unreachable

Review the SSE URL, TLS certificates, proxy settings, and network policy. For an enterprise deployment, confirm that the client can resolve and reach the internal hostname.

Authentication fails

Verify that the authentication values match the SSE service requirements, then check credential expiry, account status, and workspace access. Never paste live credentials into logs or support tickets.

The intended workspace is missing

Check organization and project membership, workspace permissions, and workspace status. Confirm that the MCP server points to the PawSQL environment where the workspace was created.

The response has no plan or validation evidence

Execution-plan analysis and performance validation generally require a database-connected workspace with those capabilities enabled. Query-only and DDL-assisted requests are primarily static analyses.

The recommendation uses the wrong dialect

Resubmit the request with an explicit database product, version, schema, or workspace. For DDL-assisted analysis, ensure the schema definitions are complete and current.

PawSQL MCP compared with client extensions

Next steps

Workspaces and database context

Read optimization recommendations

Validate performance

Developer Tool Integration Overview