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
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.
Choose the right analysis mode
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 anmcpServers object for remote SSE connections, the structure typically looks like this:
<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.
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:- Analysis environment — database product, version, workspace, and schema.
- Resolved objects — tables, columns, indexes, and constraints.
- Query rewrite — predicates, joins, aggregation, ordering, null behavior, and duplicate-row semantics.
- Index advice — overlap with existing indexes, key order, write overhead, and storage impact.
- Execution plan — access paths, join methods, estimated rows, and cost.
- Performance evidence — measured or estimated results and the representativeness of test parameters.
- 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.