Refactor package name from vultr-dns-mcp to mcp-vultr
Some checks are pending
Tests / test (3.10) (push) Waiting to run
Tests / test (3.11) (push) Waiting to run
Tests / test (3.12) (push) Waiting to run
Tests / test (3.13) (push) Waiting to run
Tests / build (push) Blocked by required conditions
Tests / test-install (3.10) (push) Blocked by required conditions
Tests / test-install (3.13) (push) Blocked by required conditions
Tests / security (push) Waiting to run

- Rename package from vultr-dns-mcp to mcp-vultr for MCP organization
- Update module name from vultr_dns_mcp to mcp_vultr throughout codebase
- Rename src/vultr_dns_mcp/ to src/mcp_vultr/
- Update all import statements and references in Python files
- Update documentation files (README.md, CLAUDE.md, etc.)
- Update CLI script names in pyproject.toml
- Update test files with new import paths

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ryan Malloy 2025-07-16 21:49:38 -06:00
parent 2d866d275d
commit e6f66dc931
27 changed files with 165 additions and 165 deletions

View File

@ -1,6 +1,6 @@
# Building and Publishing to PyPI # Building and Publishing to PyPI
This document provides instructions for building and publishing the `vultr-dns-mcp` package to PyPI. This document provides instructions for building and publishing the `mcp-vultr` package to PyPI.
## Prerequisites ## Prerequisites
@ -43,8 +43,8 @@ This document provides instructions for building and publishing the `vultr-dns-m
``` ```
This creates: This creates:
- `dist/vultr_dns_mcp-1.0.0-py3-none-any.whl` (wheel) - `dist/mcp_vultr-1.0.0-py3-none-any.whl` (wheel)
- `dist/vultr-dns-mcp-1.0.0.tar.gz` (source distribution) - `dist/mcp-vultr-1.0.0.tar.gz` (source distribution)
3. **Verify the build:** 3. **Verify the build:**
```bash ```bash
@ -60,13 +60,13 @@ This document provides instructions for building and publishing the `vultr-dns-m
2. **Test installation from TestPyPI:** 2. **Test installation from TestPyPI:**
```bash ```bash
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple vultr-dns-mcp pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mcp-vultr
``` ```
3. **Test functionality:** 3. **Test functionality:**
```bash ```bash
vultr-dns-mcp --help mcp-vultr --help
python -c "from vultr_dns_mcp import VultrDNSClient; print('Import successful')" python -c "from mcp_vultr import VultrDNSClient; print('Import successful')"
``` ```
## Publishing to PyPI ## Publishing to PyPI
@ -77,8 +77,8 @@ This document provides instructions for building and publishing the `vultr-dns-m
``` ```
2. **Verify publication:** 2. **Verify publication:**
- Check the package page: https://pypi.org/project/vultr-dns-mcp/ - Check the package page: https://pypi.org/project/mcp-vultr/
- Test installation: `pip install vultr-dns-mcp` - Test installation: `pip install mcp-vultr`
## Version Management ## Version Management

View File

@ -11,22 +11,22 @@ This package provides both an MCP server and a standalone Python client for Vult
### Installation ### Installation
```bash ```bash
# Using uv (recommended) # Using uv (recommended)
uv add vultr-dns-mcp uv add mcp-vultr
# Or using pip # Or using pip
pip install vultr-dns-mcp pip install mcp-vultr
``` ```
### Basic Usage ### Basic Usage
```bash ```bash
# CLI - requires VULTR_API_KEY environment variable # CLI - requires VULTR_API_KEY environment variable
vultr-dns-mcp domains list mcp-vultr domains list
vultr-dns-mcp records list example.com mcp-vultr records list example.com
# As MCP server # As MCP server
vultr-mcp-server vultr-mcp-server
# or using Python module # or using Python module
python -m vultr_dns_mcp python -m mcp_vultr
``` ```
## Development Setup ## Development Setup
@ -51,7 +51,7 @@ uv run pytest -m mcp
uv run pytest -m integration uv run pytest -m integration
# With coverage # With coverage
uv run pytest --cov=vultr_dns_mcp --cov-report=html uv run pytest --cov=mcp_vultr --cov-report=html
# Comprehensive test runner # Comprehensive test runner
uv run python run_tests.py --all-checks uv run python run_tests.py --all-checks
@ -116,8 +116,8 @@ Following FastMCP testing best practices:
## Project Structure ## Project Structure
``` ```
vultr-dns-mcp/ mcp-vultr/
├── src/vultr_dns_mcp/ ├── src/mcp_vultr/
│ ├── __init__.py # Package initialization with exports │ ├── __init__.py # Package initialization with exports
│ ├── __main__.py # Module entry point for python -m │ ├── __main__.py # Module entry point for python -m
│ ├── client.py # High-level DNS client │ ├── client.py # High-level DNS client
@ -252,18 +252,18 @@ uv run pytest tests/test_mcp_server.py::TestMCPTools::test_list_dns_domains_tool
uv run pytest --collect-only tests/ uv run pytest --collect-only tests/
# Validate imports # Validate imports
uv run python -c "from vultr_dns_mcp.server import create_mcp_server" uv run python -c "from mcp_vultr.server import create_mcp_server"
# Traditional approach # Traditional approach
pytest tests/test_mcp_server.py::TestMCPTools::test_list_dns_domains_tool -vvv pytest tests/test_mcp_server.py::TestMCPTools::test_list_dns_domains_tool -vvv
pytest --collect-only tests/ pytest --collect-only tests/
python -c "from vultr_dns_mcp.server import create_mcp_server" python -c "from mcp_vultr.server import create_mcp_server"
``` ```
## Claude Desktop Integration ## Claude Desktop Integration
### Quick Setup ### Quick Setup
1. Install the package: `pip install vultr-dns-mcp` 1. Install the package: `pip install mcp-vultr`
2. Add to Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS): 2. Add to Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
```json ```json
{ {
@ -284,7 +284,7 @@ For detailed setup instructions, see `CLAUDE_DESKTOP_SETUP.md`.
## Support & Documentation ## Support & Documentation
- **GitHub**: https://github.com/rsp2k/vultr-dns-mcp - **GitHub**: https://github.com/rsp2k/mcp-vultr
- **PyPI**: https://pypi.org/project/vultr-dns-mcp/ - **PyPI**: https://pypi.org/project/mcp-vultr/
- **Documentation**: Complete API documentation and examples in package - **Documentation**: Complete API documentation and examples in package
- **Issues**: Use GitHub Issues for bug reports and feature requests - **Issues**: Use GitHub Issues for bug reports and feature requests

View File

@ -12,7 +12,7 @@ This guide shows how to set up and test the Vultr DNS MCP package locally with C
### Option 1: Install from PyPI (Recommended) ### Option 1: Install from PyPI (Recommended)
```bash ```bash
pip install vultr-dns-mcp pip install mcp-vultr
``` ```
### Option 2: Install from Local Development ### Option 2: Install from Local Development
@ -23,7 +23,7 @@ pip install -e .
### Option 3: Using uv (Fastest) ### Option 3: Using uv (Fastest)
```bash ```bash
uv add vultr-dns-mcp uv add mcp-vultr
``` ```
## Claude Desktop Configuration ## Claude Desktop Configuration
@ -61,7 +61,7 @@ Add this to your `claude_desktop_config.json`:
"mcpServers": { "mcpServers": {
"vultr-dns": { "vultr-dns": {
"command": "python", "command": "python",
"args": ["-m", "vultr_dns_mcp"], "args": ["-m", "mcp_vultr"],
"env": { "env": {
"VULTR_API_KEY": "YOUR_VULTR_API_KEY_HERE" "VULTR_API_KEY": "YOUR_VULTR_API_KEY_HERE"
} }
@ -96,7 +96,7 @@ This approach uses `uvx` to automatically install and run the package without ne
"vultr-dns": { "vultr-dns": {
"command": "uvx", "command": "uvx",
"args": [ "args": [
"--from", "vultr-dns-mcp", "--from", "mcp-vultr",
"vultr-mcp-server" "vultr-mcp-server"
], ],
"env": { "env": {
@ -117,7 +117,7 @@ For TestPyPI version:
"--index-url", "https://test.pypi.org/simple/", "--index-url", "https://test.pypi.org/simple/",
"--extra-index-url", "https://pypi.org/simple/", "--extra-index-url", "https://pypi.org/simple/",
"--index-strategy", "unsafe-best-match", "--index-strategy", "unsafe-best-match",
"--from", "vultr-dns-mcp==1.0.1", "--from", "mcp-vultr==1.0.1",
"vultr-mcp-server" "vultr-mcp-server"
], ],
"env": { "env": {
@ -137,7 +137,7 @@ If you have issues, use the absolute path to your Python installation:
"mcpServers": { "mcpServers": {
"vultr-dns": { "vultr-dns": {
"command": "/usr/bin/python3", "command": "/usr/bin/python3",
"args": ["-m", "vultr_dns_mcp"], "args": ["-m", "mcp_vultr"],
"env": { "env": {
"VULTR_API_KEY": "YOUR_VULTR_API_KEY_HERE" "VULTR_API_KEY": "YOUR_VULTR_API_KEY_HERE"
} }
@ -203,7 +203,7 @@ The server provides these tools that Claude Desktop can use:
1. **Check Python installation**: 1. **Check Python installation**:
```bash ```bash
python -c "import vultr_dns_mcp; print('✅ Package installed')" python -c "import mcp_vultr; print('✅ Package installed')"
``` ```
2. **Test server manually**: 2. **Test server manually**:
@ -211,14 +211,14 @@ The server provides these tools that Claude Desktop can use:
export VULTR_API_KEY="your-key" export VULTR_API_KEY="your-key"
vultr-mcp-server vultr-mcp-server
# or # or
python -m vultr_dns_mcp python -m mcp_vultr
``` ```
3. **Check API key**: 3. **Check API key**:
```bash ```bash
export VULTR_API_KEY="your-key" export VULTR_API_KEY="your-key"
python -c " python -c "
from vultr_dns_mcp.client import VultrDNSClient from mcp_vultr.client import VultrDNSClient
import asyncio import asyncio
async def test(): async def test():
client = VultrDNSClient() client = VultrDNSClient()
@ -245,7 +245,7 @@ If Claude Desktop can't find Python:
"mcpServers": { "mcpServers": {
"vultr-dns": { "vultr-dns": {
"command": "/full/path/to/python3", "command": "/full/path/to/python3",
"args": ["-m", "vultr_dns_mcp"], "args": ["-m", "mcp_vultr"],
"env": { "env": {
"VULTR_API_KEY": "YOUR_KEY" "VULTR_API_KEY": "YOUR_KEY"
} }

View File

@ -1,6 +1,6 @@
# PyPI Publishing Setup Guide # PyPI Publishing Setup Guide
This guide explains how to set up and use the automated PyPI publishing workflow for the `vultr-dns-mcp` package. This guide explains how to set up and use the automated PyPI publishing workflow for the `mcp-vultr` package.
## 🔐 Setting Up Trusted Publishing (Recommended) ## 🔐 Setting Up Trusted Publishing (Recommended)
@ -8,29 +8,29 @@ The workflow uses [PyPI's trusted publishing](https://docs.pypi.org/trusted-publ
### For PyPI (Production) ### For PyPI (Production)
1. **Go to your project on PyPI**: https://pypi.org/manage/project/vultr-dns-mcp/ 1. **Go to your project on PyPI**: https://pypi.org/manage/project/mcp-vultr/
2. **Navigate to "Publishing"** tab 2. **Navigate to "Publishing"** tab
3. **Add a new trusted publisher** with these settings: 3. **Add a new trusted publisher** with these settings:
- **PyPI Project Name**: `vultr-dns-mcp` - **PyPI Project Name**: `mcp-vultr`
- **Owner**: `rsp2k` - **Owner**: `rsp2k`
- **Repository name**: `vultr-dns-mcp` - **Repository name**: `mcp-vultr`
- **Workflow filename**: `publish.yml` - **Workflow filename**: `publish.yml`
- **Environment name**: `pypi` - **Environment name**: `pypi`
### For TestPyPI (Testing) ### For TestPyPI (Testing)
1. **Go to TestPyPI**: https://test.pypi.org/manage/project/vultr-dns-mcp/ 1. **Go to TestPyPI**: https://test.pypi.org/manage/project/mcp-vultr/
2. **Navigate to "Publishing"** tab 2. **Navigate to "Publishing"** tab
3. **Add a new trusted publisher** with these settings: 3. **Add a new trusted publisher** with these settings:
- **PyPI Project Name**: `vultr-dns-mcp` - **PyPI Project Name**: `mcp-vultr`
- **Owner**: `rsp2k` - **Owner**: `rsp2k`
- **Repository name**: `vultr-dns-mcp` - **Repository name**: `mcp-vultr`
- **Workflow filename**: `publish.yml` - **Workflow filename**: `publish.yml`
- **Environment name**: `testpypi` - **Environment name**: `testpypi`
### GitHub Environment Setup ### GitHub Environment Setup
1. **Go to your repository settings**: https://github.com/rsp2k/vultr-dns-mcp/settings/environments 1. **Go to your repository settings**: https://github.com/rsp2k/mcp-vultr/settings/environments
2. **Create two environments**: 2. **Create two environments**:
- `pypi` (for production releases) - `pypi` (for production releases)
- `testpypi` (for testing) - `testpypi` (for testing)
@ -43,7 +43,7 @@ The workflow uses [PyPI's trusted publishing](https://docs.pypi.org/trusted-publ
1. **Update the version** in `pyproject.toml`: 1. **Update the version** in `pyproject.toml`:
```toml ```toml
[project] [project]
name = "vultr-dns-mcp" name = "mcp-vultr"
version = "1.0.2" # Increment this version = "1.0.2" # Increment this
``` ```
@ -185,9 +185,9 @@ python -m twine check dist/*
## 📊 Monitoring ## 📊 Monitoring
After publishing, monitor: After publishing, monitor:
- **PyPI downloads**: https://pypistats.org/packages/vultr-dns-mcp - **PyPI downloads**: https://pypistats.org/packages/mcp-vultr
- **GitHub releases**: https://github.com/rsp2k/vultr-dns-mcp/releases - **GitHub releases**: https://github.com/rsp2k/mcp-vultr/releases
- **Actions logs**: https://github.com/rsp2k/vultr-dns-mcp/actions - **Actions logs**: https://github.com/rsp2k/mcp-vultr/actions
## 🎯 Next Steps ## 🎯 Next Steps

View File

@ -22,10 +22,10 @@ A comprehensive Model Context Protocol (MCP) server for managing Vultr DNS recor
```bash ```bash
# Using uv (recommended - fast and modern) # Using uv (recommended - fast and modern)
uv add vultr-dns-mcp uv add mcp-vultr
# Or using pip # Or using pip
pip install vultr-dns-mcp pip install mcp-vultr
``` ```
### Basic Usage ### Basic Usage
@ -35,23 +35,23 @@ pip install vultr-dns-mcp
export VULTR_API_KEY="your-api-key" export VULTR_API_KEY="your-api-key"
# List domains # List domains
vultr-dns-mcp domains list mcp-vultr domains list
# List DNS records # List DNS records
vultr-dns-mcp records list example.com mcp-vultr records list example.com
# Set up basic website DNS # Set up basic website DNS
vultr-dns-mcp setup-website example.com 192.168.1.100 mcp-vultr setup-website example.com 192.168.1.100
# Run as MCP server # Run as MCP server
uv run python -m vultr_dns_mcp.server uv run python -m mcp_vultr.server
``` ```
### Python API ### Python API
```python ```python
import asyncio import asyncio
from vultr_dns_mcp import VultrDNSClient from mcp_vultr import VultrDNSClient
async def main(): async def main():
client = VultrDNSClient("your-api-key") client = VultrDNSClient("your-api-key")
@ -75,7 +75,7 @@ asyncio.run(main())
This package provides a complete MCP server that can be integrated with MCP-compatible clients: This package provides a complete MCP server that can be integrated with MCP-compatible clients:
```python ```python
from vultr_dns_mcp import create_mcp_server, run_server from mcp_vultr import create_mcp_server, run_server
# Create server # Create server
server = create_mcp_server("your-api-key") server = create_mcp_server("your-api-key")
@ -96,8 +96,8 @@ await run_server("your-api-key")
```bash ```bash
# Clone the repository # Clone the repository
git clone https://github.com/rsp2k/vultr-dns-mcp.git git clone https://github.com/rsp2k/mcp-vultr.git
cd vultr-dns-mcp cd mcp-vultr
# Install dependencies # Install dependencies
uv sync --extra dev uv sync --extra dev
@ -153,21 +153,21 @@ python run_tests.py --all-checks
```bash ```bash
# Domain management # Domain management
vultr-dns-mcp domains list mcp-vultr domains list
vultr-dns-mcp domains info example.com mcp-vultr domains info example.com
vultr-dns-mcp domains create newdomain.com 192.168.1.100 mcp-vultr domains create newdomain.com 192.168.1.100
# Record management # Record management
vultr-dns-mcp records list example.com mcp-vultr records list example.com
vultr-dns-mcp records add example.com A www 192.168.1.100 mcp-vultr records add example.com A www 192.168.1.100
vultr-dns-mcp records delete example.com record-id mcp-vultr records delete example.com record-id
# Setup utilities # Setup utilities
vultr-dns-mcp setup-website example.com 192.168.1.100 mcp-vultr setup-website example.com 192.168.1.100
vultr-dns-mcp setup-email example.com mail.example.com mcp-vultr setup-email example.com mail.example.com
# Start MCP server # Start MCP server
vultr-dns-mcp server mcp-vultr server
``` ```
## Testing ## Testing
@ -184,7 +184,7 @@ uv run pytest -m integration # Integration tests
uv run pytest -m mcp # MCP-specific tests uv run pytest -m mcp # MCP-specific tests
# With coverage # With coverage
uv run pytest --cov=vultr_dns_mcp --cov-report=html uv run pytest --cov=mcp_vultr --cov-report=html
# Full validation suite # Full validation suite
uv run python run_tests.py --all-checks uv run python run_tests.py --all-checks
@ -205,7 +205,7 @@ uv run python run_tests.py --all-checks
The package provides specific exception types for better error handling: The package provides specific exception types for better error handling:
```python ```python
from vultr_dns_mcp import ( from mcp_vultr import (
VultrAPIError, VultrAPIError,
VultrAuthError, VultrAuthError,
VultrRateLimitError, VultrRateLimitError,
@ -246,8 +246,8 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
## Links ## Links
- [GitHub Repository](https://github.com/rsp2k/vultr-dns-mcp) - [GitHub Repository](https://github.com/rsp2k/mcp-vultr)
- [PyPI Package](https://pypi.org/project/vultr-dns-mcp/) - [PyPI Package](https://pypi.org/project/mcp-vultr/)
- [Vultr API Documentation](https://www.vultr.com/api/) - [Vultr API Documentation](https://www.vultr.com/api/)
- [Model Context Protocol](https://modelcontextprotocol.io/) - [Model Context Protocol](https://modelcontextprotocol.io/)
- [uv Package Manager](https://docs.astral.sh/uv/) - [uv Package Manager](https://docs.astral.sh/uv/)

View File

@ -116,7 +116,7 @@ uv run pytest -m mcp
uv run pytest -m "not slow" uv run pytest -m "not slow"
# With coverage # With coverage
uv run pytest --cov=vultr_dns_mcp --cov-report=html uv run pytest --cov=mcp_vultr --cov-report=html
``` ```
### Using the test runner: ### Using the test runner:
@ -163,7 +163,7 @@ testpaths = ["tests"]
addopts = [ addopts = [
"--strict-markers", "--strict-markers",
"--verbose", "--verbose",
"--cov=vultr_dns_mcp", "--cov=mcp_vultr",
"--cov-fail-under=80" "--cov-fail-under=80"
] ]
asyncio_mode = "auto" asyncio_mode = "auto"

View File

@ -11,7 +11,7 @@ This script demonstrates various ways to use the package:
import asyncio import asyncio
import os import os
from vultr_dns_mcp import VultrDNSClient, VultrDNSServer, create_mcp_server from mcp_vultr import VultrDNSClient, VultrDNSServer, create_mcp_server
async def client_example(): async def client_example():
@ -82,7 +82,7 @@ async def validation_example():
print("=" * 40) print("=" * 40)
# Import the validation from the server module # Import the validation from the server module
from vultr_dns_mcp.server import create_mcp_server from mcp_vultr.server import create_mcp_server
# Create a test server instance for validation (won't make API calls) # Create a test server instance for validation (won't make API calls)
try: try:

View File

@ -3,7 +3,7 @@ requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[project] [project]
name = "vultr-dns-mcp" name = "mcp-vultr"
version = "1.1.0" version = "1.1.0"
description = "A comprehensive Model Context Protocol (MCP) server for managing Vultr DNS records" description = "A comprehensive Model Context Protocol (MCP) server for managing Vultr DNS records"
readme = "README.md" readme = "README.md"
@ -80,15 +80,15 @@ Repository = "https://github.com/rsp2k/vultr-dns-mcp.git"
Changelog = "https://github.com/rsp2k/vultr-dns-mcp/blob/main/CHANGELOG.md" Changelog = "https://github.com/rsp2k/vultr-dns-mcp/blob/main/CHANGELOG.md"
[project.scripts] [project.scripts]
vultr-dns-mcp = "vultr_dns_mcp.cli:main" mcp-vultr = "mcp_vultr.cli:main"
vultr-dns-server = "vultr_dns_mcp.cli:server_command" vultr-dns-server = "mcp_vultr.cli:server_command"
vultr-mcp-server = "vultr_dns_mcp.fastmcp_server:run_server" vultr-mcp-server = "mcp_vultr.fastmcp_server:run_server"
[tool.setuptools.packages.find] [tool.setuptools.packages.find]
where = ["src"] where = ["src"]
[tool.setuptools.package-data] [tool.setuptools.package-data]
vultr_dns_mcp = ["py.typed"] mcp_vultr = ["py.typed"]
[tool.black] [tool.black]
line-length = 88 line-length = 88
@ -112,7 +112,7 @@ extend-exclude = '''
profile = "black" profile = "black"
multi_line_output = 3 multi_line_output = 3
line_length = 88 line_length = 88
known_first_party = ["vultr_dns_mcp"] known_first_party = ["mcp_vultr"]
[tool.mypy] [tool.mypy]
python_version = "3.10" python_version = "3.10"
@ -163,7 +163,7 @@ filterwarnings = [
] ]
[tool.coverage.run] [tool.coverage.run]
source = ["src/vultr_dns_mcp"] source = ["src/mcp_vultr"]
omit = [ omit = [
"*/tests/*", "*/tests/*",
"*/test_*", "*/test_*",

View File

@ -29,7 +29,7 @@ def run_tests(test_type="all", verbose=False, coverage=False, fast=False):
# Add coverage if requested # Add coverage if requested
if coverage: if coverage:
cmd.extend(["--cov=vultr_dns_mcp", "--cov-report=term-missing", "--cov-report=html"]) cmd.extend(["--cov=mcp_vultr", "--cov-report=term-missing", "--cov-report=html"])
# Select tests based on type # Select tests based on type
if test_type == "unit": if test_type == "unit":
@ -130,8 +130,8 @@ def run_package_validation():
sys.path.insert(0, str(src_path)) sys.path.insert(0, str(src_path))
# Test main imports # Test main imports
from vultr_dns_mcp import VultrDNSClient, VultrDNSServer, create_mcp_server from mcp_vultr import VultrDNSClient, VultrDNSServer, create_mcp_server
from vultr_dns_mcp._version import __version__ from mcp_vultr._version import __version__
print(f" ✅ Package imports successful (version {__version__})") print(f" ✅ Package imports successful (version {__version__})")

View File

@ -6,7 +6,7 @@ the Vultr API. It includes tools for domain management, DNS record operations,
configuration analysis, and validation. configuration analysis, and validation.
Example usage: Example usage:
from vultr_dns_mcp import VultrDNSServer, create_mcp_server from mcp_vultr import VultrDNSServer, create_mcp_server
# Create a server instance # Create a server instance
server = VultrDNSServer(api_key="your-api-key") server = VultrDNSServer(api_key="your-api-key")

View File

@ -3,7 +3,7 @@
Version synchronization script for vultr-dns-mcp. Version synchronization script for vultr-dns-mcp.
This script ensures that the version number in pyproject.toml This script ensures that the version number in pyproject.toml
and src/vultr_dns_mcp/_version.py are kept in sync. and src/mcp_vultr/_version.py are kept in sync.
Usage: Usage:
python sync_version.py # Check if versions are in sync python sync_version.py # Check if versions are in sync
@ -40,9 +40,9 @@ def get_version_from_pyproject() -> str:
def get_version_from_version_py() -> str: def get_version_from_version_py() -> str:
"""Get version from _version.py.""" """Get version from _version.py."""
version_path = Path("src/vultr_dns_mcp/_version.py") version_path = Path("src/mcp_vultr/_version.py")
if not version_path.exists(): if not version_path.exists():
raise FileNotFoundError("src/vultr_dns_mcp/_version.py not found") raise FileNotFoundError("src/mcp_vultr/_version.py not found")
with open(version_path, "r") as f: with open(version_path, "r") as f:
content = f.read() content = f.read()
@ -56,7 +56,7 @@ def get_version_from_version_py() -> str:
def update_version_py(new_version: str) -> None: def update_version_py(new_version: str) -> None:
"""Update version in _version.py.""" """Update version in _version.py."""
version_path = Path("src/vultr_dns_mcp/_version.py") version_path = Path("src/mcp_vultr/_version.py")
content = f'''"""Version information for vultr-dns-mcp package.""" content = f'''"""Version information for vultr-dns-mcp package."""

View File

@ -2,7 +2,7 @@
"""Test our improvements to the Vultr DNS MCP package.""" """Test our improvements to the Vultr DNS MCP package."""
import ipaddress import ipaddress
from vultr_dns_mcp.server import ( from mcp_vultr.server import (
VultrAPIError, VultrAPIError,
VultrAuthError, VultrAuthError,
VultrRateLimitError, VultrRateLimitError,
@ -79,7 +79,7 @@ def test_mcp_server_creation():
print("🧪 Testing MCP Server Creation:") print("🧪 Testing MCP Server Creation:")
try: try:
from vultr_dns_mcp.server import create_mcp_server from mcp_vultr.server import create_mcp_server
# This should fail without API key (expected) # This should fail without API key (expected)
try: try:

View File

@ -1 +1 @@
"""Tests for vultr_dns_mcp package.""" """Tests for mcp_vultr package."""

View File

@ -3,7 +3,7 @@
import os import os
import pytest import pytest
from unittest.mock import AsyncMock, MagicMock from unittest.mock import AsyncMock, MagicMock
from vultr_dns_mcp.server import create_mcp_server from mcp_vultr.server import create_mcp_server
@pytest.fixture @pytest.fixture
@ -21,7 +21,7 @@ def mcp_server(mock_api_key):
@pytest.fixture @pytest.fixture
def mock_vultr_client(): def mock_vultr_client():
"""Create a mock VultrDNSServer for testing API interactions.""" """Create a mock VultrDNSServer for testing API interactions."""
from vultr_dns_mcp.server import VultrDNSServer from mcp_vultr.server import VultrDNSServer
mock_client = AsyncMock(spec=VultrDNSServer) mock_client = AsyncMock(spec=VultrDNSServer)

View File

@ -3,7 +3,7 @@
import pytest import pytest
from unittest.mock import patch, AsyncMock, MagicMock from unittest.mock import patch, AsyncMock, MagicMock
from click.testing import CliRunner from click.testing import CliRunner
from vultr_dns_mcp.cli import cli, main from mcp_vultr.cli import cli, main
@pytest.fixture @pytest.fixture
@ -92,7 +92,7 @@ class TestServerCommand:
assert result.exit_code == 1 assert result.exit_code == 1
assert "VULTR_API_KEY is required" in result.output assert "VULTR_API_KEY is required" in result.output
@patch('vultr_dns_mcp.cli.run_server') @patch('mcp_vultr.cli.run_server')
def test_server_command_with_api_key(self, mock_run_server, cli_runner): def test_server_command_with_api_key(self, mock_run_server, cli_runner):
"""Test server command with API key.""" """Test server command with API key."""
with patch.dict('os.environ', {'VULTR_API_KEY': 'test-key'}): with patch.dict('os.environ', {'VULTR_API_KEY': 'test-key'}):
@ -103,7 +103,7 @@ class TestServerCommand:
assert "Starting Vultr DNS MCP Server" in result.output assert "Starting Vultr DNS MCP Server" in result.output
mock_run_server.assert_called_once_with('test-key') mock_run_server.assert_called_once_with('test-key')
@patch('vultr_dns_mcp.cli.run_server') @patch('mcp_vultr.cli.run_server')
def test_server_command_with_error(self, mock_run_server, cli_runner): def test_server_command_with_error(self, mock_run_server, cli_runner):
"""Test server command with error.""" """Test server command with error."""
with patch.dict('os.environ', {'VULTR_API_KEY': 'test-key'}): with patch.dict('os.environ', {'VULTR_API_KEY': 'test-key'}):
@ -118,7 +118,7 @@ class TestServerCommand:
class TestDomainsCommands: class TestDomainsCommands:
"""Test domain management commands.""" """Test domain management commands."""
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_list_domains(self, mock_client_class, cli_runner, mock_client_for_cli): def test_list_domains(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test domains list command.""" """Test domains list command."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -131,7 +131,7 @@ class TestDomainsCommands:
assert "test.com" in result.output assert "test.com" in result.output
mock_client_for_cli.domains.assert_called_once() mock_client_for_cli.domains.assert_called_once()
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_list_domains_empty(self, mock_client_class, cli_runner): def test_list_domains_empty(self, mock_client_class, cli_runner):
"""Test domains list command with no domains.""" """Test domains list command with no domains."""
mock_client = AsyncMock() mock_client = AsyncMock()
@ -144,7 +144,7 @@ class TestDomainsCommands:
assert result.exit_code == 0 assert result.exit_code == 0
assert "No domains found" in result.output assert "No domains found" in result.output
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_domain_info(self, mock_client_class, cli_runner, mock_client_for_cli): def test_domain_info(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test domains info command.""" """Test domains info command."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -157,7 +157,7 @@ class TestDomainsCommands:
assert "Total Records: 5" in result.output assert "Total Records: 5" in result.output
mock_client_for_cli.get_domain_summary.assert_called_once_with('example.com') mock_client_for_cli.get_domain_summary.assert_called_once_with('example.com')
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_domain_info_error(self, mock_client_class, cli_runner): def test_domain_info_error(self, mock_client_class, cli_runner):
"""Test domains info command with error.""" """Test domains info command with error."""
mock_client = AsyncMock() mock_client = AsyncMock()
@ -170,7 +170,7 @@ class TestDomainsCommands:
assert result.exit_code == 1 assert result.exit_code == 1
assert "Domain not found" in result.output assert "Domain not found" in result.output
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_create_domain(self, mock_client_class, cli_runner, mock_client_for_cli): def test_create_domain(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test domains create command.""" """Test domains create command."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -182,7 +182,7 @@ class TestDomainsCommands:
assert "Created domain newdomain.com" in result.output assert "Created domain newdomain.com" in result.output
mock_client_for_cli.add_domain.assert_called_once_with('newdomain.com', '192.168.1.100') mock_client_for_cli.add_domain.assert_called_once_with('newdomain.com', '192.168.1.100')
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_create_domain_error(self, mock_client_class, cli_runner): def test_create_domain_error(self, mock_client_class, cli_runner):
"""Test domains create command with error.""" """Test domains create command with error."""
mock_client = AsyncMock() mock_client = AsyncMock()
@ -200,7 +200,7 @@ class TestDomainsCommands:
class TestRecordsCommands: class TestRecordsCommands:
"""Test DNS records commands.""" """Test DNS records commands."""
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_list_records(self, mock_client_class, cli_runner, mock_client_for_cli): def test_list_records(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test records list command.""" """Test records list command."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -213,7 +213,7 @@ class TestRecordsCommands:
assert "rec1" in result.output assert "rec1" in result.output
mock_client_for_cli.records.assert_called_once_with('example.com') mock_client_for_cli.records.assert_called_once_with('example.com')
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_list_records_filtered(self, mock_client_class, cli_runner, mock_client_for_cli): def test_list_records_filtered(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test records list command with type filter.""" """Test records list command with type filter."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -224,7 +224,7 @@ class TestRecordsCommands:
assert result.exit_code == 0 assert result.exit_code == 0
mock_client_for_cli.find_records_by_type.assert_called_once_with('example.com', 'A') mock_client_for_cli.find_records_by_type.assert_called_once_with('example.com', 'A')
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_list_records_empty(self, mock_client_class, cli_runner): def test_list_records_empty(self, mock_client_class, cli_runner):
"""Test records list command with no records.""" """Test records list command with no records."""
mock_client = AsyncMock() mock_client = AsyncMock()
@ -237,7 +237,7 @@ class TestRecordsCommands:
assert result.exit_code == 0 assert result.exit_code == 0
assert "No records found" in result.output assert "No records found" in result.output
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_add_record(self, mock_client_class, cli_runner, mock_client_for_cli): def test_add_record(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test records add command.""" """Test records add command."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -253,7 +253,7 @@ class TestRecordsCommands:
'example.com', 'A', 'www', '192.168.1.100', None, None 'example.com', 'A', 'www', '192.168.1.100', None, None
) )
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_add_record_with_ttl_and_priority(self, mock_client_class, cli_runner, mock_client_for_cli): def test_add_record_with_ttl_and_priority(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test records add command with TTL and priority.""" """Test records add command with TTL and priority."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -269,7 +269,7 @@ class TestRecordsCommands:
'example.com', 'MX', '@', 'mail.example.com', 600, 10 'example.com', 'MX', '@', 'mail.example.com', 600, 10
) )
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_add_record_error(self, mock_client_class, cli_runner): def test_add_record_error(self, mock_client_class, cli_runner):
"""Test records add command with error.""" """Test records add command with error."""
mock_client = AsyncMock() mock_client = AsyncMock()
@ -284,7 +284,7 @@ class TestRecordsCommands:
assert result.exit_code == 1 assert result.exit_code == 1
assert "Invalid record" in result.output assert "Invalid record" in result.output
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_delete_record(self, mock_client_class, cli_runner, mock_client_for_cli): def test_delete_record(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test records delete command.""" """Test records delete command."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -298,7 +298,7 @@ class TestRecordsCommands:
assert "Deleted record record-123" in result.output assert "Deleted record record-123" in result.output
mock_client_for_cli.remove_record.assert_called_once_with('example.com', 'record-123') mock_client_for_cli.remove_record.assert_called_once_with('example.com', 'record-123')
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_delete_record_failure(self, mock_client_class, cli_runner): def test_delete_record_failure(self, mock_client_class, cli_runner):
"""Test records delete command failure.""" """Test records delete command failure."""
mock_client = AsyncMock() mock_client = AsyncMock()
@ -318,7 +318,7 @@ class TestRecordsCommands:
class TestSetupCommands: class TestSetupCommands:
"""Test setup utility commands.""" """Test setup utility commands."""
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_setup_website(self, mock_client_class, cli_runner, mock_client_for_cli): def test_setup_website(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test setup-website command.""" """Test setup-website command."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -335,7 +335,7 @@ class TestSetupCommands:
'example.com', '192.168.1.100', True, None 'example.com', '192.168.1.100', True, None
) )
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_setup_website_no_www(self, mock_client_class, cli_runner, mock_client_for_cli): def test_setup_website_no_www(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test setup-website command without www.""" """Test setup-website command without www."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -350,7 +350,7 @@ class TestSetupCommands:
'example.com', '192.168.1.100', False, None 'example.com', '192.168.1.100', False, None
) )
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_setup_website_with_ttl(self, mock_client_class, cli_runner, mock_client_for_cli): def test_setup_website_with_ttl(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test setup-website command with custom TTL.""" """Test setup-website command with custom TTL."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -365,7 +365,7 @@ class TestSetupCommands:
'example.com', '192.168.1.100', True, 600 'example.com', '192.168.1.100', True, 600
) )
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_setup_website_with_errors(self, mock_client_class, cli_runner): def test_setup_website_with_errors(self, mock_client_class, cli_runner):
"""Test setup-website command with errors.""" """Test setup-website command with errors."""
mock_client = AsyncMock() mock_client = AsyncMock()
@ -384,7 +384,7 @@ class TestSetupCommands:
assert result.exit_code == 0 assert result.exit_code == 0
assert "Setup completed with some errors" in result.output assert "Setup completed with some errors" in result.output
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_setup_email(self, mock_client_class, cli_runner, mock_client_for_cli): def test_setup_email(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test setup-email command.""" """Test setup-email command."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -401,7 +401,7 @@ class TestSetupCommands:
'example.com', 'mail.example.com', 10, None 'example.com', 'mail.example.com', 10, None
) )
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_setup_email_custom_priority(self, mock_client_class, cli_runner, mock_client_for_cli): def test_setup_email_custom_priority(self, mock_client_class, cli_runner, mock_client_for_cli):
"""Test setup-email command with custom priority.""" """Test setup-email command with custom priority."""
mock_client_class.return_value = mock_client_for_cli mock_client_class.return_value = mock_client_for_cli
@ -421,7 +421,7 @@ class TestSetupCommands:
class TestCLIErrorHandling: class TestCLIErrorHandling:
"""Test CLI error handling.""" """Test CLI error handling."""
@patch('vultr_dns_mcp.cli.VultrDNSClient') @patch('mcp_vultr.cli.VultrDNSClient')
def test_api_exception_handling(self, mock_client_class, cli_runner): def test_api_exception_handling(self, mock_client_class, cli_runner):
"""Test CLI handling of API exceptions.""" """Test CLI handling of API exceptions."""
mock_client = AsyncMock() mock_client = AsyncMock()

View File

@ -2,7 +2,7 @@
import pytest import pytest
from unittest.mock import AsyncMock, patch from unittest.mock import AsyncMock, patch
from vultr_dns_mcp.client import VultrDNSClient from mcp_vultr.client import VultrDNSClient
@pytest.mark.unit @pytest.mark.unit
@ -18,7 +18,7 @@ class TestVultrDNSClient:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_domains_method(self, mock_api_key, mock_vultr_client): async def test_domains_method(self, mock_api_key, mock_vultr_client):
"""Test the domains() method.""" """Test the domains() method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.domains() result = await client.domains()
@ -28,7 +28,7 @@ class TestVultrDNSClient:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_domain_method(self, mock_api_key, mock_vultr_client): async def test_domain_method(self, mock_api_key, mock_vultr_client):
"""Test the domain() method.""" """Test the domain() method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.domain("example.com") result = await client.domain("example.com")
@ -38,7 +38,7 @@ class TestVultrDNSClient:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_add_domain_method(self, mock_api_key, mock_vultr_client): async def test_add_domain_method(self, mock_api_key, mock_vultr_client):
"""Test the add_domain() method.""" """Test the add_domain() method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.add_domain("newdomain.com", "192.168.1.100") result = await client.add_domain("newdomain.com", "192.168.1.100")
@ -48,7 +48,7 @@ class TestVultrDNSClient:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_remove_domain_success(self, mock_api_key, mock_vultr_client): async def test_remove_domain_success(self, mock_api_key, mock_vultr_client):
"""Test successful domain removal.""" """Test successful domain removal."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.remove_domain("example.com") result = await client.remove_domain("example.com")
@ -61,7 +61,7 @@ class TestVultrDNSClient:
mock_client = AsyncMock() mock_client = AsyncMock()
mock_client.delete_domain.side_effect = Exception("API Error") mock_client.delete_domain.side_effect = Exception("API Error")
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.remove_domain("example.com") result = await client.remove_domain("example.com")
@ -70,7 +70,7 @@ class TestVultrDNSClient:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_records_method(self, mock_api_key, mock_vultr_client): async def test_records_method(self, mock_api_key, mock_vultr_client):
"""Test the records() method.""" """Test the records() method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.records("example.com") result = await client.records("example.com")
@ -80,7 +80,7 @@ class TestVultrDNSClient:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_add_record_method(self, mock_api_key, mock_vultr_client): async def test_add_record_method(self, mock_api_key, mock_vultr_client):
"""Test the add_record() method.""" """Test the add_record() method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.add_record("example.com", "A", "www", "192.168.1.100", 300) result = await client.add_record("example.com", "A", "www", "192.168.1.100", 300)
@ -92,7 +92,7 @@ class TestVultrDNSClient:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_update_record_method(self, mock_api_key, mock_vultr_client): async def test_update_record_method(self, mock_api_key, mock_vultr_client):
"""Test the update_record() method.""" """Test the update_record() method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.update_record( result = await client.update_record(
"example.com", "record-123", "A", "www", "192.168.1.200", 600 "example.com", "record-123", "A", "www", "192.168.1.200", 600
@ -106,7 +106,7 @@ class TestVultrDNSClient:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_remove_record_success(self, mock_api_key, mock_vultr_client): async def test_remove_record_success(self, mock_api_key, mock_vultr_client):
"""Test successful record removal.""" """Test successful record removal."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.remove_record("example.com", "record-123") result = await client.remove_record("example.com", "record-123")
@ -119,7 +119,7 @@ class TestVultrDNSClient:
mock_client = AsyncMock() mock_client = AsyncMock()
mock_client.delete_record.side_effect = Exception("API Error") mock_client.delete_record.side_effect = Exception("API Error")
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.remove_record("example.com", "record-123") result = await client.remove_record("example.com", "record-123")
@ -133,7 +133,7 @@ class TestConvenienceMethods:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_add_a_record(self, mock_api_key, mock_vultr_client): async def test_add_a_record(self, mock_api_key, mock_vultr_client):
"""Test add_a_record convenience method.""" """Test add_a_record convenience method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.add_a_record("example.com", "www", "192.168.1.100", 300) result = await client.add_a_record("example.com", "www", "192.168.1.100", 300)
@ -145,7 +145,7 @@ class TestConvenienceMethods:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_add_aaaa_record(self, mock_api_key, mock_vultr_client): async def test_add_aaaa_record(self, mock_api_key, mock_vultr_client):
"""Test add_aaaa_record convenience method.""" """Test add_aaaa_record convenience method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.add_aaaa_record("example.com", "www", "2001:db8::1", 300) result = await client.add_aaaa_record("example.com", "www", "2001:db8::1", 300)
@ -157,7 +157,7 @@ class TestConvenienceMethods:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_add_cname_record(self, mock_api_key, mock_vultr_client): async def test_add_cname_record(self, mock_api_key, mock_vultr_client):
"""Test add_cname_record convenience method.""" """Test add_cname_record convenience method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.add_cname_record("example.com", "www", "example.com", 300) result = await client.add_cname_record("example.com", "www", "example.com", 300)
@ -169,7 +169,7 @@ class TestConvenienceMethods:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_add_mx_record(self, mock_api_key, mock_vultr_client): async def test_add_mx_record(self, mock_api_key, mock_vultr_client):
"""Test add_mx_record convenience method.""" """Test add_mx_record convenience method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.add_mx_record("example.com", "@", "mail.example.com", 10, 300) result = await client.add_mx_record("example.com", "@", "mail.example.com", 10, 300)
@ -181,7 +181,7 @@ class TestConvenienceMethods:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_add_txt_record(self, mock_api_key, mock_vultr_client): async def test_add_txt_record(self, mock_api_key, mock_vultr_client):
"""Test add_txt_record convenience method.""" """Test add_txt_record convenience method."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.add_txt_record("example.com", "@", "v=spf1 include:_spf.google.com ~all", 300) result = await client.add_txt_record("example.com", "@", "v=spf1 include:_spf.google.com ~all", 300)
@ -201,7 +201,7 @@ class TestUtilityMethods:
mock_client = AsyncMock() mock_client = AsyncMock()
mock_client.list_records.return_value = sample_records mock_client.list_records.return_value = sample_records
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.find_records_by_type("example.com", "A") result = await client.find_records_by_type("example.com", "A")
@ -214,7 +214,7 @@ class TestUtilityMethods:
mock_client = AsyncMock() mock_client = AsyncMock()
mock_client.list_records.return_value = sample_records mock_client.list_records.return_value = sample_records
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.find_records_by_name("example.com", "@") result = await client.find_records_by_name("example.com", "@")
@ -228,7 +228,7 @@ class TestUtilityMethods:
mock_client.get_domain.return_value = {"domain": "example.com", "date_created": "2024-01-01"} mock_client.get_domain.return_value = {"domain": "example.com", "date_created": "2024-01-01"}
mock_client.list_records.return_value = sample_records mock_client.list_records.return_value = sample_records
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.get_domain_summary("example.com") result = await client.get_domain_summary("example.com")
@ -246,7 +246,7 @@ class TestUtilityMethods:
mock_client = AsyncMock() mock_client = AsyncMock()
mock_client.get_domain.side_effect = Exception("API Error") mock_client.get_domain.side_effect = Exception("API Error")
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.get_domain_summary("example.com") result = await client.get_domain_summary("example.com")
@ -261,7 +261,7 @@ class TestSetupMethods:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_setup_basic_website_success(self, mock_api_key, mock_vultr_client): async def test_setup_basic_website_success(self, mock_api_key, mock_vultr_client):
"""Test successful website setup.""" """Test successful website setup."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.setup_basic_website("example.com", "192.168.1.100", True, 300) result = await client.setup_basic_website("example.com", "192.168.1.100", True, 300)
@ -275,7 +275,7 @@ class TestSetupMethods:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_setup_basic_website_no_www(self, mock_api_key, mock_vultr_client): async def test_setup_basic_website_no_www(self, mock_api_key, mock_vultr_client):
"""Test website setup without www subdomain.""" """Test website setup without www subdomain."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.setup_basic_website("example.com", "192.168.1.100", False, 300) result = await client.setup_basic_website("example.com", "192.168.1.100", False, 300)
@ -291,7 +291,7 @@ class TestSetupMethods:
mock_client = AsyncMock() mock_client = AsyncMock()
mock_client.create_record.side_effect = Exception("API Error") mock_client.create_record.side_effect = Exception("API Error")
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.setup_basic_website("example.com", "192.168.1.100", True, 300) result = await client.setup_basic_website("example.com", "192.168.1.100", True, 300)
@ -301,7 +301,7 @@ class TestSetupMethods:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_setup_email_success(self, mock_api_key, mock_vultr_client): async def test_setup_email_success(self, mock_api_key, mock_vultr_client):
"""Test successful email setup.""" """Test successful email setup."""
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_vultr_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.setup_email("example.com", "mail.example.com", 10, 300) result = await client.setup_email("example.com", "mail.example.com", 10, 300)
@ -320,7 +320,7 @@ class TestSetupMethods:
mock_client = AsyncMock() mock_client = AsyncMock()
mock_client.create_record.side_effect = Exception("API Error") mock_client.create_record.side_effect = Exception("API Error")
with patch('vultr_dns_mcp.client.VultrDNSServer', return_value=mock_client): with patch('mcp_vultr.client.VultrDNSServer', return_value=mock_client):
client = VultrDNSClient(mock_api_key) client = VultrDNSClient(mock_api_key)
result = await client.setup_email("example.com", "mail.example.com", 10, 300) result = await client.setup_email("example.com", "mail.example.com", 10, 300)

View File

@ -4,7 +4,7 @@ import pytest
from unittest.mock import patch, AsyncMock from unittest.mock import patch, AsyncMock
from mcp.client.session import ClientSession from mcp.client.session import ClientSession
from mcp.client.stdio import stdio_client from mcp.client.stdio import stdio_client
from vultr_dns_mcp.server import VultrDNSServer, create_mcp_server from mcp_vultr.server import VultrDNSServer, create_mcp_server
class TestMCPServerBasics: class TestMCPServerBasics:
@ -36,7 +36,7 @@ class TestMCPTools:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_list_dns_domains_tool(self, mcp_server, mock_vultr_client): async def test_list_dns_domains_tool(self, mcp_server, mock_vultr_client):
"""Test the list_dns_domains MCP tool.""" """Test the list_dns_domains MCP tool."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
# For the official MCP package, we need to use ClientSession # For the official MCP package, we need to use ClientSession
@ -54,7 +54,7 @@ class TestMCPTools:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_get_dns_domain_tool(self, mcp_server, mock_vultr_client): async def test_get_dns_domain_tool(self, mcp_server, mock_vultr_client):
"""Test the get_dns_domain MCP tool.""" """Test the get_dns_domain MCP tool."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:
@ -66,7 +66,7 @@ class TestMCPTools:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_create_dns_domain_tool(self, mcp_server, mock_vultr_client): async def test_create_dns_domain_tool(self, mcp_server, mock_vultr_client):
"""Test the create_dns_domain MCP tool.""" """Test the create_dns_domain MCP tool."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:
@ -81,7 +81,7 @@ class TestMCPTools:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_delete_dns_domain_tool(self, mcp_server, mock_vultr_client): async def test_delete_dns_domain_tool(self, mcp_server, mock_vultr_client):
"""Test the delete_dns_domain MCP tool.""" """Test the delete_dns_domain MCP tool."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:
@ -93,7 +93,7 @@ class TestMCPTools:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_list_dns_records_tool(self, mcp_server, mock_vultr_client): async def test_list_dns_records_tool(self, mcp_server, mock_vultr_client):
"""Test the list_dns_records MCP tool.""" """Test the list_dns_records MCP tool."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:
@ -105,7 +105,7 @@ class TestMCPTools:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_create_dns_record_tool(self, mcp_server, mock_vultr_client): async def test_create_dns_record_tool(self, mcp_server, mock_vultr_client):
"""Test the create_dns_record MCP tool.""" """Test the create_dns_record MCP tool."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:
@ -154,7 +154,7 @@ class TestMCPTools:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_analyze_dns_records_tool(self, mcp_server, mock_vultr_client): async def test_analyze_dns_records_tool(self, mcp_server, mock_vultr_client):
"""Test the analyze_dns_records MCP tool.""" """Test the analyze_dns_records MCP tool."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:
@ -171,7 +171,7 @@ class TestMCPResources:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_domains_resource(self, mcp_server, mock_vultr_client): async def test_domains_resource(self, mcp_server, mock_vultr_client):
"""Test the vultr://domains resource.""" """Test the vultr://domains resource."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:
@ -193,7 +193,7 @@ class TestMCPResources:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_read_domains_resource(self, mcp_server, mock_vultr_client): async def test_read_domains_resource(self, mcp_server, mock_vultr_client):
"""Test reading the domains resource content.""" """Test reading the domains resource content."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:
@ -216,7 +216,7 @@ class TestMCPToolErrors:
mock_client = AsyncMock() mock_client = AsyncMock()
mock_client.list_domains.side_effect = Exception("API Error") mock_client.list_domains.side_effect = Exception("API Error")
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:
@ -241,7 +241,7 @@ class TestMCPIntegration:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_complete_domain_workflow(self, mcp_server, mock_vultr_client): async def test_complete_domain_workflow(self, mcp_server, mock_vultr_client):
"""Test a complete domain management workflow.""" """Test a complete domain management workflow."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:
@ -269,7 +269,7 @@ class TestMCPIntegration:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_record_management_workflow(self, mcp_server, mock_vultr_client): async def test_record_management_workflow(self, mcp_server, mock_vultr_client):
"""Test record creation and management workflow.""" """Test record creation and management workflow."""
with patch('vultr_dns_mcp.server.VultrDNSServer', return_value=mock_vultr_client): with patch('mcp_vultr.server.VultrDNSServer', return_value=mock_vultr_client):
server = create_mcp_server("test-api-key") server = create_mcp_server("test-api-key")
async with ClientSession(server) as session: async with ClientSession(server) as session:

View File

@ -13,16 +13,16 @@ sys.path.insert(0, str(src_path))
def test_package_imports(): def test_package_imports():
"""Test that all main package imports work correctly.""" """Test that all main package imports work correctly."""
# Test main package imports # Test main package imports
from vultr_dns_mcp import VultrDNSClient, VultrDNSServer, create_mcp_server from mcp_vultr import VultrDNSClient, VultrDNSServer, create_mcp_server
assert VultrDNSClient is not None assert VultrDNSClient is not None
assert VultrDNSServer is not None assert VultrDNSServer is not None
assert create_mcp_server is not None assert create_mcp_server is not None
# Test individual module imports # Test individual module imports
from vultr_dns_mcp.server import VultrDNSServer as ServerClass from mcp_vultr.server import VultrDNSServer as ServerClass
from vultr_dns_mcp.client import VultrDNSClient as ClientClass from mcp_vultr.client import VultrDNSClient as ClientClass
from vultr_dns_mcp.cli import main from mcp_vultr.cli import main
from vultr_dns_mcp._version import __version__ from mcp_vultr._version import __version__
assert ServerClass is not None assert ServerClass is not None
assert ClientClass is not None assert ClientClass is not None
@ -32,7 +32,7 @@ def test_package_imports():
def test_version_consistency(): def test_version_consistency():
"""Test that version is consistent across files.""" """Test that version is consistent across files."""
from vultr_dns_mcp._version import __version__ from mcp_vultr._version import __version__
# Read version from pyproject.toml # Read version from pyproject.toml
pyproject_path = Path(__file__).parent.parent / "pyproject.toml" pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
@ -58,7 +58,7 @@ def test_fastmcp_available():
def test_mcp_server_creation(): def test_mcp_server_creation():
"""Test that MCP server can be created without errors.""" """Test that MCP server can be created without errors."""
from vultr_dns_mcp.server import create_mcp_server from mcp_vultr.server import create_mcp_server
# This should work with any API key for creation (won't make API calls) # This should work with any API key for creation (won't make API calls)
server = create_mcp_server("test-api-key-for-testing") server = create_mcp_server("test-api-key-for-testing")
@ -71,7 +71,7 @@ def test_mcp_server_creation():
def test_cli_entry_points(): def test_cli_entry_points():
"""Test that CLI entry points are properly configured.""" """Test that CLI entry points are properly configured."""
from vultr_dns_mcp.cli import main, server_command from mcp_vultr.cli import main, server_command
assert callable(main) assert callable(main)
assert callable(server_command) assert callable(server_command)
@ -138,7 +138,7 @@ def test_environment_setup():
def test_package_structure(): def test_package_structure():
"""Test that package structure is correct.""" """Test that package structure is correct."""
package_root = Path(__file__).parent.parent / "src" / "vultr_dns_mcp" package_root = Path(__file__).parent.parent / "src" / "mcp_vultr"
# Check that all expected files exist # Check that all expected files exist
expected_files = [ expected_files = [

View File

@ -2,7 +2,7 @@
import pytest import pytest
from unittest.mock import AsyncMock, patch from unittest.mock import AsyncMock, patch
from vultr_dns_mcp.server import VultrDNSServer, create_mcp_server from mcp_vultr.server import VultrDNSServer, create_mcp_server
class TestVultrDNSServer: class TestVultrDNSServer:
@ -103,14 +103,14 @@ class TestMCPServer:
@pytest.fixture @pytest.fixture
def mock_vultr_server(): def mock_vultr_server():
"""Fixture for mocked VultrDNSServer.""" """Fixture for mocked VultrDNSServer."""
with patch('vultr_dns_mcp.server.VultrDNSServer') as mock: with patch('mcp_vultr.server.VultrDNSServer') as mock:
yield mock yield mock
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_validation_tool(): async def test_validation_tool():
"""Test DNS record validation functionality.""" """Test DNS record validation functionality."""
from vultr_dns_mcp.server import create_mcp_server from mcp_vultr.server import create_mcp_server
# Create server (this will fail without API key, but we can test the structure) # Create server (this will fail without API key, but we can test the structure)
with pytest.raises(ValueError): with pytest.raises(ValueError):

View File

@ -3,7 +3,7 @@
import pytest import pytest
import httpx import httpx
from unittest.mock import AsyncMock, patch from unittest.mock import AsyncMock, patch
from vultr_dns_mcp.server import ( from mcp_vultr.server import (
VultrDNSServer, VultrDNSServer,
VultrAPIError, VultrAPIError,
VultrAuthError, VultrAuthError,