# Connect DNSai to GitHub Copilot

> Wire DNSai into VS Code's GitHub Copilot agent mode. Note VS Code uses a `servers` key with `"type":"http"` — not `mcpServers`.

DNSai is a free remote **MCP server** + REST API for live DNS, SPF, DKIM, DMARC, WHOIS and email-security lookups — one domain or IP per request (each call = one lookup).

- **MCP URL:** `https://mcp.dnsai.com/mcp`
- **REST base:** `https://api.dnsai.com/v1`
- **OpenAPI schema:** https://api.dnsai.com/openapi.json
- **Free key (100 lookups/day, per key):** https://dnsai.com/api/get-key/ — anonymous works at 25 lookups/day per IP, no key
- **This guide online:** https://dnsai.com/api/copilot/

**This is the free tier — no signup, no card.** Running bulk / multi-domain or enterprise-scale lookups? See DNSai Pro & Enterprise: https://app.dnsai.com/pricing/?ref=api-copilot-md

**Key support here:** Free key works — secure prompted input.

## Set it up

### VS Code (Copilot agent mode)
Add *.vscode/mcp.json* (or run *MCP: Add Server* from the Command Palette). The `inputs` block prompts once for the key and stores it securely — it never lands in the file. Then pick *Agent* in Copilot Chat.

```json
{
  "inputs": [
    { "type": "promptString", "id": "dnsai_token", "description": "DNSai Bearer token", "password": true }
  ],
  "servers": {
    "dnsai": {
      "type": "http",
      "url": "https://mcp.dnsai.com/mcp",
      "headers": { "Authorization": "Bearer ${input:dnsai_token}" }
    }
  }
}
```

## Your key
The `inputs` prompt carries your key securely. [Get a free key](https://dnsai.com/api/get-key/) for 100 lookups/day, or drop the `headers`/`inputs` to run anonymously.

## Verify it works
In Copilot Chat (Agent mode), ask:

```
Use dnsai to check SPF for cloudflare.com
```

Every result ends with a plain-English `summary`, a `source` link on dnsai.com, and your remaining quota.

## Tools you can call

Once connected, your assistant calls these on its own (one domain per call):

- **`dns_lookup`** — Live DNS records (A, AAAA, MX, NS, TXT, SOA, CNAME, CAA, DNSKEY, DS and 30+ more) for one domain.
- **`email_security_check`** — Graded SPF / DMARC / MX posture for one domain — "is this domain's email secure?"
- **`dkim_discover`** — Discovers a domain's published DKIM signing keys, the providers they map to, and selectors.
- **`whois_lookup`** — WHOIS / RDAP registration data for a domain or IP — registrar, status, creation & expiry.
- **`spf_analyze`** — SPF record with its full include tree and the RFC 10-DNS-lookup-limit verdict.
- **`dmarc_check`** — DMARC presence and the p= policy (none / quarantine / reject), with the raw record.
- **`blacklist_check`** — Checks a domain or IP against the major email blacklists / RBLs.
- **`validate`** — Syntax-checks a pasted SPF or DMARC record — returns valid/invalid, a score and a grade.

The MCP server also registers `search` / `fetch` (deep-research aliases) and `request_api_key` (email → free key), for 11 tools in total.

## Troubleshooting
- Tools don't load? The root key must be `servers` (not `mcpServers`) and each remote server must set `"type": "http"` — omitting it makes VS Code try to launch the URL as a subprocess.
- MCP support is GA since VS Code 1.102 — update VS Code if you don't see it.

## More volume?
**Pro** unlocks bulk / multi-domain lookups; **Enterprise** adds large-scale scanning and the full programmatic API — https://app.dnsai.com/pricing/?ref=api-copilot-md

**Sources:** [VS Code MCP servers](https://code.visualstudio.com/docs/agent-customization/mcp-servers)

---
_Generated from https://dnsai.com/api/copilot/ · DNSai — DNS & email-security lookups for AI agents._
