Skip to main content
Glama

Tophost DNS MCP

MCP server for the unofficial Tophost DNS API.

This project is unofficial and is not affiliated with, endorsed by, or supported by Tophost.

The server exposes the DNS operations implemented by tophost-dns-api as Model Context Protocol tools. It does not talk to the Tophost control panel directly.

MCP client / AI agent
        |
        v
Tophost DNS MCP
        |
        v
Tophost DNS API
        |
        v
Tophost

The separation is intentional: Tophost authentication, trusted 2FA, product discovery, HTML parsing and DNS protocol details remain inside tophost-dns-api. This repository is only the MCP tool layer.

Status

Initial implementation. The package targets the current stable v2 line of the official Python MCP SDK.

Related MCP server: Spaceship MCP Server

Requirements

  • Python 3.11 or newer

  • a running tophost-dns-api instance

  • the API key configured by that instance

Installation

git clone https://github.com/DanielVd/tophost-dns-mcp.git
cd tophost-dns-mcp

python -m venv .venv
. .venv/bin/activate

pip install -e .

For development:

pip install -e '.[dev]'

Configuration

export TOPHOST_DNS_API_URL=http://127.0.0.1:8765
export TOPHOST_API_KEY='replace-me'

Optional:

export TOPHOST_MCP_REQUEST_TIMEOUT=20

The MCP process does not need TOPHOST_USER, TOPHOST_PASS, OTP values or trusted 2FA state. Those remain configured only in tophost-dns-api.

Running

The default transport is stdio:

tophost-dns-mcp

For Streamable HTTP:

tophost-dns-mcp \
  --transport streamable-http \
  --host 127.0.0.1 \
  --port 8000

The MCP endpoint is the SDK default, /mcp.

For development with the MCP Inspector:

mcp dev src/tophost_dns_mcp/server.py:mcp

Tools

Tool

Mutation

Purpose

tophost_api_health

no

Check REST API reachability

list_domains

no

List domains available to the account

list_dns_records

no

List/filter DNS records

get_dns_record

no

Read one record by current record ID

create_dns_record

yes

Create a record; identical records are a no-op

update_dns_record

yes

Update with mandatory expected-state guards

delete_dns_record

yes

Delete with mandatory expected-state guards

Read-only and mutation tools include MCP tool annotations. These annotations are client hints only; they are not treated as an authorization mechanism.

Mutation safety

The MCP layer deliberately makes update and delete stricter than the REST API.

Before updating or deleting a record, first read it and pass both expected_value and expected_priority back to the mutation tool. The REST API verifies that the record has not changed in the meantime and refuses a stale mutation.

The underlying API can change a Tophost record ID after an update. Always use the ID returned in the mutation result for subsequent operations.

Error handling

REST API application errors are converted into MCP tool errors with the stable error code and message returned by tophost-dns-api.

Raw HTML, response bodies, API keys and authentication material are not included in tool errors.

Development

ruff check src tests
pytest -q

REST API and Tophost protocol implementation:

https://github.com/DanielVd/tophost-dns-api

License

MIT. See LICENSE.

Available Tools

7 tools
create_dns_recordCreate DNS recordA
Idempotent

Create a DNS record. The underlying API treats an already-identical record as a no-op.

Inputs: name (required), value (required), domain (required), record_type (required), +1 more. Returns: after, before, changed, message, +1 more

delete_dns_recordDelete DNS recordA
Destructive

Delete a DNS record using mandatory expected_value and expected_priority optimistic-concurrency guards. Read the record first and pass the observed state.

Inputs: domain (required), record_id (required), expected_value (required), expected_priority (required). Returns: after, before, changed, message, +1 more

get_dns_recordGet DNS recordA
Read-onlyIdempotent

Read one DNS record by its current Tophost record ID.

Inputs: domain (required), record_id (required). Returns: id, name, type, value, +1 more

list_dns_recordsList DNS recordsB
Read-onlyIdempotent

List DNS records for one Tophost domain. Optional name, type and value filters can be combined.

Inputs: domain (required), name, value, record_type. Returns: result

list_domainsList Tophost domainsA
Read-onlyIdempotent

List domains discovered by the authenticated Tophost DNS API account.

Inputs: no named parameters. Returns: result

tophost_api_healthTophost DNS API healthA
Read-onlyIdempotent

Check whether the configured Tophost DNS REST API process is reachable.

Inputs: no named parameters. Returns: status

update_dns_recordUpdate DNS recordA
Destructive

Update a DNS record using expected_value and expected_priority as mandatory optimistic-concurrency guards. Read the record first and pass the observed state.

Inputs: domain (required), record_id (required), expected_value (required), expected_priority (required), +2 more. Returns: after, before, changed, message, +1 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a distinct action: health check, listing domains, listing/reading records, and create/update/delete operations. There is no overlap between list and get-by-ID, and update/delete are clearly separated by their optimistic-concurrency guards.

    Naming Consistency4/5

    Most tools follow a clear verb_noun snake_case pattern (list/get/create/update/delete). The health check tool uses a noun-style name with a vendor prefix, which is a minor deviation, but it does not create confusion.

    Tool Count5/5

    Seven tools is a well-scoped size for a DNS record management server: one health check, one domain enumeration tool, and a full record lifecycle. No tool feels redundant or superfluous.

    Completeness5/5

    The set covers the core DNS record lifecycle completely (list, get, create, update, delete) plus domain discovery and API health. There are no obvious missing operations for the stated purpose.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server implementation that allows AI agents to manage DNS records for domains hosted on Cloudflare by providing tools to list, create, update, and delete various types of DNS records.
      5
      70 npm
      3
      GPL 3.0
    • A
      license
      A
      quality
      B
      maintenance
      Official Porkbun MCP server, maintained by Porkbun. Check availability and pricing, register, renew and transfer domains, and manage DNS, nameservers, URL forwarding, glue, DNSSEC, DNS restore points, static hosting, webhooks and Cloudflare-connected domains. Hosted at mcp.porkbun.com/mcp with Porkbun sign-in (no API key), or run locally with npx @porkbunllc/mcp-server. Docs: porkbun.com/mcp
      154
      3,021 npm
      36
      MIT