European Parliament MCP Server API - v1.0.1
    Preparing search index...

    European Parliament API Client.

    Provides type-safe, high-performance access to the European Parliament Open Data Portal with comprehensive caching, rate limiting, and GDPR-compliant audit logging.

    Architecture Note: This class is a thin facade; all logic lives in the bounded-context sub-clients under src/clients/ep/. The facade owns the shared LRU cache and rate-limiter and passes them to every sub-client so they all operate within the same resource budget.

    Performance Targets:

    • P50 latency: <100ms (cached responses)
    • P95 latency: <200ms (cached responses)
    • P99 latency: <2000ms (uncached API calls)

    Features:

    • LRU caching with 15-minute TTL (500 entry max)
    • Token bucket rate limiting (100 requests/minute)
    • GDPR Article 30 compliant audit logging
    • Automatic JSON-LD to internal format transformation
    • Type-safe API with branded types

    ISMS Policy Compliance:

    • SC-002: Secure coding with input validation and error handling
    • PE-001: Performance monitoring and optimization (<200ms P95)
    • AU-002: Comprehensive audit logging for GDPR compliance
    • DP-001: Data protection and privacy by design
    const client = new EuropeanParliamentClient();
    const meps = await client.getMEPs({ country: 'SE', limit: 20 });
    console.log(`Found ${meps.total} Swedish MEPs`);
    • All personal data access is audit logged per GDPR Article 30
    • Rate limiting prevents API abuse and DoS attacks
    • No credentials stored (EP API is public)
    • Cache entries sanitized to prevent injection attacks
    • TLS 1.3 enforced for all API communications
    Index

    Constructors

    Properties

    committeeClient: CommitteeClient
    documentClient: DocumentClient
    legislativeClient: LegislativeClient
    mepClient: MEPClient
    plenaryClient: PlenaryClient
    questionClient: QuestionClient
    vocabularyClient: VocabularyClient
    votingClient: VotingClient

    Methods

    • Clears all entries from the LRU cache.

      Returns void

      client.clearCache();
      const freshData = await client.getMEPs({ country: 'SE' });
    • Returns cache statistics for monitoring and debugging.

      Returns { hitRate: number; hits: number; maxSize: number; misses: number; size: number }

      { size, maxSize, hitRate, hits, misses }

    • Retrieves Members of the European Parliament with filtering and pagination.

      Parameters

      • params: {
            active?: boolean;
            committee?: string;
            country?: string;
            group?: string;
            limit?: number;
            offset?: number;
        }

        country, group, committee, active, limit, offset

      Returns Promise<PaginatedResponse<MEP>>

      Paginated MEP list

      Personal data access logged per GDPR Article 30

      Cached: <100ms P50, <200ms P95. Uncached: <2s P99

    • Retrieves parliamentary questions with filtering by type, author, and status.

      Parameters

      • params: {
            author?: string;
            dateFrom?: string;
            dateTo?: string;
            limit?: number;
            offset?: number;
            status?: "PENDING" | "ANSWERED";
            topic?: string;
            type?: "WRITTEN" | "ORAL";
        }

        type, author, topic, status, dateFrom, dateTo, limit, offset

      Returns Promise<PaginatedResponse<ParliamentaryQuestion>>

      Paginated parliamentary questions list

      Audit logged per GDPR Article 30

      Cached: <100ms P50, <200ms P95. Uncached: <2s P99

    • Retrieves voting records with filtering by session, topic, and date.

      Parameters

      • params: {
            dateFrom?: string;
            dateTo?: string;
            limit?: number;
            mepId?: string;
            offset?: number;
            sessionId?: string;
            topic?: string;
        }

        sessionId, topic, dateFrom, dateTo, limit, offset

        • OptionaldateFrom?: string
        • OptionaldateTo?: string
        • Optionallimit?: number
        • OptionalmepId?: string

          Ignored; this endpoint only returns aggregate vote counts, not per-MEP positions.

        • Optionaloffset?: number
        • OptionalsessionId?: string
        • Optionaltopic?: string

      Returns Promise<PaginatedResponse<VotingRecord>>

      Paginated voting records list

      Audit logged per GDPR Article 30

      Cached: <100ms P50, <200ms P95. Uncached: <2s P99

    • Searches legislative documents by keyword, type, date, and committee.

      Parameters

      • params: {
            keyword: string;
            committee?: string;
            dateFrom?: string;
            dateTo?: string;
            documentType?: string;
            limit?: number;
            offset?: number;
        }

        keyword, documentType, dateFrom, dateTo, committee, limit, offset

      Returns Promise<PaginatedResponse<LegislativeDocument>>

      Paginated legislative documents list

      Audit logged per GDPR Article 30

      Cached: <100ms P50, <200ms P95. Uncached: <2s P99

    • Private

      Builds the shared resources object that is passed to all sub-clients. Extracted to keep the constructor complexity within ESLint limits.

      Parameters

      • config: EPClientConfig

        Client configuration options

      Returns EPSharedResources

      Shared resources for all EP sub-clients