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: Gandi 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
valueYes
domainYes
priorityNo
record_typeYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
afterNo
beforeNo
changedYes
messageNo
dns_serialNo

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare idempotentHint=true, and the description's no-op statement aligns with that. It adds slight nuance by specifying that only an 'already-identical record' is a no-op, but it does not disclose other behavioral details like conflict behavior or prerequisites.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, front-loaded with the core action, and contains no filler. The second sentence adds useful idempotency nuance without bloating the text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter creation tool with no parameter descriptions, the definition is incomplete. The output schema covers return values, but the agent still lacks info about parameter formats, record type constraints, and domain existence requirements.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the description does not explain the 5 parameters. The phrase 'DNS record' gives general context, but it does not clarify fields like value, record_type, or priority for different DNS record types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Create') and resource ('DNS record'), and the sibling set includes list/get/update/delete operations, so this tool is unambiguous. The no-op clarification does not obscure the purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool: when a DNS record needs to be created. However, it does not explicitly contrast with update_dns_record or say when NOT to use it, such as when modifying an existing record.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
domainYes
record_idYes
expected_valueYes
expected_priorityYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
afterNo
beforeNo
changedYes
messageNo
dns_serialNo

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark the tool as destructive and non-read-only. The description adds meaningful behavioral context by disclosing mandatory optimistic-concurrency guards and the read-before-delete workflow, which helps the agent avoid failed or stale deletions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tightly packed sentences: the first names the operation and its defining guard requirement, the second gives the necessary precondition. No filler or redundant restatement.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the essential precondition and the meaning of the required parameters for a destructive 4-parameter operation, while the output schema handles return-value expectations. It could be slightly stronger by naming get_dns_record as the read step, but it is still complete enough for correct use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates by explaining that expected_value and expected_priority are observed-state guards rather than arbitrary values. Domain and record_id remain self-explanatory from their names, but are not explicitly described; the critical guard semantics are well covered.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action and resource: 'Delete a DNS record'. This directly distinguishes it from the sibling list/get/create/update operations, and the additional guard details clarify what form of delete this tool performs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear operational context: callers must read the record first and supply the observed state as expected_value and expected_priority. It does not explicitly name alternative tools or exclusions, but the precondition and invocation guidance are unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_dns_recordGet DNS recordA
Read-onlyIdempotent

Read one DNS record by its current Tophost record ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
domainYes
record_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
idYes
nameYes
typeYes
valueYes
priorityNo

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, openWorldHint, and idempotentHint, so the description does not need to restate safety. It adds the useful detail that the record ID is the current Tophost ID, but it does not describe not-found behavior or any other edge cases. This is consistent with the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence with no redundant wording. It states the action, the target, and the identifying mechanism without waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation with two required parameters, an output schema, and annotation-covered safety, the description is nearly complete. The only minor gap is not explicitly connecting to list_dns_records as the way to obtain the record ID, but that is not required for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description needed to explain both parameters. It partially does this by clarifying that record_id is the current Tophost record ID, but it leaves the domain parameter completely to inference.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Read'), a specific resource ('one DNS record'), and the key identifier ('current Tophost record ID'). This clearly distinguishes it from list_dns_records, which would return multiple records.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'one DNS record' implies this is for a targeted lookup when the record ID is known, but it does not explicitly name alternatives or state when not to use this tool. Context from sibling names helps, but the description itself leaves the routing implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_dns_recordsList DNS recordsB
Read-onlyIdempotent

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

