European Parliament MCP Server API - v1.3.10
    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' });
    • Retrieves recently updated adopted texts via the feed endpoint. EP API Endpoint: GET /adopted-texts/feed

      Parameters

      • params: {
            abortSignal?: AbortSignal;
            startDate?: string;
            timeframe?: string;
            workType?: string;
        } = {}

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

    • Returns cache statistics for monitoring and debugging.

      All sub-clients share the same LRU cache and hit/miss counters (via EPSharedResources), so delegating to any single sub-client returns aggregate statistics across the entire facade.

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

      { size, maxSize, hitRate, hits, misses }

    • Retrieves recently updated controlled vocabularies via the feed endpoint. EP API Endpoint: GET /controlled-vocabularies/feed Fixed-window feed — no parameters per OpenAPI spec.

      Parameters

      • options: { abortSignal?: AbortSignal } = {}

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

    • Returns a single EP Controlled Vocabulary by ID. EP API Endpoint: GET /controlled-vocabularies/{voc-id}

      Parameters

      • vocId: string
      • options: { abortSignal?: AbortSignal } = {}

      Returns Promise<Record<string, unknown>>

    • 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: {
            abortSignal?: AbortSignal;
            country?: string;
            group?: string;
            limit?: number;
            offset?: number;
        } = {}

      Returns Promise<PaginatedResponse<MEP>>

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

      Parameters

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

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

    • Retrieves recently updated external documents via the feed endpoint. EP API Endpoint: GET /external-documents/feed

      Parameters

      • params: {
            abortSignal?: AbortSignal;
            startDate?: string;
            timeframe?: string;
            workType?: string;
        } = {}

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

    • Returns a single MEP declaration by document ID. EP API Endpoint: GET /meps-declarations/{doc-id}

      Parameters

      • docId: string
      • options: { abortSignal?: AbortSignal } = {}

      Returns Promise<MEPDeclaration>

      Declarations contain personal financial data – access is audit-logged

    • Returns MEP declarations of financial interests. EP API Endpoint: GET /meps-declarations

      Parameters

      • params: { abortSignal?: AbortSignal; limit?: number; offset?: number; year?: number } = {}

      Returns Promise<PaginatedResponse<MEPDeclaration>>

      Declarations contain personal financial data – access is audit-logged

    • Retrieves recently updated MEP declarations via the feed endpoint. EP API Endpoint: GET /meps-declarations/feed

      Parameters

      • params: {
            abortSignal?: AbortSignal;
            startDate?: string;
            timeframe?: string;
            workType?: string;
        } = {}

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

    • Retrieves detailed information about a specific MEP.

      Supports numeric ID ("124936"), person URI ("person/124936"), or MEP-prefixed ID ("MEP-124936").

      Parameters

      • id: string

        MEP identifier in any supported format

      • options: { abortSignal?: AbortSignal } = {}

      Returns Promise<MEPDetails>

      Detailed MEP information

      Personal data access logged per GDPR Article 30

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

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

      Parameters

      • params: {
            abortSignal?: AbortSignal;
            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 recently updated MEPs via the feed endpoint. EP API Endpoint: GET /meps/feed

      Parameters

      • params: { abortSignal?: AbortSignal; startDate?: string; timeframe?: string } = {}

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

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

      Parameters

      • params: {
            abortSignal?: AbortSignal;
            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 recently updated parliamentary questions via the feed endpoint. EP API Endpoint: GET /parliamentary-questions/feed Fixed-window feed — no parameters per OpenAPI spec.

      Parameters

      • options: { abortSignal?: AbortSignal } = {}

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

    • Retrieves recently updated plenary session documents via the feed endpoint. EP API Endpoint: GET /plenary-session-documents/feed Fixed-window feed — no parameters per OpenAPI spec.

      Parameters

      • options: { abortSignal?: AbortSignal } = {}

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

    • Retrieves plenary sessions with date and location filtering.

      Parameters

      • params: {
            abortSignal?: AbortSignal;
            dateFrom?: string;
            dateTo?: string;
            limit?: number;
            location?: string;
            offset?: number;
            year?: number;
        }

        year, dateFrom, dateTo, location, limit, offset

      Returns Promise<PaginatedResponse<PlenarySession>>

      Paginated plenary session list

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

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

      Parameters

      • processId: string
      • options: { abortSignal?: AbortSignal } = {}

      Returns Promise<Procedure>

      When the procedure is not found (404)

    • 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

      • options: { abortSignal?: AbortSignal } = {}

      Returns Promise<EPEvent>

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

      Parameters

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

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

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

      Note: The EP API /speeches endpoint does not support year. Use dateFrom/dateTo (mapped to sitting-date/sitting-date-end).

      Parameters

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

      Returns Promise<PaginatedResponse<Speech>>

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

      The EP API returns only aggregate vote counts; per-MEP vote positions are not available from this endpoint.

      Parameters

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

        sessionId, topic, dateFrom, dateTo, limit, offset

      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;
            abortSignal?: AbortSignal;
            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