mcp-vultr/simple_fastmcp.py
Ryan Malloy 75ffe33008 Migrate to FastMCP and add comprehensive improvements
Major changes:
- Migrate from low-level MCP to FastMCP framework for better compatibility
- Add custom exception hierarchy (VultrAPIError, VultrAuthError, etc.)
- Replace basic IPv6 validation with Python's ipaddress module
- Add HTTP request timeouts (30s total, 10s connect)
- Modernize development workflow with uv package manager
- Create FastMCP server with proper async/await patterns

New features:
- FastMCP server implementation with 12 DNS management tools
- Comprehensive Claude Desktop integration guide
- Enhanced error handling with specific exception types
- Professional README with badges and examples
- Complete testing suite with improvement validation

Documentation:
- CLAUDE.md: Consolidated project documentation
- CLAUDE_DESKTOP_SETUP.md: Step-by-step Claude Desktop setup guide
- Updated README.md with modern structure and uv-first approach
- Enhanced TESTING.md with FastMCP testing patterns

Development improvements:
- Updated all scripts to use uv run commands
- Smart development setup with uv/pip fallback
- Added comprehensive test coverage for new features
- PyPI-ready package configuration

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 10:09:20 -06:00

26 lines
560 B
Python

#!/usr/bin/env python3
import sys
import os
from fastmcp import FastMCP
print("SIMPLE FASTMCP SERVER STARTING", file=sys.stderr)
# Create FastMCP server
mcp = FastMCP(name="vultr-dns-simple")
@mcp.tool
def test_tool() -> str:
"""A simple test tool"""
return "Hello from Vultr DNS MCP!"
@mcp.tool
def list_domains() -> str:
"""List DNS domains"""
return "This would list your DNS domains"
print("TOOLS REGISTERED, STARTING SERVER", file=sys.stderr)
if __name__ == "__main__":
print("RUNNING MCP SERVER", file=sys.stderr)
mcp.run()