Skip to main content
Glama
evalstate

Hugging Face MCP Server

by evalstate
html-to-ts.js1.33 kB
#!/usr/bin/env node /** * Converts the built gradio-widget.html file to a TypeScript constant * Usage: node scripts/html-to-ts.js */ import { readFileSync, writeFileSync } from 'fs'; import { fileURLToPath } from 'url'; import { dirname, join } from 'path'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); // Paths const htmlPath = join(__dirname, '../dist/web/gradio-widget.html'); const outputPath = join(__dirname, '../src/server/resources/gradio-widget-content.ts'); try { // Read the HTML file const htmlContent = readFileSync(htmlPath, 'utf-8'); // Escape backticks and ${} in the HTML content const escapedContent = htmlContent .replace(/\\/g, '\\\\') .replace(/`/g, '\\`') .replace(/\$/g, '\\$'); // Generate TypeScript file content const tsContent = `/** * Auto-generated file - DO NOT EDIT * Generated from dist/web/gradio-widget.html * Run 'pnpm run build:gradio-widget' to regenerate */ export const GRADIO_WIDGET_HTML = \`${escapedContent}\`; `; // Write the TypeScript file writeFileSync(outputPath, tsContent, 'utf-8'); console.log(`✓ Generated ${outputPath}`); console.log(` HTML size: ${htmlContent.length.toLocaleString()} bytes`); } catch (error) { console.error('Failed to convert HTML to TypeScript:', error); process.exit(1); }

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/evalstate/hf-mcp-server'

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