UNPKG

pagespace-mcp

Version:

Model Context Protocol (MCP) server for PageSpace with complete workspace management, powerful search, batch operations, and AI agent capabilities. Provides external access to all core PageSpace functionality.

29 lines (25 loc) 754 B
import { z } from 'zod' // Configuration schema const ConfigSchema = z.object({ apiUrl: z.string().url().default('http://localhost:3000'), authToken: z.string().optional(), }) /** * Loads and validates the server configuration from environment variables. * @returns {z.infer<typeof ConfigSchema>} */ export function loadConfig() { try { const config = ConfigSchema.parse({ apiUrl: process.env.PAGESPACE_API_URL || 'http://localhost:3000', authToken: process.env.PAGESPACE_AUTH_TOKEN, }) if (!config.authToken) { console.error('Warning: PAGESPACE_AUTH_TOKEN not set. Authentication may fail.') } return config } catch (error) { console.error('Configuration error:', error) process.exit(1) } }