Skip to main content
Glama
config.ts2.02 kB
// Configuration for Smart Prompts MCP Server export interface GitHubConfig { owner: string; repo: string; branch?: string; path?: string; token?: string; // For private repos } export interface ServerConfig { github: GitHubConfig; cache: { ttl: number; // Time to live in milliseconds refreshInterval: number; // How often to check for updates }; features: { semanticSearch: boolean; promptComposition: boolean; usageTracking: boolean; }; } // Default configuration export const defaultConfig: ServerConfig = { github: { owner: process.env.GITHUB_OWNER || 'jezweb', repo: process.env.GITHUB_REPO || 'prompts', ...(process.env.GITHUB_BRANCH ? { branch: process.env.GITHUB_BRANCH } : { branch: 'main' }), ...(process.env.GITHUB_PATH ? { path: process.env.GITHUB_PATH } : {}), ...(process.env.GITHUB_TOKEN ? { token: process.env.GITHUB_TOKEN } : {}), }, cache: { ttl: 5 * 60 * 1000, // 5 minutes refreshInterval: 60 * 1000, // 1 minute }, features: { semanticSearch: true, promptComposition: true, usageTracking: true, }, }; // Load configuration from environment or use defaults export function loadConfig(): ServerConfig { const config = { ...defaultConfig }; // Override with environment variables if present if (process.env.CACHE_TTL) { config.cache.ttl = parseInt(process.env.CACHE_TTL, 10); } if (process.env.CACHE_REFRESH_INTERVAL) { config.cache.refreshInterval = parseInt(process.env.CACHE_REFRESH_INTERVAL, 10); } // Feature flags if (process.env.ENABLE_SEMANTIC_SEARCH !== undefined) { config.features.semanticSearch = process.env.ENABLE_SEMANTIC_SEARCH === 'true'; } if (process.env.ENABLE_PROMPT_COMPOSITION !== undefined) { config.features.promptComposition = process.env.ENABLE_PROMPT_COMPOSITION === 'true'; } if (process.env.ENABLE_USAGE_TRACKING !== undefined) { config.features.usageTracking = process.env.ENABLE_USAGE_TRACKING === 'true'; } return config; }

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/jezweb/smart-prompts-mcp'

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