Skip to main content

MCP Server for checking domain name availability using WHOIS and DNS.

Project description

FastDomainCheck MCP Server (Python)

This is a domain availability check server implemented using Python and the Model Context Protocol (MCP). It provides MCP Tools to check if single or multiple domain names are already registered.

This project aims to provide the same functionality as the Go language implementation located in the go-version directory.

Features

  • Check domain registration status via MCP Tool interface.
  • Supports checking single domains.
  • Supports batch checking multiple domains.
  • Uses the python-whois library for WHOIS lookups and socket for DNS lookups as a fallback/confirmation.

Dependencies

  • Python 3.8+
  • mcp[cli] (Model Context Protocol SDK and command-line tool)
  • python-whois (For performing WHOIS queries)

Installation

It is recommended to use a Python virtual environment.

  1. Clone the repository (if you haven't already):

    git clone <your-repo-url>
    cd FastDomainCheck-MCP-Server-python
    
  2. Create and activate a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # Linux/macOS
    # venv\Scripts\activate  # Windows
    
  3. Install dependencies (using uv or pip): Using uv:

    # Ensure uv is installed: pip install uv
    uv pip install -r requirements.txt
    # Or, if you don't have requirements.txt yet, add individually:
    # uv pip install "mcp[cli]" python-whois
    

    Using pip:

    pip install -r requirements.txt
    # Or, if you don't have requirements.txt yet, add individually:
    # pip install "mcp[cli]" python-whois
    

    (Generate requirements.txt using uv pip freeze > requirements.txt or pip freeze > requirements.txt after installing dependencies)

Running the Server

There are multiple ways to run the server:

  1. Using the MCP Runner (Recommended for development):

    mcp run server.py
    
  2. Directly using Python (if uvicorn is installed):

    python server.py
    
  3. Using the installed script (After installing the package): First, install the package locally:

    # Using uv
    uv pip install .
    # Or using pip
    # pip install .
    

    Then, run the command:

    fastdomaincheck-server
    
  4. Using uvx (Executes the package in an isolated environment):

    uvx fastdomaincheck-mcp-server
    

The server will listen for MCP connections on http://127.0.0.1:8000 by default when run with uvicorn (methods 2, 3, 4).

Usage (MCP Tools)

When the server is running, MCP-compatible clients can connect and invoke the following tools:

1. check_domain

Checks the availability of a single domain.

  • Arguments:
    • domain (str): The domain name to check (e.g., "google.com").
  • Returns: (str)
    • "available": The domain is available for registration.
    • "registered": The domain is already registered.
    • "error: <reason>": An error occurred during the query.

2. check_domains

Checks the availability of multiple domains in batch.

  • Arguments:
    • domains (list[str]): A list of domain names to check (e.g., ["google.com", "availabledomain123.org"]).
  • Returns: (dict[str, str])
    • A dictionary where keys are domain names and values are their status ("available", "registered", or "error: <reason>").
    • Example: {"google.com": "registered", "availabledomain123.org": "available"}

Running Tests

To run the unit tests, execute the following command in the project root directory:

python -m unittest discover tests

Or run the specific test file:

python -m unittest tests/test_checker.py

Go Version Reference

This project's functionality is intended to match the Go language implementation located in the go-version directory.

Contributing

Feel free to open issues or submit pull requests.

License

MIT License (You should add a LICENSE file, typically containing the MIT license text)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastdomaincheck_mcp_server-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastdomaincheck_mcp_server-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file fastdomaincheck_mcp_server-0.1.0.tar.gz.

File metadata

File hashes

Hashes for fastdomaincheck_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ec0325defc83443ff25ce6d34a4790b1feea776e4842bba55a762cd99dc0f8b5
MD5 20af70380880d2f01e8a3b72ea4f58b6
BLAKE2b-256 179e9b80471543d4e20c5835c3e46147f1bf53cf070886ebb05ba73ed8808f49

See more details on using hashes here.

File details

Details for the file fastdomaincheck_mcp_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastdomaincheck_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e9b106869d91a8d7a5fe6f2bf13a2c78aec530069b9d479c160ad2fa9a50220
MD5 f770f92d3f299ac064b17c63aa0480ab
BLAKE2b-256 5e4c243070a684285778cb6a62f17f5b5b70651488371caad7a360252741882b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page