FoundryVTT MCP Server Documentation - v0.9.2
    Preparing search index...

    Variable configConst

    config: {
        serverName: string;
        serverVersion: string;
        logLevel: "debug" | "info" | "warn" | "error";
        nodeEnv: "development" | "production" | "test";
        foundry: {
            url: string;
            apiKey?: string;
            username?: string;
            password?: string;
            socketPath: string;
            timeout: number;
            retryAttempts: number;
            retryDelay: number;
        };
        cache: { enabled: boolean; ttlSeconds: number; maxSize: number };
    } = ...

    Global configuration instance

    This is the main configuration object used throughout the application. It's loaded once at module initialization and contains all validated settings.

    Type declaration

    • serverName: string
    • serverVersion: string
    • logLevel: "debug" | "info" | "warn" | "error"
    • nodeEnv: "development" | "production" | "test"
    • foundry: {
          url: string;
          apiKey?: string;
          username?: string;
          password?: string;
          socketPath: string;
          timeout: number;
          retryAttempts: number;
          retryDelay: number;
      }
    • cache: { enabled: boolean; ttlSeconds: number; maxSize: number }
    import { config } from './config/index.js';

    console.log(`Connecting to ${config.foundry.url}`);
    if (config.foundry.apiKey) {
    console.log('Using local REST API module with API key');
    } else {
    console.log('Using WebSocket connection with username/password');
    }