dns-lookup-mcp-server

veminovici/dns-lookup-mcp-server

3.1

If you are the rightful owner of dns-lookup-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Rust-based Model Context Protocol (MCP) server that provides DNS lookup functionality using the Tokio async runtime.

DNS Lookup MCP Server

A Rust-based Model Context Protocol (MCP) server that provides DNS lookup functionality using the Tokio async runtime.

Resource

Features

  • DNS A record lookups (IPv4 addresses)
  • DNS AAAA record lookups (IPv6 addresses)
  • DNS CNAME record lookups
  • DNS MX record lookups (mail exchange)
  • DNS TXT record lookups
  • JSON-RPC 2.0 protocol support
  • Async/await with Tokio runtime
  • Structured logging with tracing

Building

cargo build --release

Running

cargo run

The server will start on 127.0.0.1:3000 and listen for JSON-RPC requests.

Usage

Initialize the server

Send a JSON-RPC request to initialize the MCP server:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {}
}

DNS Lookup

Send a DNS lookup request:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "dns/lookup",
  "params": {
    "domain": "example.com"
  }
}

Response Format

The server returns DNS records in the following format:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "domain": "example.com",
    "records": [
      {
        "record_type": "A",
        "value": "93.184.216.34",
        "ttl": 300
      },
      {
        "record_type": "AAAA",
        "value": "2606:2800:220:1:248:1893:25c8:1946",
        "ttl": 300
      }
    ]
  },
  "error": null
}

Supported Record Types

  • A: IPv4 addresses
  • AAAA: IPv6 addresses
  • CNAME: Canonical name records
  • MX: Mail exchange records
  • TXT: Text records

Dependencies

  • tokio: Async runtime
  • trust-dns-resolver: DNS resolution
  • serde: Serialization/deserialization
  • tracing: Structured logging
  • anyhow: Error handling