Skip to main content
Glama

MCP YAML API

by molavec
create-config-file.ts802 B
import fs from 'fs'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; // Get the current file's directory // to resolve relative paths correctly // This is necessary because __dirname is not available in ES modules const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); export const createConfigFile = (configFile: string) => { try { // Get this create-config-file.ts file directory const currentDir = __dirname; // Resolve the path to the template file const templateFile = `${currentDir}/../../public/apis.yaml`; // const templateFile = '/../../public/apis.yaml'; const template = fs.readFileSync(templateFile, 'utf8'); fs.writeFileSync(configFile, template, 'utf8'); } catch (error) { throw error; } };

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/molavec/mcp-yaml-api'

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