Skip to main content
Glama

MCP YAML API

by molavec
yaml-reader.ts456 B
import fs from 'fs'; import yaml from 'yaml'; /** * Reads a YAML file and returns its contents as a JSON object. * @param filePath Path to the YAML file. * @returns Parsed JSON object. */ export function readYamlAsJson(filePath: string): any { try { const fileContents = fs.readFileSync(filePath, 'utf8'); const data = yaml.parse(fileContents); return data; } catch (e) { throw new Error(`Error reading YAML file: ${e}`); } }

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