> For the complete documentation index, see [llms.txt](https://docs.aisuru.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aisuru.com/en/advanced-features/integrations/mcp/aisuru-mcp-which-ones-and-how-to-activate/10.-microsoft-sql-server-mcp.md).

# 10. Microsoft SQL Server MCP

The Microsoft SQL Server MCP lets your Agent connect to Microsoft SQL Server and Azure SQL databases. Supports SQL queries, schema management\*, metrics, and enterprise security.

This MCP is useful for:

* Querying SQL Server databases
* Running complex queries on enterprise databases
* Managing data in Microsoft Azure environments

## Configuration parameters

| Parameter                     | Required | Description                                                                                                                      |
| ----------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `DB_HOST`                     | Yes      | SQL server address. Format: `servername.database.windows.net` (Azure) or `localhost`. Example: `aisuru-sql.database.windows.net` |
| `DB_DATABASE`                 | Yes      | Database name. Alphanumeric string. Example: `aisuru_db`, `production`                                                           |
| `DB_USER`                     | Yes      | Username for authentication. Format: `admin` or `admin@servername`. Example: `sqladmin`                                          |
| `DB_PASSWORD`                 | Yes      | User password. Complex string. Example: `MySecureP@ssw0rd123!`                                                                   |
| `DB_PORT`                     | No       | SQL server port. Default: `1433`. Any TCP port accepted.                                                                         |
| `DB_ENCRYPT`                  | No       | Enable TLS/SSL encryption. Default: `true`. Possible values: `true`, `false`                                                     |
| `DB_TRUST_SERVER_CERTIFICATE` | No       | Accept self-signed certificates. Default: `false`. Possible values: `true`, `false`                                              |
| `CONNECTION_TIMEOUT`          | No       | Connection timeout in seconds. Default: `15`. Range: `5–120`                                                                     |
| `REQUEST_TIMEOUT`             | No       | Query timeout in seconds. Default: `15`. Range: `5–300`                                                                          |
| `POOL_SIZE`                   | No       | Connection pool size. Default: `10`. Range: `1–100`                                                                              |

### How to get the parameters <a href="#f09f9491-come-ottenere-i-parametri-3" id="f09f9491-come-ottenere-i-parametri-3"></a>

**Option A: Azure SQL Database (Cloud)**

1. **After creating** an Azure SQL Database
2. Go to **Azure Portal** → **SQL databases** → select your database
3. In the side menu, click **Connection strings**
4. You'll find a string like:

   ```
   Server=tcp:myserver.database.windows.net,1433;
   Initial Catalog=mydatabase;
   User ID=sqladmin;
   Password={your_password};
   Encrypt=True;
   ```
5. **Extract and enter the parameters**:
   * `DB_HOST`: `myserver.database.windows.net`
   * `DB_DATABASE`: `mydatabase`
   * `DB_USER`: `sqladmin`
   * `DB_PASSWORD`: the password you set
   * `DB_PORT`: `1433` (or leave blank to use default)
   * `DB_ENCRYPT`: `true`
   * `DB_TRUST_SERVER_CERTIFICATE`: `false`

### Custom parameters

* **connectionTimeout**: Maximum time to connect (seconds)
* **requestTimeout**: Maximum time for a request (seconds)
* **poolSize**: Number of connections in the pool
* **enableArithAbort**: Enable arithmetic error interruption
* **trustServerCertificate**: Accept self-signed SSL certificates

```json
{
  "connectionTimeout": 15,
  "requestTimeout": 30,
  "poolSize": 10,
  "enableArithAbort": true,
  "options": {
    "trustServerCertificate": false,
    "enableArithAbort": true
  }
}
```

{% hint style="info" %}
**Schema management** is the practice of defining, versioning, and enforcing the structure of your data
{% endhint %}
