Skip to main content
Glama

mcp-rest-api

by dkmaker
#!/usr/bin/env node import fs from 'fs/promises'; import path from 'path'; import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); async function main() { const pkg = JSON.parse( await fs.readFile( path.join(__dirname, '..', 'package.json'), 'utf8' ) ); const versionPath = path.join(__dirname, '..', 'src', 'version.ts'); // Always generate version.ts with actual values during build const content = `// Auto-generated by build script export const VERSION = '${pkg.version}'; export const PACKAGE_NAME = '${pkg.name}'; export const SERVER_NAME = '${pkg.name.split('-').slice(-2).join('-')}'; `; await fs.writeFile(versionPath, content); console.log('Generated version.ts with package values'); // Copy resources to build directory const resourcesSrcDir = path.join(__dirname, '..', 'src', 'resources'); const resourcesBuildDir = path.join(__dirname, '..', 'build', 'resources'); try { await fs.mkdir(resourcesBuildDir, { recursive: true }); const files = await fs.readdir(resourcesSrcDir); for (const file of files) { await fs.copyFile( path.join(resourcesSrcDir, file), path.join(resourcesBuildDir, file) ); } console.log('Copied resources to build directory'); } catch (error) { console.error('Error copying resources:', error); throw error; } } main().catch(console.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/dkmaker/mcp-rest-api'

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