# DeepSQL MCP server

> An AI database agent for PostgreSQL and MySQL that performs schema exploration, query generation, slow query analysis, and index recommendations.

- Repository: https://github.com/DeepSQLAI/deepsql
- Page: https://hostedmcp.org/servers/deepsqlai/deepsql
- Transport: —
- Stars: 40
- License: Apache-2.0

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `DEEPSQL_API_BASE_URL` | no | no |  |
| `DEEPSQL_AUTH_TOKEN` | no | no |  |
| `DEEPSQL_CHAT_API_KEY` | no | no |  |
| `DEEPSQL_CHAT_ENDPOINT` | no | no |  |
| `DEEPSQL_CHAT_MODEL` | no | no |  |
| `DEEPSQL_CHAT_PROVIDER` | no | no |  |
| `DEEPSQL_EMBEDDING_API_KEY` | no | no |  |
| `DEEPSQL_EMBEDDING_ENDPOINT` | no | no |  |
| `DEEPSQL_EMBEDDING_MODEL` | no | no |  |
| `DEEPSQL_EMBEDDING_PROVIDER` | no | no |  |

## FAQ

### What databases does DeepSQL support?

DeepSQL is designed for PostgreSQL and MySQL.

### Does DeepSQL provide its own AI model?

No, DeepSQL does not include a model provider; you must connect it to an external provider like OpenAI, Azure OpenAI, or a local model via LiteLLM or Ollama.

### How does DeepSQL handle database security?

Database credentials are encrypted in a local vault, and the system is designed to be self-hosted and air-gapped so that nothing leaves your controlled machines except prompts sent to your chosen endpoint.
