/**
* Server configuration from environment variables.
*/
export const config = {
/** When true, return mock data instead of calling AWS (for testing). */
dryRun:
process.env.MCP_AWS_DRY_RUN === "true" ||
process.env.MCP_DRY_RUN === "true",
/** When true, log tool invocations for audit. */
auditLog: process.env.MCP_AWS_AUDIT_LOG === "true",
/** Cache TTL in seconds (default: 60). Set to 0 to disable. */
cacheTtlSeconds: parseInt(process.env.MCP_AWS_CACHE_TTL || "60", 10) || 0,
/** Custom AWS endpoint (e.g. http://localhost:4566 for LocalStack). */
endpoint:
process.env.AWS_ENDPOINT_URL || process.env.AWS_ENDPOINT || undefined,
};
export function getAwsClientOptions(region?: string): {
region?: string;
endpoint?: string;
} {
const opts: { region?: string; endpoint?: string } = {};
if (region) opts.region = region;
if (config.endpoint) opts.endpoint = config.endpoint;
return opts;
}