devns
Manages local development domains served by Caddy, with automatic HTTPS and reverse proxying to local application ports. Provides tools to add, remove, list, and check the health of domains, which directly update Caddy's configuration and reload it via its admin API.
Click on "Deploy 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., "@devns Add myapp.test to port 3000"
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.
devns
Local domain https://<name>.test without a port for macOS.
devns add webui 8080
# ✓ https://webui.test → 127.0.0.1:8080 (caddy admin load HTTP 200)One CLI that sets everything up: dnsmasq (wildcard *.test → 127.0.0.1), Caddy (the sole holder of ports 80/443, automatic HTTPS via internal CA), and an optional local DoH bridge so browsers with Secure DNS can still open .test domains.
Why is it needed?
Without devns | With devns |
|
|
Port conflicts between projects | Unique name per project, no port in the URL |
Plain HTTP | Trusted HTTPS (secure cookies, service workers, clipboard API work) |
Browser Secure DNS kills local domains | DoH bridge: |
Related MCP server: Domain Checker
Install
Requirements: macOS + uv + Homebrew.
git clone https://github.com/apiep/devns && cd devns
uv tool install --editable .
devns init # sekali saja — minta sudo interaktif 2-3x
devns doh install # opsional: bridge DoH utk browser secure-DNSdevns init sets up:
brew install dnsmasq caddyif not already installed/etc/resolver/test→ macOS routes the.testTLD to 127.0.0.1address=/.test/127.0.0.1block indnsmasq.conf+ root service on :53Main Caddyfile (
import ~/.config/devns/sites/*.caddy) + root service on 80/443Caddy's internal CA added to the system trust store (
sudo caddy trust)DoH bridge (
dnsproxyfrom AdGuard — binary auto-downloaded based on OS/arch)
Day-to-day no sudo at all: add/rm/ls/open/doctor/doh/log.
Usage
devns add pueue 7337 # daftarkan domain + reload Caddy + cek port
devns add api 3000 --open # sekalian buka browser
devns ls # ● https://pueue.test → 127.0.0.1:7337
devns open pueue # buka di browser default
devns rm pueue # hapus (konfirmasi; -y skip)
devns doctor # kesehatan: resolver/DNS/Caddy/HTTPS/DoH
devns doh install # bridge DoH (LaunchAgent user-level)
devns doh status
devns doh log -f # ikuti log dnsproxy liveBrowsers with Secure DNS
After devns doh install, set Secure DNS to Custom: https://dns.test:8443/dns-query.
.test queries are answered locally, all other queries are forwarded encrypted to your chosen DoH upstream (default OpenDNS).
Architecture
Browser ──DoH──> dns.test:8443 (dnsproxy, launchd io.devns.doh)
├─ [/test/] ──> dnsmasq :53 ──> 127.0.0.1
└─ lainnya ──> https://doh.opendns.com/dns-query
Browser ──HTTPS──> Caddy :443 ──reverse_proxy──> 127.0.0.1:<port-app>
──HTTP───> Caddy :80 ──308──> HTTPS
cert: Caddy Local Authority (tls internal), per-hostname on-demandRegistry:
~/.config/devns/registry.yaml= the single source of truthSite files:
~/.config/devns/sites/<name>.caddy(generated artifacts; the template usesflush_interval -1so SSE is not buffered)Daily reload: Caddy admin endpoint
localhost:2019with theContent-Type: text/caddyfileheader
MCP server
devns ships with a stdio MCP server with no extra dependencies:
hermes mcp add devns --command devns-mcp # Hermes Agent
# atau konfigurasi MCP client lain (Claude Desktop dsb) dengan command "devns-mcp"Tools: list_domains, add_domain, remove_domain, check_health, doh_status.
Skill for AI agents
This repo includes a portable skill at skills/devns/SKILL.md (agentskills.io / Claude skills format). Copy or symlink it into your agent's skills directory.
Design notes (real-world lessons)
Wildcard
*.testis rejected by modern verifiers — Chrome and curl reject a wildcard cert that attaches directly to a TLD even if the SAN is RFC-valid. That's why certs are generated per-hostname on demand by Caddy's internal CA.Port 5353 is already used by mDNSResponder (Bonjour) → the DoH bridge uses 5335.
/etc/resolver/testmakes resolution hang (not fail fast) when dnsmasq is down — that's a sign the resolver is active, not a bug.
License
MIT
Available Tools
5 toolsadd_domainA
Daftarkan nama.test -> 127.0.0.1:port lalu reload Caddy. Nama harus [a-z0-9-]. Contoh: add_domain(name='webui', port=8080)
Inputs: name (required), port (required).
check_healthA
Cek kesehatan rantai devns: resolver, DNS, Caddy (admin + 80/443), HTTPS.
Inputs: no named parameters.
doh_statusC
Status bridge DoH lokal (dnsproxy via launchd).
Inputs: no named parameters.
list_domainsA
Daftar semua domain *.test terdaftar beserta port dan status port.
Inputs: no named parameters.
remove_domainB
Hapus nama.test dari registry + site Caddy, lalu reload.
Inputs: name (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool serves a distinct purpose: listing, adding, removing domains, checking overall health, and checking DoH status. There is no overlap or ambiguity between the tools, making selection straightforward.
All tool names follow a consistent snake_case pattern with a verb_noun structure (list, add, remove, check) except 'doh_status' which is a noun phrase, but it still fits the naming style seamlessly. No mixed conventions or inconsistent verbs.
Five tools cover the complete lifecycle of managing local dev domains and health monitoring without being excessive or sparse. This is well-scoped for a developer-focused DNS and Caddy management server.
The tool set provides full CRUD for domains (list, add, remove) plus health checks for the entire system maintenance. There are no obvious missing operations required for the stated purpose; updates can be achieved by remove/add.
Related MCP Connectors
Look up DNS records, diagnose domain configuration, and save DNS snapshots.
Add, check, diagnose and remove your SaaS customers' custom domains from any MCP client.
Validates domain email MX records and DNS status via Cloudflare DNS-over-HTTPS.
Manage Koru Shield DNS filtering: profiles, rules, categories, schedules, and logs.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables comprehensive DNS operations including lookups for various record types, reverse DNS queries, batch processing, and DNS resolution tracing. Supports multiple DNS servers with configurable caching and robust error handling.411 npm2MIT
- FlicenseNot gradedqualityDmaintenanceEnables checking domain availability using WHOIS and DNS resolution, with support for single and batch queries.29-
- FlicenseAqualityCmaintenanceEnables MCP-speaking agents to claim and manage free subdomains under makes.fyi or agentdomains.co, including DNS records, HTTPS, URL forwarding, reverse proxying, and account management.15116 npm3-
- AlicenseAqualityBmaintenanceEnables Claude to read and manage a DNS server on the user's own machine through its HTTP API, covering stats, settings, zones, logs, users, ad blocking, cache flushing, and DNS records. Every call carries a safety level, so read actions run immediately while changes and destructive operations require explicit confirmation, with credentials kept local and downloads written to disk rather than chat.12MIT