All files / src config.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 0/0
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39                        7x         7x     7x           7x               7x     7x  
/**
 * Centralized configuration for the European Parliament MCP Server.
 *
 * All shared configuration constants and defaults are defined here to ensure
 * consistency across `src/index.ts`, `src/server/cli.ts`, and
 * `src/clients/ep/baseClient.ts`.
 *
 * @module config
 */
 
import { readFileSync } from 'fs';
 
const pkg = JSON.parse(
  readFileSync(new URL('../package.json', import.meta.url), 'utf-8')
) as { version: string };
 
/** Canonical server name used in MCP handshake and CLI output */
export const SERVER_NAME = 'european-parliament-mcp-server';
 
/** Server version loaded from package.json at startup */
export const SERVER_VERSION: string = pkg.version;
 
/**
 * HTTP `User-Agent` header value sent with every request to the EP API.
 * Includes the actual package version instead of a hardcoded string.
 */
export const USER_AGENT = `European-Parliament-MCP-Server/${pkg.version}`;
 
/**
 * Default rate limit applied to EP API requests (requests per minute).
 * Consumed by `baseClient.ts` (`DEFAULT_RATE_LIMIT_TOKENS`) and by the CLI
 * health/help output so that the displayed default always matches the
 * enforced default.
 */
export const DEFAULT_RATE_LIMIT_PER_MINUTE = 100;
 
/** Default base URL for the European Parliament Open Data Portal API v2 */
export const DEFAULT_API_URL = 'https://data.europarl.europa.eu/api/v2/';