server_status
Check server uptime and monitor resource usage like memory consumption to maintain system health and performance.
Instructions
MCP 서버 상태를 확인합니다 (uptime, 메모리 사용량 등).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:582-607 (handler)The MCP tool handler for 'server_status' that calls getServerStatus(), formats memory bytes, constructs a status text report, logs the call, and returns formatted text content.async () => { const status = getServerStatus(); const formatBytes = (bytes: number) => { const mb = bytes / 1024 / 1024; return `${mb.toFixed(2)} MB`; }; const text = ` === MCP 서버 상태 === ⏱️ Uptime: ${status.uptime.toFixed(2)}초 📦 Node.js: ${status.nodeVersion} 💾 메모리 사용량: - Heap Used: ${formatBytes(status.memory.heapUsed)} - Heap Total: ${formatBytes(status.memory.heapTotal)} - RSS: ${formatBytes(status.memory.rss)} `.trim(); log(LogLevel.INFO, "server_status Tool 호출됨"); return { content: [{ type: "text", text }], }; }
- src/advanced.ts:230-238 (schema)TypeScript interface defining the ServerStatus object structure returned by getServerStatus().export interface ServerStatus { uptime: number; memory: { heapUsed: number; heapTotal: number; rss: number; }; nodeVersion: string; }
- src/index.ts:578-608 (registration)MCP server.tool() registration for 'server_status' tool, with Korean description, empty input schema, and inline handler function.server.tool( "server_status", "MCP 서버 상태를 확인합니다 (uptime, 메모리 사용량 등).", {}, async () => { const status = getServerStatus(); const formatBytes = (bytes: number) => { const mb = bytes / 1024 / 1024; return `${mb.toFixed(2)} MB`; }; const text = ` === MCP 서버 상태 === ⏱️ Uptime: ${status.uptime.toFixed(2)}초 📦 Node.js: ${status.nodeVersion} 💾 메모리 사용량: - Heap Used: ${formatBytes(status.memory.heapUsed)} - Heap Total: ${formatBytes(status.memory.heapTotal)} - RSS: ${formatBytes(status.memory.rss)} `.trim(); log(LogLevel.INFO, "server_status Tool 호출됨"); return { content: [{ type: "text", text }], }; } );
- src/advanced.ts:245-257 (helper)Helper function that retrieves Node.js process uptime, memory usage, and version, returning a ServerStatus object.export function getServerStatus(): ServerStatus { const memoryUsage = process.memoryUsage(); return { uptime: process.uptime(), memory: { heapUsed: memoryUsage.heapUsed, heapTotal: memoryUsage.heapTotal, rss: memoryUsage.rss, }, nodeVersion: process.version, }; }