# Class EuropeanParliamentMCPServer

Main MCP Server class for European Parliament data access

Implements the Model Context Protocol (MCP) to provide AI assistants, IDEs, and other MCP clients with structured access to European Parliament open data, including information about MEPs, plenary sessions, committees, legislative documents, and parliamentary questions.

Features:

- MCP protocol implementation with tools, resources, and prompts
- Type-safe TypeScript implementation with strict mode
- GDPR-compliant data handling
- Rate limiting and security controls
- Comprehensive error handling

Data Sources:

- European Parliament Open Data Portal (https://data.europarl.europa.eu/)
- API v2: https://data.europarl.europa.eu/api/v2/

#### Example

    const server = new EuropeanParliamentMCPServer();
    await server.start();

#### See

- https://spec.modelcontextprotocol.io/ - MCP specification
- https://data.europarl.europa.eu/ - EP Open Data Portal
- https://github.com/Hack23/ISMS-PUBLIC - ISMS compliance policies

- Defined in index.ts:127

##### Index

### Constructors

constructor

### Properties

server

### Methods

dispatchToolCall
setupHandlers
start

## Constructors

### constructor

- new EuropeanParliamentMCPServer(): EuropeanParliamentMCPServer

  #### Returns EuropeanParliamentMCPServer

  - Defined in index.ts:131

## Properties

### `Private` `Readonly` server

server: Server

- Defined in index.ts:129

## Methods

### `Private` dispatchToolCall

- dispatchToolCall(
  name: string,
  args: unknown,
  ): Promise<{ content: { text: string; type: string }[] }>
  `Internal`

  Dispatch tool calls to appropriate handlers

  #### Parameters

  - name: string

    Tool name

  - args: unknown

    Tool arguments

  #### Returns Promise<{ content: { text: string; type: string }[] }>

  Tool execution result

  - Defined in index.ts:234

### `Private` setupHandlers

- setupHandlers(): void
  `Internal`

  Set up MCP protocol handlers

  Registers handlers for:

  - Tool listing: Returns available tools with schemas
  - Tool execution: Routes tool calls to appropriate handlers

  Security:

  - All inputs validated before processing
  - Rate limiting applied per client
  - GDPR compliance enforced
  - Audit logging for all data access

  #### Returns void

  #### Throws

  If handler registration fails

  - Defined in index.ts:167

### start

- start(): Promise<void>

  Start the MCP server

  Initializes the server with stdio transport and begins listening for MCP protocol messages. The server communicates via standard input/output following the MCP specification.

  Lifecycle:

  1. Create stdio transport
  2. Connect server to transport
  3. Log startup message to stderr
  4. Begin handling MCP requests

  #### Returns Promise<void>

  Promise that resolves when server is started

  #### Throws

  If server initialization fails

  #### Example

      const server = new EuropeanParliamentMCPServer();
      await server.start();
      // Server now listening on stdio

  #### See

  https://spec.modelcontextprotocol.io/specification/architecture/

  - Defined in index.ts:267