European Parliament MCP Server API - v1.1.16
    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 }

    • Returns all currently active MEPs for today's date.

      Unlike getMEPs(), this uses GET /meps/show-current which returns api:country-of-representation and api:political-group in responses. Optional country and group filters are applied client-side after fetch.

      EP API Endpoint: GET /meps/show-current

      Parameters

      • params: { country?: string; group?: string; limit?: number; offset?: number } = {}

      Returns Promise<PaginatedResponse<MEP>>

    • Returns EP events (hearings, conferences, etc.). EP API Endpoint: GET /events

      Parameters

      • params: {
            dateFrom?: string;
            dateTo?: string;
            limit?: number;
            offset?: number;
            year?: number;
        } = {}

      Returns Promise<PaginatedResponse<EPEvent>>

    • Retrieves recently updated events via the feed endpoint. EP API Endpoint: GET /events/feed

      Parameters

      • params: { activityType?: string; startDate?: string; timeframe?: string } = {}

      Returns Promise<JSONLDResponse<Record<string, unknown>>>

    • 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

    • Returns a single event within a procedure by event ID. EP API Endpoint: GET /procedures/{process-id}/events/{event-id}

      Parameters

      • processId: string

        Procedure process ID

      • eventId: string

        Event identifier within the procedure

      Returns Promise<Record<string, unknown>>

    • Retrieves recently updated procedures via the feed endpoint. EP API Endpoint: GET /procedures/feed

      Parameters

      • params: { processType?: string; startDate?: string; timeframe?: string } = {}

      Returns Promise<JSONLDResponse<Record<string, unknown>>>

    • Returns plenary speeches. EP API Endpoint: GET /speeches

      Parameters

      • params: {
            dateFrom?: string;
            dateTo?: string;
            limit?: number;
            offset?: number;
            year?: number;
        } = {}

      Returns Promise<PaginatedResponse<Speech>>

    • 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