Skip to main content
Glama

get_dev_status

Check the status of npm run dev processes managed by the npm-dev-mcp server, including project detection, background execution, log monitoring, and port management.

Instructions

npm run devプロセスの状態確認

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that retrieves the dev server status using ProcessManager, including process details, log statistics, and recent errors.
    export async function getDevStatus(): Promise<string> { try { logger.debug('Getting dev server status'); const processManager = ProcessManager.getInstance(); const status = await processManager.getStatus(); if (!status) { return JSON.stringify({ success: true, message: 'Dev serverは起動していません', isRunning: false, process: null }); } // Get additional log statistics const logManager = processManager.getLogManager(); const logStats = logManager.getLogStats(); const hasRecentErrors = logManager.hasRecentErrors(); const result = { success: true, message: `Dev serverは${status.status}状態です`, isRunning: status.status === 'running', process: { pid: status.pid, directory: status.directory, status: status.status, startTime: status.startTime, ports: status.ports, uptime: Date.now() - status.startTime.getTime() }, logs: { total: logStats.total, errors: logStats.errors, warnings: logStats.warnings, info: logStats.info, hasRecentErrors } }; if (status.ports.length > 0) { result.message += `\n利用可能なポート: ${status.ports.join(', ')}`; } if (hasRecentErrors) { result.message += '\n⚠️ 最近エラーが発生しています。ログを確認してください。'; } logger.debug('Dev server status retrieved', { status: status.status, ports: status.ports }); return JSON.stringify(result, null, 2); } catch (error) { logger.error('Failed to get dev server status', { error }); return JSON.stringify({ success: false, message: `ステータス取得に失敗しました: ${error}`, isRunning: false, process: null }); } }
  • The input/output schema definition for the get_dev_status tool, which takes no parameters.
    export const getDevStatusSchema: Tool = { name: 'get_dev_status', description: 'npm run devプロセスの状態確認', inputSchema: { type: 'object', properties: {}, additionalProperties: false } };
  • src/index.ts:147-155 (registration)
    Registration of the get_dev_status tool in the MCP server's CallToolRequestSchema handler switch statement.
    case 'get_dev_status': return { content: [ { type: 'text', text: await getDevStatus(), }, ], };
  • src/index.ts:55-65 (registration)
    Registration of the getDevStatusSchema in the tools list for ListToolsRequestSchema.
    const tools = [ scanProjectDirsSchema, startDevServerSchema, getDevStatusSchema, getDevLogsSchema, stopDevServerSchema, restartDevServerSchema, getHealthStatusSchema, recoverFromStateSchema, autoRecoverSchema, ];
  • Dependency mapping for get_dev_status tool, requiring 'stateManager' service.
    export const SERVICE_DEPENDENCIES = { 'scan_project_dirs': ['projectContext'], 'start_dev_server': ['stateManager'], 'get_dev_status': ['stateManager'], 'get_dev_logs': ['stateManager'], 'stop_dev_server': ['stateManager'], 'restart_dev_server': ['stateManager'], 'get_health_status': ['healthChecker'], 'recover_from_state': ['stateManager'], 'auto_recover': ['stateManager', 'healthChecker'] } as const;

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/masamunet/npm-dev-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server