by dmeiser
Provides a Model Context Protocol server that exposes the full NextDNS API as AI‑compatible tools, enabling automated DNS profile management, analytics, and content‑list control through simple MCP calls.
Nextdns Mcp Server turns the NextDNS REST API into a set of high‑level MCP tools. These tools can be invoked by AI assistants or any MCP‑compatible client to create, read, update, and delete DNS profiles, manage settings, retrieve logs, run analytics, and control content filters without writing raw HTTP requests.
uv, and Docker if containerised deployment is desired..env.example to .env and set NEXTDNS_API_KEY (optionally define default and test profiles, readable/writable profiles, and read‑only mode).uv sync && uv run python -m nextdns_mcp.serverdocker build -t nextdns-mcp:latest . then run the container, passing the API key via environment variable, secret file, or env‑file as described in the README.nextdns-openapi.yaml.Q: Do I need a NextDNS account? A: Yes, you must have a NextDNS account and an API key, which can be generated at the account page.
Q: Can I run the server without Docker?
A: Absolutely. The server can be executed directly with Python using uv run as shown in the quick‑start section.
Q: How are write operations protected?
A: The server respects the NEXTDNS_READABLE_PROFILES, NEXTDNS_WRITABLE_PROFILES, and NEXTDNS_READ_ONLY environment variables to limit which profiles can be modified.
Q: What Python version is required? A: Python 3.12 or newer.
Q: Are there official image tags for production?
A: Use the immutably versioned tags like :2.0.3 or :2.0.3-alpine. Floating tags (latest, 2, 2.0) are rebuilt regularly but may include unreleased changes.
Q: How does the server communicate? A: MCP servers use standard input/output streams; no HTTP port is opened.
A Model Context Protocol (MCP) server for the NextDNS API, built with FastMCP and generated from OpenAPI specifications.
This project provides an MCP server that exposes NextDNS API operations as tools that can be used by AI assistants and other MCP clients. The server is automatically generated from a comprehensive OpenAPI specification using the FastMCP library.
Complete documentation can be found in docs/index.md.
Copy the .env.example file to .env:
cp .env.example .env
Edit .env and set your NextDNS API key:
NEXTDNS_API_KEY=your_api_key_here
NEXTDNS_DEFAULT_PROFILE=your_profile_id # Optional
NEXTDNS_TEST_PROFILE=test_profile_id # For write operation tests
# Optional: Profile access control (see Profile Access Control section)
# NEXTDNS_READABLE_PROFILES=profile1,profile2
# NEXTDNS_WRITABLE_PROFILES=test_profile
# NEXTDNS_READ_ONLY=false
Build the Docker image:
docker build -t nextdns-mcp:latest .
Run the container with environment variables:
Option A: Direct environment variables (simple)
docker run -i --rm \
-e NEXTDNS_API_KEY=your_api_key_here \
-e NEXTDNS_DEFAULT_PROFILE=your_profile_id \
nextdns-mcp:latest
Option B: Docker secrets (recommended for production)
# Create secret
echo "your_api_key_here" | docker secret create nextdns_api_key -
# Run with Docker Swarm
docker service create \
--name nextdns-mcp \
--secret nextdns_api_key \
-e NEXTDNS_API_KEY_FILE=/run/secrets/nextdns_api_key \
nextdns-mcp:latest
Or for non-swarm (using mounted file):
# Create a secret file
echo "your_api_key_here" > /tmp/api_key.txt
chmod 600 /tmp/api_key.txt
# Run with mounted secret
docker run -i --rm \
-v /tmp/api_key.txt:/run/secrets/nextdns_api_key:ro \
-e NEXTDNS_API_KEY_FILE=/run/secrets/nextdns_api_key \
nextdns-mcp:latest
Option C: Environment file (development)
docker run -i --rm \
--env-file .env \
nextdns-mcp:latest
Note: MCP servers use stdio (standard input/output) for communication, not HTTP ports.
Alpine variant
An Alpine Linux image is also available. To build it locally, use Dockerfile.alpine:
docker build -f Dockerfile.alpine -t nextdns-mcp:alpine .
The published Alpine tags use the -alpine suffix (e.g. nextdns-mcp:alpine, nextdns-mcp:2.0-alpine). The python:3.14-slim image remains the recommended default.
Install dependencies:
uv sync
Run the server:
uv run python -m nextdns_mcp.server
This server uses a modern, declarative approach:
FastMCP.from_openapi(), with atomic tools removed and replaced by grouped CRUD toolshttpx.AsyncClient with profile-level access control for NextDNS API callssrc/nextdns_mcp/nextdns-openapi.yaml: OpenAPI 3.0 specification for NextDNS APIsrc/nextdns_mcp/server.py: FastMCP server implementationcatalog.yaml: Docker MCP Gateway catalog entry with server metadataDockerfile: Container definition with OCI labels for MCP GatewayAGENT.md: Development guidelines and safety rulesThis project publishes official Docker images with a standardized tagging policy. The default image is based on python:3.14-slim; an Alpine Linux variant is also available and tagged with an -alpine suffix.
python:3.14-slim) tags:latest: Floating tag that tracks the most recent successful build from the main branch. This tag is rebuilt on changes to main and via scheduled rebuilds.:<major>: Floating tag for the most recent build in a given major series (e.g., :2). This tag is updated whenever a new image for that major line is published and may include unreleased changes if the corresponding build comes from a branch head.:<major>.<minor>: Floating tag for the most recent build in a given minor series (e.g., :2.0). Like :<major>, it is updated when new images are built for that series and may include unreleased changes.:<major>.<minor>.<patch>: Tags for specific application releases (e.g., :2.0.3). These are intended to be immutable once published via the release workflow.:alpine: Floating tag for the most recent Alpine build from main.:<major>-alpine: Floating tag for the most recent Alpine build in a major series (e.g., :2-alpine).:<major>.<minor>-alpine: Floating tag for the most recent Alpine build in a minor series (e.g., :2.0-alpine).:<major>.<minor>.<patch>-alpine: Specific Alpine release tag (e.g., :2.0.3-alpine).All floating tags (:latest, :<major>, :<major>.<minor> and their -alpine counterparts) are rebuilt regularly to include the latest OS security updates and any application changes present in the source commit used for that build. Consumers who require strict version pinning should use the full :<major>.<minor>.<patch> or :<major>.<minor>.<patch>-alpine tags.
This project is released under the MIT License.
AGENT.md for guidelines and architecturePlease log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.