Skip to main content
Glama

Linux Bash MCP Server

by gunjanjp
monitor.jsโ€ข3.98 kB
#!/usr/bin/env node import { promisify } from "util"; import { exec } from "child_process"; import fs from "fs/promises"; import path from "path"; const execAsync = promisify(exec); class ProjectMonitor { constructor() { this.repoUrl = this.getRepoUrl(); } getRepoUrl() { // This will be extracted from package.json or git config return "https://github.com/yourusername/linux-bash-mcp-server"; } async checkHealth() { console.log("๐Ÿ” Linux Bash MCP Server - Project Health Check\n"); try { // Check if tests pass console.log("๐Ÿงช Running test suite..."); await execAsync("npm test"); console.log("โœ… All tests passing\n"); // Check for common issues console.log("๐Ÿ”ง Checking for common issues..."); await execAsync("npm run debug"); console.log("โœ… Diagnostics completed\n"); // Check dependencies console.log("๐Ÿ“ฆ Checking dependencies..."); const { stdout } = await execAsync("npm audit --audit-level=high"); if (stdout.trim()) { console.log("โš ๏ธ Security audit found issues:"); console.log(stdout); } else { console.log("โœ… No high-severity security issues found"); } console.log("\n๐ŸŽ‰ Project health check completed successfully!"); console.log("\n๐Ÿ“Š Project Status:"); console.log(` Repository: ${this.repoUrl}`); console.log(" Status: โœ… Healthy"); console.log(" Tests: โœ… Passing"); console.log(" Security: โœ… No high-risk issues"); } catch (error) { console.log(`\nโŒ Health check failed: ${error.message}`); console.log("\n๐Ÿ”ง Recommended actions:"); console.log("1. Fix failing tests"); console.log("2. Run 'npm run debug' for detailed diagnostics"); console.log("3. Update dependencies if needed"); } } async generateProjectStats() { console.log("๐Ÿ“Š Project Statistics\n"); try { // Count lines of code const { stdout: lines } = await execAsync("find . -name '*.js' -not -path './node_modules/*' | xargs wc -l | tail -1"); console.log(`๐Ÿ“ Lines of code: ${lines.trim().split(/\s+/)[0]}`); // Count files const { stdout: files } = await execAsync("find . -name '*.js' -not -path './node_modules/*' | wc -l"); console.log(`๐Ÿ“„ JavaScript files: ${files.trim()}`); // Check documentation const { stdout: docs } = await execAsync("find . -name '*.md' | wc -l"); console.log(`๐Ÿ“š Documentation files: ${docs.trim()}`); // Check test coverage (approximate) const { stdout: tests } = await execAsync("find . -name '*test*.js' -not -path './node_modules/*' | wc -l"); console.log(`๐Ÿงช Test files: ${tests.trim()}`); } catch (error) { console.log("โŒ Could not generate statistics:", error.message); } } async suggestImprovements() { console.log("\n๐Ÿ’ก Suggested Improvements:\n"); const suggestions = [ "๐Ÿ”„ Set up GitHub Actions for automated testing", "๐Ÿ“ˆ Add code coverage reporting", "๐ŸŽฏ Create issue templates for bugs and features", "๐Ÿ“ Add examples for advanced use cases", "๐ŸŒ Consider creating a project website/docs", "๐Ÿ“ฑ Add support for more Linux distributions", "๐Ÿ”ง Implement configuration validation", "๐Ÿ“Š Add performance monitoring", "๐ŸŽจ Create a project logo/branding", "๐Ÿค Add contribution guidelines and code of conduct" ]; suggestions.forEach((suggestion, index) => { console.log(`${index + 1}. ${suggestion}`); }); } async run() { await this.checkHealth(); console.log("\n" + "=".repeat(50)); await this.generateProjectStats(); console.log("\n" + "=".repeat(50)); await this.suggestImprovements(); } } // Run monitor const monitor = new ProjectMonitor(); monitor.run().catch(console.error);

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/gunjanjp/linuxshell-mcp'

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