Skip to main content
Glama
version.ts950 B
/** * Version management utility for the server */ import { readFileSync } from 'fs'; import { dirname, join } from 'path'; import { fileURLToPath } from 'url'; import logger from './logger.js'; // Get the current directory path const __dirname = dirname(fileURLToPath(import.meta.url)); /** * Retrieves the package version from package.json * * @returns The package version string or "0.0.0" if unavailable */ export function getVersion(): string { try { // Go up two levels: /src/utils → / const packageJsonPath = join(__dirname, '..', '..', 'package.json'); const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')); return packageJson.version || '0.0.0'; } catch (error) { // Return a default version in case of error logger.error({ error }, 'Failed to read package.json version'); return '0.0.0'; } } // Export the version directly for easy access export const VERSION = getVersion();

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/Laz1mov/mcp-inscription'

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