#!/usr/bin/env python3
"""
FastMCP Server Demonstration
Shows how to start the server and list available tools
"""
import sys
from pathlib import Path
# Add the current directory to Python path
sys.path.insert(0, str(Path(__file__).parent))
def main():
"""Main demonstration function."""
print("๐ FastMCP Multi-Tool Server")
print("=" * 50)
try:
# Import the server module
import server
print(f"โ Server initialized: {server.mcp.name}")
# Get the list of available tools
if hasattr(server.mcp, '_tools'):
tools = list(server.mcp._tools.keys())
print(f"\n๐ Available Tools ({len(tools)}):")
print("-" * 30)
tool_descriptions = {
'get_current_time': '๐ Get current date and time',
'get_weather': '๐ค๏ธ Get weather for any city',
'create_file': '๐ Create new files',
'read_file': '๐ Read file contents',
'list_directory': '๐ List directory contents',
'execute_command': '๐ป Execute shell commands safely',
'search_files': '๐ Search for text in files',
'calculate_expression': '๐งฎ Calculate mathematical expressions',
'get_system_info': 'โ๏ธ Get system information',
'create_temporary_file': '๐ Create temporary files'
}
for i, tool in enumerate(sorted(tools), 1):
description = tool_descriptions.get(tool, '๐ง Utility tool')
print(f"{i:2d}. {description}")
print(f" Function: {tool}")
print("\n" + "=" * 50)
print("๐ฏ How to Use:")
print("1. Start the server: python server.py")
print("2. Configure Claude Desktop with the server")
print("3. Use the tools through Claude's interface")
print("\n๐ Documentation:")
print("See README.md for detailed setup and usage instructions")
print("\n๐ง Configuration:")
print("- Environment file: .env")
print("- Add OpenWeatherMap API key for weather functionality")
return True
except Exception as e:
print(f"โ Error loading server: {e}")
return False
if __name__ == "__main__":
success = main()
if success:
print("\nโ
Server is ready to run!")
print("\nTo start the server now, run:")
print("python server.py")
else:
print("\nโ Server has issues. Check the error messages above.")
sys.exit(0 if success else 1)