UNPKG

@thomas.tan/typescript-mcp-demo-server

Version:

TypeScript MCP demo server with web extraction, search, and datetime utilities

26 lines (22 loc) 591 B
export function getCurrentDateTime(): string { const now = new Date(); // Format the date and time in a readable format const dateString = now.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric', weekday: 'long' }); const timeString = now.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', second: '2-digit', timeZoneName: 'short' }); const isoString = now.toISOString(); return `Current Date & Time: Date: ${dateString} Time: ${timeString} ISO: ${isoString} Timestamp: ${now.getTime()}`; }