it-tools-mcp
Version:
MCP-compliant server access to over 100 IT tools and utilities commonly used by developers, system administrators, and IT professionals.
52 lines (49 loc) • 1.59 kB
JavaScript
export function registerDeviceInfo(server) {
server.registerTool("show_device_info", {
inputSchema: {},
// VS Code compliance annotations
annotations: {
title: "Show Device Info",
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'}`,
},
],
};
}
});
}