dns-mcp
Provides tools for managing DNS records in Google Cloud DNS zones.
Provides tools for managing DNS records (list, get, create, update, delete) in Porkbun DNS zones.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dns-mcpList all DNS records for example.com"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dns-mcp
dns-mcp is a small, provider-agnostic Model Context
Protocol server that exposes DNS record CRUD as
typed tools: list a zone's records, get one, and create / update / delete
records. It turns ad-hoc "go poke the DNS API" scripts into constrained,
structured tools an agent can call.
The server is provider-agnostic by design: it hard-codes no DNS provider. A zone's records are served entirely by the injected backend, so the same server works against whatever provider infra wires up (e.g. Porkbun or Google Cloud DNS).
Repo structure: this ships as a per-server repo, following the shipped convention (e.g.
telemetry-mcp,reddit-mcp,dispatch-mcp). Whether the fleet's MCP servers consolidate into a singleagent-mcprepo is pending a consolidation decision; until that lands, this stays per-server.
Tools
Tool | Purpose |
| List every DNS record in the zone (sorted by name then type). |
| Get the record identified by |
| Create a record; the backend rejects a conflict. |
| Update the record identified by |
| Delete the record identified by |
zone is the apex domain (e.g. example.com). name is the record name — @
for the apex, * for a wildcard, or a host label / FQDN. type is a supported RR
type (A/AAAA/CNAME/TXT/MX/NS/SRV/CAA/ALIAS/PTR). ttl
(seconds) is optional — None lets the provider default it. priority is used by
MX / SRV.
Related MCP server: MCP DNS
Security model
This server is built so that exposing it does not expose arbitrary provider access or command execution. The properties below are enforced in code and covered by tests.
Bounded surface. The tools are list/get/create/update/delete over a validated record model. There is no raw provider-call escape hatch — a caller cannot supply arbitrary API text.
No embedded credentials. Nothing in this package stores a token or key. Credentials are resolved at call time by an injected
CredentialProvider(backed by WIF/GSM/env in production) and handed to the backend per request; they never live in source, in the service, or in a returned payload (tests assert the sentinel credential never appears in output).Validated inputs. Zone, record name, type, and TTL are restricted to a conservative shape (RR types are an allowlist), so a rejected request cannot smuggle injection into the backend (defence in depth; the provider's own validation is the real gate).
Provider-agnostic. No provider is hard-coded; the backend defines how records are stored and served, so the server cannot leak provider-specific surface.
Deliberate omissions
No tool lets the caller supply or override raw provider API calls.
No tool returns or accepts credentials.
Zone-level operations (creating/deleting whole zones, nameserver delegation) are out of scope here by design — this is record CRUD only.
Configuration (environment, resolved at call time)
Variable | Effect |
| Which provider adapter the production backend uses (consumed once infra wires it). |
| The default zone the backend operates on. |
No credentials are read from the environment by this server; identity is resolved per call from the runtime (WIF/GSM) by the credential provider.
What infra must wire (the build split)
This repo is the offline-testable scaffold. The core, the MCP wrapper, the backend interface, and a full offline test suite (fake in-memory backend) are complete here. The live provider adapter + credentials are intentionally not wired — that is the infra half:
Backend implementation. Add a real adapter implementing the
DnsBackendprotocol insrc/dns_mcp/backend.py(the defaultUnconfiguredBackendcurrently fails fast with "not wired up"). It must map the provider-neutralRecordmodel to and from the provider's record API:list_records/get_recordread the zone's records.create_record/update_record/delete_recordmutate them, honouring conflict (create) and missing-record (get/update/delete) semantics.A likely first adapter is Porkbun (
speedforge.devis registered there) or Google Cloud DNS.
Zone. The DNS zone(s) the adapter operates on (
DNS_ZONE).Identity (keyless). Prefer a Workload Identity Federation service account for Cloud DNS, or a GSM-backed API key for an API-key provider like Porkbun. The
CredentialProviderresolves this at call time; no key is stored in this repo or the image.Config. Set
DNS_PROVIDERandDNS_ZONEfor the workload.
Until step 1 lands, the production backend raises and only the fake-backed offline path runs — so this scaffold is safe to ship and CI is green without any provider access.
Install
Run directly from GitHub with the MCP extra:
uvx --from "dns-mcp[mcp] @ git+https://github.com/selamy-labs/dns-mcp@v0.1.0" dns-mcpOr with pipx:
pipx install "dns-mcp[mcp] @ git+https://github.com/selamy-labs/dns-mcp@v0.1.0"MCP client config
{
"mcpServers": {
"dns": {
"command": "uvx",
"args": [
"--from",
"dns-mcp[mcp] @ git+https://github.com/selamy-labs/dns-mcp@v0.1.0",
"dns-mcp"
],
"env": {
"DNS_PROVIDER": "porkbun",
"DNS_ZONE": "example.com"
}
}
}
}Architecture
The DNS record logic lives once in dns_mcp.core.DnsService; the MCP server in
dns_mcp.mcp_server is a thin wrapper that serialises structured results to JSON
and maps expected failures to ToolError. All record access goes through an
injected backend (dns_mcp.backend.DnsBackend) and all credential resolution
through an injected CredentialProvider, so the full validate / route / shape
path is exercised offline in tests with a fake in-memory backend — no provider, no
network. The default backend (UnconfiguredBackend) uses only the standard
library until infra wires a real adapter, so the core package has zero runtime
dependencies; the mcp SDK is an optional extra.
Development
python -m pip install -e ".[test]"
ruff format --check .
ruff check .
coverage run -m pytest
coverage report --fail-under=95License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/selamy-labs/dns-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server