EU Parliament Monitor - API Documentation - v0.7.0
    Preparing search index...

    Base MCP connection managing JSON-RPC 2.0 transport over stdio or HTTP gateway. Extended by domain-specific clients to add tool wrapper methods.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    serverPath: string
    connected: boolean
    process: ChildProcess | null
    requestId: number
    pendingRequests: Map<number, PendingRequest>
    connectionAttempts: number
    maxConnectionAttempts: number
    connectionRetryDelay: number
    gatewayUrl: string | null

    Gateway URL for HTTP transport mode

    gatewayApiKey: string | null

    API key for gateway authentication

    mcpSessionId: string | null

    MCP session ID returned by the gateway

    serverLabel: string

    Human-readable server name for log messages

    Methods

    • Check if using gateway HTTP transport

      Returns boolean

      True if gateway mode is active

    • Get the configured gateway URL

      Returns string | null

      Gateway URL or null if using stdio transport

    • Get the configured gateway API key

      Returns string | null

      Gateway API key or null if not set

    • Get the current MCP session ID

      Returns string | null

      Session ID returned by the gateway, or null if not yet connected

    • Validate a gateway response body, throwing on JSON-RPC errors.

      Parameters

      • contentType: string

        Response content-type header

      • body: string

        Raw response body text

      Returns void

    • Attempt a single connection via MCP Gateway (HTTP transport)

      Returns Promise<void>

    • Attempt a single connection via stdio (spawns server binary)

      Returns Promise<void>

    • Handle incoming messages from MCP server (stdio mode only)

      Parameters

      • line: string

        JSON message line from server

      Returns void

    • Send a request via MCP Gateway (HTTP transport)

      Parameters

      • method: string

        RPC method name

      • params: Record<string, unknown> = {}

        Method parameters

      Returns Promise<unknown>

      Server response

    • Send a request to the MCP server

      Parameters

      • method: string

        RPC method name

      • params: Record<string, unknown> = {}

        Method parameters

      Returns Promise<unknown>

      Server response

    • List available MCP tools

      Returns Promise<unknown>

      List of available tools

    • Call an MCP tool

      Parameters

      • name: string

        Tool name

      • args: object = {}

        Tool arguments (must be a plain object, non-null, not an array)

      Returns Promise<MCPToolResult>

      Tool execution result