Skip to main content
Glama
AdGuard DNS API MCP Server

AdGuard DNS API MCP Server

by Ankur1911
README.md
# AdGuard DNS API MCP server

Generated by openapi2mcp 0.1.0 from the AdGuard DNS API OpenAPI spec (9 tools).

## Run

```bash
cp .env.example .env     # then edit if the API needs credentials
uv run server.py         # speaks MCP over stdio
```

Set `API_KEY` in `.env`; it is sent in the `Authorization` header.

## Connect a client

Add this to any MCP-compatible client (for example Cursor or VS Code), using the absolute path to this folder:

```json
{
  "mcpServers": {
    "adguard-dns": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/this/folder", "server.py"]
    }
  }
}
```

The exact config file and key names differ by client; check your client's MCP documentation.

## Tools

| Tool | Request | Summary |
|---|---|---|
| `getAccountLimits` | `GET /oapi/v1/account/limits` | Gets account limits |
| `getDevice` | `GET /oapi/v1/devices/{device_id}` | Gets a device by ID |
| `getDeviceSettings` | `GET /oapi/v1/devices/{device_id}/settings` | Gets device settings |
| `getQueryLog` | `GET /oapi/v1/query_log` | Gets query log |
| `getDevicesQueriesStats` | `GET /oapi/v1/stats/devices` | Gets devices statistics |
| `getDomainsQueriesStats` | `GET /oapi/v1/stats/domains` | Gets domains statistics |
| `getTimeQueriesStats` | `GET /oapi/v1/stats/time` | Gets time statistics |
| `getDevices` | `GET /oapi/v2/devices` | Lists devices |
| `getDnsServers` | `GET /oapi/v2/dns_servers` | Lists DNS servers |

## Configuration

See `.env.example`. Key settings: `API_BASE_URL`, `API_TIMEOUT`, `MAX_RESPONSE_CHARS`, `LOG_LEVEL`, `MCP_TRANSPORT`.

Logs go to stderr (stdout is reserved for the protocol).

## Status

Unofficial, read-only prototype generated from the public AdGuard DNS OpenAPI spec (version 1.17.4, as published in their developer docs), 9 of 48 operations. Only startup, tool listing and the unauthenticated error path have been verified; it has not been run against a live account. No automatic pagination, retries or rate limiting. Write operations are intentionally left out. Related issue: https://github.com/AdguardTeam/AdGuardDNS/issues/1088

Licence: MIT.