Skip to main content
Glama
wordpress-config.ts1.07 kB
// WordPress configuration management export interface WordPressConfig { baseUrl: string; username: string; applicationPassword: string; } export function getWordPressConfig(): WordPressConfig | null { const baseUrl = process.env.WORDPRESS_BASE_URL; const username = process.env.WORDPRESS_USERNAME; const applicationPassword = process.env.WORDPRESS_APPLICATION_PASSWORD; if (!baseUrl || !username || !applicationPassword) { return null; } return { baseUrl: baseUrl.replace(/\/$/, ''), // Remove trailing slash username, applicationPassword, }; } export function validateWordPressConfig(config: WordPressConfig): boolean { if (!config.baseUrl || !config.baseUrl.startsWith('http')) { throw new Error('Invalid WordPress base URL'); } if (!config.username || config.username.trim().length === 0) { throw new Error('Invalid WordPress username'); } if (!config.applicationPassword || config.applicationPassword.trim().length === 0) { throw new Error('Invalid WordPress application password'); } return true; }

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/mbrown1837/Ultimate-Elementor-MCP'

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