Skip to main content
Glama
index.ts2.02 kB
// Display HTTP server status in CLI format import chalk from "chalk"; import { displayStatus } from "@/mcp/status/actions/displayStatus"; import { getHttpServerStatusData, getHttpServerLogsOnly, type HttpServerLogs, } from "./actions/getHttpStatus"; // Display logs in CLI format const displayLogs = (logs: HttpServerLogs): void => { // Display logs in a simpler format similar to PM2 logs if (logs.output.trim()) { console.log(`\n\x1b[36mLogs:\x1b[0m`); console.log(`\x1b[2m${logs.output}\x1b[0m`); } // Only show error logs if they have content if (logs.error.trim()) { console.log(`\n\x1b[31mError logs:\x1b[0m`); console.log(`\x1b[2m${logs.error}\x1b[0m`); } if (!logs.output.trim() && !logs.error.trim()) { console.log(`\n\x1b[33mNo logs found for this process.\x1b[0m`); } console.log( `\n\x1b[2mTo see more lines use: furi http status --lines <number>\x1b[0m` ); }; // Function that gets logs by calling getHttpServerStatusData (for API use) export const getHttpServerLogs = getHttpServerLogsOnly; // Display HTTP server status and logs in CLI export const getHttpServerStatus = async ( lines: number = 15 ): Promise<void> => { try { const statusData = await getHttpServerStatusData(lines); if (statusData.serverStatus === "offline") { console.log( chalk.yellow(statusData.message || "HTTP API server is not running") ); return; } // Display the status using the existing displayStatus function if (statusData.status) { displayStatus(statusData.status); } // Display logs displayLogs(statusData.logs); } catch (error: any) { console.error( chalk.red( `Failed to get HTTP API server status: ${ error.message || String(error) }` ) ); } finally { process.exit(0); } }; // Export a function to run this command export default async function httpStatus(lines: number = 15): Promise<void> { await getHttpServerStatus(lines); }

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/ashwwwin/furi'

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