{"id":13157,"library":"european-parliament-mcp-server","title":"European Parliament MCP Server","description":"The `european-parliament-mcp-server` package provides a Model Context Protocol (MCP) server specifically designed to offer AI assistants structured, type-safe access to European Parliament open data. Currently at version 1.2.9, this server is built on TypeScript and runs on Node.js versions 25.0.0 and higher. It integrates parliamentary datasets covering MEPs, plenary sessions, committees, and legislative documents into AI workflows, acting as a crucial component for political intelligence and OSINT applications. The project maintains a continuous release cadence, often issuing several minor updates monthly, focusing on new MCP tools, specific European Parliament features, infrastructure enhancements, and dependency management. Key differentiators include its specialized focus on EU parliamentary data, a robust TypeScript implementation, and advanced analytical capabilities such as MEP influence scoring, coalition cohesion analysis, party defection detection, and legislative scoring.","status":"active","version":"1.2.9","language":"javascript","source_language":"en","source_url":"https://github.com/Hack23/European-Parliament-MCP-Server","tags":["javascript","mcp","mcp-server","model-context-protocol","european-parliament","open-data","api","typescript","eu-parliament"],"install":[{"cmd":"npm install european-parliament-mcp-server","lang":"bash","label":"npm"},{"cmd":"yarn add european-parliament-mcp-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add european-parliament-mcp-server","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The library primarily targets ESM. CommonJS `require` usage should explicitly access named exports.","wrong":"const EuropeanParliamentMCPServer = require('european-parliament-mcp-server').EuropeanParliamentMCPServer;","symbol":"EuropeanParliamentMCPServer","correct":"import { EuropeanParliamentMCPServer } from 'european-parliament-mcp-server';"},{"note":"Import types using `import type` for clarity and to avoid bundling issues in some build environments. This type defines configuration options for the server.","symbol":"ServerConfig","correct":"import type { ServerConfig } from 'european-parliament-mcp-server';"},{"note":"Specific analytical tools might be available as named exports from sub-paths like '/tools', providing direct access to data processing functionalities.","symbol":"getMepLegislativeScores","correct":"import { getMepLegislativeScores } from 'european-parliament-mcp-server/tools';"}],"quickstart":{"code":"import { EuropeanParliamentMCPServer, type ServerConfig } from 'european-parliament-mcp-server';\n\nasync function startMcpServer() {\n  const config: ServerConfig = {\n    port: parseInt(process.env.PORT ?? '8080', 10),\n    logLevel: process.env.NODE_ENV === 'production' ? 'info' : 'debug',\n    // The European Parliament API may require an API key for certain endpoints or higher rate limits.\n    // Configure necessary external API keys securely via environment variables.\n    apiKeys: {\n      europeanParliament: process.env.EP_API_KEY ?? '' // Placeholder for actual API key\n    },\n    // Additional configuration options may be required based on deployment and features activated\n    // e.g., database connection strings, caching settings, etc.\n    // This example assumes minimal necessary configuration to get the server running.\n  };\n\n  try {\n    const server = new EuropeanParliamentMCPServer(config);\n    await server.start();\n    console.log(`European Parliament MCP Server running on port ${config.port}`);\n    console.log('Access the server documentation at /docs once it is running.');\n  } catch (error) {\n    console.error('Failed to start European Parliament MCP Server:', error);\n    process.exit(1);\n  }\n}\n\nstartMcpServer();","lang":"typescript","description":"This quickstart demonstrates how to initialize and start the European Parliament MCP Server using a basic configuration, including environment variables for port and API keys, and logs its successful startup. It highlights minimal setup for server operation."},"warnings":[{"fix":"Update your code to use `sizeSimilarityScore` instead of `cohesionScore` for coalition pair data. Additionally, `cohesion` and `trend` fields are nulled out until vote-level data is integrated.","message":"The `cohesionScore` field in coalition pair analysis was relabeled to `sizeSimilarityScore`. Consumers using the old field name will encounter undefined values or errors.","severity":"breaking","affected_versions":">=1.2.9"},{"fix":"Review existing API calls and remove any usage of 'year' or 'date' parameters for European Parliament API interactions. Consult the latest API documentation for supported query parameters.","message":"Unsupported European Parliament API parameters (specifically 'year' and 'date') have been purged from schemas, clients, and tools. Using these parameters in requests will no longer be supported and may result in errors or incorrect query behavior.","severity":"breaking","affected_versions":">=1.2.8"},{"fix":"Ensure your development and deployment environment uses Node.js v25.0.0 or newer. Use a Node Version Manager (NVM) to easily switch or upgrade your Node.js installation.","message":"This package requires Node.js version 25.0.0 or higher. Running it on older Node.js versions will likely lead to compatibility issues, 'engine' errors, or unexpected crashes.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade to version 1.2.9 or newer to ensure `get_adopted_texts` returns appropriate responses, especially for content-pending documents, improving data integrity.","message":"The `get_adopted_texts` function in versions prior to 1.2.9 might have returned incomplete or inappropriate responses for documents with pending content, leading to data quality issues.","severity":"gotcha","affected_versions":"<1.2.9"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Upgrade your Node.js installation to version 25.0.0 or newer using `nvm install 25 && nvm use 25` or similar methods.","cause":"Attempting to run the server with an unsupported Node.js version.","error":"Error: The 'european-parliament-mcp-server' package requires Node.js version >=25.0.0. You are running vX.Y.Z."},{"fix":"Change the server's port in your configuration (e.g., `process.env.PORT = '8081'`) or terminate the process currently using the port.","cause":"Another process is already using the default server port (8080).","error":"Error: listen EADDRINUSE: address already in use :::8080"},{"fix":"Ensure you are using ESM `import { EuropeanParliamentMCPServer } from 'european-parliament-mcp-server';` and that your project is configured for ESM (e.g., `\"type\": \"module\"` in package.json).","cause":"Attempting to use `require` for ESM-only package or incorrect CommonJS import syntax for `EuropeanParliamentMCPServer`.","error":"TypeError: Cannot read properties of undefined (reading 'start')"},{"fix":"Set the `EP_API_KEY` environment variable with your valid European Parliament API key before starting the server or running relevant tools.","cause":"The server or a specific tool requires an API key for upstream European Parliament data, which was not provided in the configuration.","error":"Error: Missing European Parliament API Key. Please provide EP_API_KEY in environment variables."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}