UNPKG

it-tools-mcp

Version:

Full MCP 2025-06-18 compliant server with 121+ IT tools, logging, ping, progress tracking, cancellation, and sampling utilities

54 lines (51 loc) 1.71 kB
export function registerDeviceInfo(server) { server.registerTool("show_device_info", { description: "Get basic device/system information", inputSchema: {}, // VS Code compliance annotations annotations: { title: "Show Device Info", description: "Get basic device/system information", readOnlyHint: true } }, async () => { try { const info = { platform: process.platform, arch: process.arch, nodeVersion: process.version, userAgent: 'IT Tools MCP Server', timestamp: new Date().toISOString(), timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, language: 'en-US' // Default for server environment }; return { content: [ { type: "text", text: `Device Information: Platform: ${info.platform} Architecture: ${info.arch} Node.js Version: ${info.nodeVersion} User Agent: ${info.userAgent} Current Time: ${info.timestamp} Timezone: ${info.timezone} Language: ${info.language} Note: This is basic server environment information. For detailed client device info, use a browser-based tool.`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error getting device info: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], }; } }); }