NextDNS-Agent-MCP
Integrates with the NextDNS API to manage profiles and settings, view analytics and query logs, check why domains are blocked, modify blocklists and parental controls, and undo/backup changes.
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., "@NextDNS-Agent-MCPWhat got blocked on my phone today, and why?"
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.
Not made by or affiliated with NextDNS. It uses the publicNextDNS API with your own API key.
Ask your AI app about your DNS in plain words. It looks at your stats and logs, and changes your blocklists, parental control and settings for you. Every change can be undone, and deleting things always asks you twice.
You: What got blocked on my phone today, and why?
AI: Reads your NextDNS log: 214 blocked, mostly trackers from OISD, and one site
from your denylist. Shows a chart.
You: My son's game doesn't load. Find out why and fix it.
AI: Watches the live log while he opens it, sees roblox.com blocked by the
"gaming" category, and asks if it should allow it on weekends only.
You: Block TikTok on the Kids profile, except Friday 6 to 9 pm.
AI: Blocks TikTok and sets recreation time. Says how to undo it.How it works
The server is a small program you run yourself. Your AI app talks to it through MCP (Model Context Protocol), the standard way AI apps use outside tools. The server talks to NextDNS through its official API, with your API key. Nobody else is in between: no account, no cloud service of ours, no tracking.
flowchart LR
A["Your AI app<br/>(Claude, ChatGPT, Codex,<br/>Cursor, Gemini, ...)"] -->|MCP| S["NextDNS-Agent-MCP<br/>(on your computer or server)"]
S -->|"API key"| N["NextDNS"]More in docs/how-it-works.md.
Related MCP server: next-dns-mcp
Words you'll see
Word | What it means here |
Profile | A NextDNS configuration (its lists, protections and settings). Devices use a profile through its address. |
API key | The key that lets this server read and change your NextDNS account. It's at the bottom of my.nextdns.io/account. |
Mode | What the AI may do with a profile: full (read and change), read (read only) or hidden. |
Passphrase | A password you make up for the web version. It locks the settings page, and you type it once when you connect an AI app over the internet. |
MCP | How AI apps plug into tools like this one. |
Settings file |
|
Data folder | Where the server keeps its own files (change log, logins, backups): |
Choose how to run it
Where it runs | Works on your phone | Cost | Guide | |
Claude Desktop extension | Your computer, inside Claude Desktop | No | Free | |
1. Your computer | Mac, Windows or Linux, for any AI app on it | Only with a tunnel | Free | |
2. A hosting company | Railway, Render or any host that runs Docker | Always | A few dollars a month | |
3. Your own server | Any server with Docker | Always | Free to cheap |
Not sure? Start with1, free, on your computer. Move to 2 when you want it on your phone all the time.
Using an AI coding agent like Claude Code, Codex or Cursor? Ask it to set this up for you: AGENTS.md gives it a checklist.
What it can do
Look. Your profiles and every setting in plain words. Analytics: allowed and blocked, top domains, block reasons, devices, IPs, protocols, query types, DNSSEC, encryption, countries and big tech companies, for any time span and also over time. Charts as pictures. The query log, searched and filtered, or downloaded.
Find out why. check_domain makes a real DNS query through the profile and tells you if a domain is blocked, and by what: the denylist, a blocklist, a category. watch_logs watches queries live while you open an app.
Change. The denylist and allowlist (many at once), privacy blocklists and native tracker protection, every security protection and blocked TLDs, parental control (services, categories, safe search, YouTube restricted mode, recreation time), DNS rewrites, logs, block page and performance settings. Everything the NextDNS API allows.
Profiles. Create a profile (with NextDNS's usual protections, empty, or as a copy of another), compare two profiles, rename them.
Undo. Every change is saved with how things were before. Ask "undo that", or press Undo on the settings page.
Backups. Save a full copy of a profile, download it as a file, and put it back later, or make a new profile from it.
Ask twice. Deleting a profile, clearing logs and overwriting a profile from a backup need a double confirmation: the AI must ask you and get a yes first.
Updates, if you want them. Get told when there's a new release, or let it update itself, official releases only. See docs/updates.md.
A settings page. On the web version, open /settings to paste your API key, choose what the AI may do with each profile, see and disconnect AI apps, undo changes, and manage backups.
All 23 tools: docs/tools.md. Ideas for what to ask: docs/examples.md.
Safety and privacy
Your choice, per profile: full, read only or hidden. Hidden profiles are never shown to the AI.
Your choice, per app: each AI app connected over the internet gets only the profiles you tick, with or without changes.
Undo for every change, and a double confirmation for anything that deletes or overwrites.
A brake: at most 30 changes a minute, and a read-only switch for everything.
Your key stays yours: it goes only to NextDNS, and is stored encrypted when you paste it on the settings page.
More in docs/safety.md and docs/privacy.md.
Quick start (about 5 minutes)
Install uv, a small free tool that installs Python programs.
Install the server:
uv tool install git+https://github.com/s17sh70x2jfl031ag/NextDNS-Agent-MCPGet your API key: sign in at my.nextdns.io/account, scroll to the bottom (API), show the key and copy it.
Save it in the settings file:
mkdir -p ~/.config/nextdns-agent-mcpecho "NEXTDNS_API_KEY=paste-your-key-here" > ~/.config/nextdns-agent-mcp/.envCheck it. It lists your profiles and changes nothing:
nextdns-agent-mcp checkConnect your AI app. For example Claude Code:
claude mcp add -s user nextdns -- nextdns-agent-mcp stdioFor Claude Desktop, ChatGPT, Codex, Cursor, VS Code, Gemini CLI, OpenClaw, Hermes Agent, Goose, Cline, Roo Code, Continue, Windsurf, Zed, LM Studio, OpenCode, Kiro, GitHub Copilot CLI, Amp, Warp, JetBrains AI Assistant, Qwen Code, Crush, Augment Code and any other MCP app, see docs/connect-your-ai.md.
Ask your AI: "Use the NextDNS tools: what got blocked today?"
All the guides
Guide | Read it when |
You use Claude Desktop and want one click | |
You want to try it, free, with any AI app | |
You want it on your phone, always on | |
You have a server with Docker | |
The server runs and you want to use it | |
You want to choose what the AI may see and change | |
You want to know what it can do | |
You want ideas | |
Something changed and you want it back | |
You want to change modes, limits or ports | |
Before you let an AI change your DNS | |
You want to know what is kept and where | |
You want to know how it works inside | |
You want the pages in your language | |
You want the newest version | |
You have a quick question | |
Something doesn't work | |
You want to know what's planned | |
You want to know what changed in each version | |
You want to report a bug or send a fix | |
You (or your AI coding agent) want to change the code or set it up |
Help and feedback
You want to | Go to |
Fix a problem yourself | |
Report a bug | |
Ask a question or share an idea | |
Report a security problem, privately |
Issues are public, so leave out your API key, profile IDs and anything from your logs.
Credits
NextDNS-Agent-MCP was made by s17sh70x2jfl031ag. NextDNS is a trademark of its owners; this project isn't made by or affiliated with them.
GitHub's "Cite this repository" button uses CITATION.cff.
License
Apache License 2.0, with the notices in NOTICE. Copyright 2026 s17sh70x2jfl031ag and NextDNS-Agent-MCP contributors.
This server cannot be deployed
Maintenance
Related MCP Connectors
Context and control for any AI. Agent identity, scoped access, and proof across tools.
Manage hosts, redirects, SSL, and traffic analytics from Claude and other AI assistants.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Hosted CRM and email desk for AI agents: key per agent, audit log, one-click undo, opt-in approval.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables AI assistants to manage NextDNS profiles, settings, logs, analytics, and security configurations through 70+ operations via the Model Context Protocol.815MIT
- FlicenseNot gradedqualityBmaintenanceMCP server for NextDNS that enables managing profiles, blocklists, analytics, DNS logs, and parental controls through natural language.-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to securely control a real, logged-in browser with per-site permissions, per-action approvals, secret redaction, and a tamper-evident audit log, all locally without a cloud relay.342,947 npm1MIT
- 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.11MIT