ParametersJSON Schema
NameRequiredDescriptionDefault
nameNo
valueNo
domainYes
record_typeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true, so the description doesn't need to repeat safety. It adds that filters can be combined and that it targets a single domain, which is useful. However, it does not disclose potential behavioral nuances like pagination, result limits, or whether the filter is exact match or substring.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no redundancy. The primary action and scope are front-loaded, and the optional filters are stated in one compact sentence. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return format doesn't need explanation. Annotations cover safety. The description covers scope and filters adequately for a basic listing tool. However, it leaves gaps: it doesn't clarify the filter parameter names (especially 'type' vs 'record_type'), doesn't mention any limits or pagination, and doesn't specify whether multiple domains can be queried at once (though 'one' suggests not). For a simple tool it's passable but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema description coverage at 0%, the description must compensate, but it only mentions 'name, type and value' while the schema uses 'record_type' instead of 'type'. This mismatch could confuse. It does not explain the meaning of each filter (e.g., whether 'name' is a hostname prefix, whether 'value' is IP address, etc.), nor any constraints on combining them. It adds minimal value beyond the schema itself.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List'), the resource ('DNS records'), and the scope ('for one Tophost domain'). It is specific enough to distinguish from list_domains (which lists domains) and get_dns_record (which likely fetches a single record), though it does not explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus sibling tools. It does not mention that it lists all records for a domain while get_dns_record fetches a specific one, or that create/update/delete are for modifications. The only usage note is that filters can be combined, which relates to parameters rather than tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_domainsList Tophost domainsA
Read-onlyIdempotent

List domains discovered by the authenticated Tophost DNS API account.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=true, so the safety profile is covered. The description adds the 'discovered by the authenticated account' scope, which is useful context beyond the annotations. No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence, front-loaded with the action and resource, no wasted words. It earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter read-only list tool with an output schema and safety annotations, the description is nearly complete. It could mention that it returns all discovered domains, but the output schema likely covers that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so the schema is trivially complete. The description adds the meaning of the result scope (domains discovered by the authenticated account), which is the only semantic context needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('List') and resource ('domains discovered by the authenticated Tophost DNS API account'). It clearly distinguishes from sibling tools that operate on DNS records, though it doesn't explicitly name a sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context: it lists domains from the authenticated account, which is distinct from record-level tools. However, it doesn't explicitly state when to use this tool versus alternatives or mention any exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

tophost_api_healthTophost DNS API healthA
Read-onlyIdempotent

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
statusYes

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, openWorldHint, and idempotentHint, covering the operation's safety profile. The description adds that it checks reachability of a configured process, which is helpful but does not elaborate on response or failure behavior; the output schema likely covers that.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, direct sentence that front-loads the core action ('Check whether') and specifies the target resource. No filler, no repetition of the title or schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter, read-only health check with output schema and safety annotations, the description provides all necessary context. An agent can confidently invoke it without additional guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the description does not need to explain parameter semantics. The baseline of 4 applies because there is no parameter burden for the agent to interpret.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('check') and a clear resource ('configured Tophost DNS REST API process'), stating exactly what the tool does. It clearly reads as a health-check operation and is distinct from the CRUD operations of its siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose is self-evident: verify API reachability before or alongside DNS operations. It does not explicitly name alternatives or exclusions, but with no parameters and a dedicated health-check scope, the intended usage context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
valueNo
domainYes
priorityNo
record_idYes
expected_valueYes
expected_priorityYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
afterNo
beforeNo
changedYes
messageNo
dns_serialNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description discloses an important behavioral detail: the update is guarded by optimistic concurrency, so stale observed state will not silently overwrite changes. It also warns that the guard is mandatory, which is useful operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences, with the core action and concurrency constraint front-loaded, followed by the required workflow. No filler or redundant restatement of the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Annotations and output schema cover safety and return expectations, and the description covers the key precondition and guard behavior. However, the parameter documentation gap and lack of explicit sibling alternatives leave the definition less than fully self-contained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate for parameter meaning, but it only explains expected_value and expected_priority as guards. It does not clarify domain, record_id, value, or priority, leaving the agent to infer their roles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Update') and resource ('DNS record'), and adds a distinguishing mechanism: mandatory optimistic-concurrency guards via expected_value and expected_priority. This clearly separates it from create/delete/list/get siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit precondition: read the record first and pass the observed state. It does not explicitly name sibling tools like get_dns_record as the read step, but the workflow implication is clear enough for an agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 7 tool updatesv0.1.0
    • First observedcreate_dns_record
    • First observeddelete_dns_record
    • First observedget_dns_record
    • First observedlist_dns_records
    • First observedlist_domains
    • First observedtophost_api_health
    • First observedupdate_dns_record

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    F
    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
    362 npm
    3
    GPL 3.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage Gandi domains and LiveDNS records directly via the Gandi API v5. It supports comprehensive domain management operations and full CRUD functionality for various DNS record types.
    3
    MIT