Hack23/European-Parliament-MCP-Server

GitHub: Hack23/European-Parliament-MCP-Server

为AI助手提供欧洲议会开放数据结构化访问的MCP服务器,具备深度政治情报分析能力。

Stars: 4 | Forks: 4

Hack23 Logo

🏛️ 欧洲议会 MCP Server

面向欧洲议会开放数据的 Model Context Protocol Server
为 AI 助手提供对议会数据集的结构化访问及 OSINT 情报能力

European Parliament MCP Server

Model Context Protocol Server for European Parliament Open Data — providing AI assistants with structured access to MEPs, plenary sessions, committees, legislative documents, and parliamentary questions through a secure, type-safe TypeScript implementation.

MEP influence scoring (5-dimension model), Coalition cohesion & stress analysis, Party defection & anomaly detection, Cross-group comparative analysis, MEP/committee legislative scoring, Pipeline status & bottleneck detection, Committee workload & engagement analysis, MEP attendance patterns & trends, Country delegation voting & composition, Parliament-wide political landscape

[![ISMS](https://img.shields.io/badge/Hack23-ISMS-blue)](https://github.com/Hack23/ISMS-PUBLIC) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/12067/badge)](https://www.bestpractices.dev/projects/12067) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Hack23/European-Parliament-MCP-Server) ## 📊 质量指标与文档

Test Coverage Unit Test Results E2E Test Results API Documentation Documentation Portal

## 📋 概述 **欧洲议会 MCP Server** 实现了 [Model Context Protocol (MCP)](https://spec.modelcontextprotocol.io/),为 AI 助手、IDE 和其他 MCP 客户端提供对欧洲议会开放数据集的结构化访问。通过安全、类型安全的 TypeScript/Node.js 实现,访问有关 MEP(欧洲议会议员)、全体会议、委员会、立法文件和议会质询的信息。 ### 🎯 核心特性 - 🔌 **完整的 MCP 实现**:61 个工具(7 个核心 + 3 个高级 + 15 个 OSINT + 8 个第 4 阶段 + 15 个第 5 阶段 + 13 个 Feed)、9 个资源和 7 个提示词 - 🏛️ **完整的 EP API v2 覆盖**:覆盖所有欧洲议会开放数据 API 端点 - 🕵️ **OSINT 情报**:MEP 影响力评分、联盟分析、异常检测 - 🔒 **安全至上**:符合 ISMS、GDPR 就绪、SLSA Level 3 来源证明 - 🚀 **高性能**:<200ms API 响应、智能缓存、速率限制 - 📊 **类型安全**:TypeScript 严格模式 + Zod 运行时验证 - 🧪 **完善测试**:80%+ 代码覆盖率、1130+ 单元测试、23 个 E2E 测试 - 📚 **完整文档**:架构、TypeDoc API(HTML + Markdown)、安全指南 ## 🌍 Hack23 政治情报生态系统 此 MCP 服务器是 **[Hack23](https://hack23.com/)** 使命的一部分,旨在 **通过 AI 生成的新闻报道和对民主政府的实时分析来颠覆新闻业** —— 通过开源情报提高透明度和问责制。 ### 🎯 愿景:AI 驱动的民主透明度 Hack23 构建 **开源情报平台**,使公民、记者和研究人员能够实时监控民主机构。通过结合 MCP 服务器、AI 分析和开放的议会数据,我们创建以前只有资金雄厚的游说组织才能获得的自动化情报产品。 ### 🔗 Hack23 项目 ### 🇪🇺 EU Parliament Monitor
EU Parliament Monitor

European Parliament Intelligence Platform — an automated multi-language news platform that monitors EU Parliament activities with 14-language support, covering plenary sessions, committee reports, propositions, and breaking news.

[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Hack23/euparliamentmonitor/badge)](https://scorecard.dev/viewer/?uri=github.com/Hack23/euparliamentmonitor) [![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://github.com/Hack23/euparliamentmonitor/attestations) [![News Generation](https://github.com/Hack23/euparliamentmonitor/actions/workflows/news-generation.yml/badge.svg)](https://github.com/Hack23/euparliamentmonitor/actions/workflows/news-generation.yml) [![Test and Report](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/31736f062f075816.svg)](https://github.com/Hack23/euparliamentmonitor/actions/workflows/test-and-report.yml) [![License](https://img.shields.io/github/license/Hack23/euparliamentmonitor)](https://github.com/Hack23/euparliamentmonitor/blob/main/LICENSE) [![ISMS](https://img.shields.io/badge/Hack23-ISMS-blue)](https://github.com/Hack23/ISMS-PUBLIC) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Hack23/euparliamentmonitor) ### 🗳️ Riksdagsmonitor
Riksdagsmonitor

Swedish Parliament Intelligence Platform monitoring political activity in Sweden's Riksdag with systematic transparency through real-time analysis and 50+ years of historical data (1971-2024).

[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Hack23/riksdagsmonitor/badge)](https://scorecard.dev/viewer/?uri=github.com/Hack23/riksdagsmonitor) [![Quality Checks](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/9385aecb81075817.svg)](https://github.com/Hack23/riksdagsmonitor/actions/workflows/quality-checks.yml) [![Dependency Review](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/1525cae5f4075818.svg)](https://github.com/Hack23/riksdagsmonitor/actions/workflows/dependency-review.yml) [![License](https://img.shields.io/github/license/Hack23/riksdagsmonitor)](https://github.com/Hack23/riksdagsmonitor/blob/main/LICENSE) [![ISMS](https://img.shields.io/badge/Hack23-ISMS-blue)](https://github.com/Hack23/ISMS-PUBLIC) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Hack23/riksdagsmonitor) ### 🔍 Citizen Intelligence Agency
CIA Logo

Political transparency platform monitoring Swedish political activity with data-driven insights, analytics, dashboard visualizations, and accountability metrics.

[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/770/badge)](https://bestpractices.coreinfrastructure.org/projects/770) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Hack23/cia/badge)](https://scorecard.dev/viewer/?uri=github.com/Hack23/cia) [![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://slsa.dev/spec/v1.0/levels) [![Verify & Deploy](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/9f7684037f075819.svg)](https://github.com/Hack23/cia/actions/workflows/release.yml) [![Scorecard supply-chain security](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/9ddff0d58b075820.svg)](https://github.com/Hack23/cia/actions/workflows/scorecards.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Hack23/cia)

Security Architecture Architecture Diagrams Workflows Documentation Performance Guide

## 🔐 安全与合规

OpenSSF Scorecard SLSA 3 SBOM SBOM Quality Build Attestations

ISO 27001 NIST CSF 2.0 CIS Controls GDPR

## 🚀 快速开始 ### 前置条件 - Node.js 24.x 或更高版本 - npm 10.x 或更高版本 - Git ### 安装 #### 选项 1:从 npm 安装(推荐) ``` # 全局安装该 package npm install -g european-parliament-mcp-server # 或者在您的项目中将其作为 dependency 安装 npm install european-parliament-mcp-server ``` #### 选项 2:从源码安装 ``` # Clone 该 repository git clone https://github.com/Hack23/European-Parliament-MCP-Server.git cd European-Parliament-MCP-Server # 安装 dependencies npm install # Build 该 project npm run build # 运行 tests npm test ``` ### 配合 MCP 客户端使用 #### Claude Desktop 配置(npm 安装) 添加到您的 `claude_desktop_config.json`: ``` { "mcpServers": { "european-parliament": { "command": "npx", "args": ["european-parliament-mcp-server"], "env": { "EP_API_KEY": "your-api-key-if-needed" } } } } ``` #### Claude Desktop 配置(源码安装) 添加到您的 `claude_desktop_config.json`: ``` { "mcpServers": { "european-parliament": { "command": "node", "args": ["/path/to/European-Parliament-MCP-Server/dist/index.js"], "env": { "EP_API_KEY": "your-api-key-if-needed" } } } } ``` #### VS Code 扩展 在 `.vscode/mcp.json` 中配置: ``` { "servers": { "european-parliament": { "type": "stdio", "command": "node", "args": ["./dist/index.js"] } } } ``` #### Cursor IDE 配置 添加到 `~/.cursor/mcp.json`(或项目级 `.cursor/mcp.json`): ``` { "mcpServers": { "european-parliament": { "command": "npx", "args": ["european-parliament-mcp-server"], "env": {} } } } ``` ## 📚 文档 ### 🌐 文档门户 **[📖 完整文档站点](https://hack23.github.io/European-Parliament-MCP-Server/)** - 实时文档门户,包含: - 📖 **[API 参考 (HTML)](https://hack23.github.io/European-Parliament-MCP-Server/api/)** - TypeDoc 生成的 API 文档,支持搜索、层次结构导航和完整类型信息 - 📖 **[API 参考 (Markdown)](https://hack23.github.io/European-Parliament-MCP-Server/api-markdown/)** - SEO 友好的 Markdown API 文档 - 📊 **[覆盖率报告](https://hack23.github.io/European-Parliament-MCP-Server/coverage/)** - 测试覆盖率分析 - ✅ **[测试报告](https://hack23.github.io/European-Parliament-MCP-Server/test-results/)** - 单元测试和 E2E 测试结果 - 🔐 **构建证明** - SLSA Level 3 来源证明 - 📦 **SBOM** - 软件物料清单 - 🗺️ **[站点地图](https://hack23.github.io/European-Parliament-MCP-Server/api/sitemap.xml)** - 为搜索引擎自动生成的站点地图 ### 生成的 API 文档 API 文档使用 [TypeDoc](https://typedoc.org/) 及以下插件生成: | 插件 | 用途 | |--------|---------| | **typedoc** | 核心 HTML 文档生成器 | | **typedoc-plugin-markdown** | 生成 SEO 友好的 Markdown 和 HTML | | **typedoc-plugin-mdn-links** | 将 TypeScript 内置类型链接到 MDN 文档 | | **typedoc-plugin-zod** | 将 Zod schema 定义渲染为可读的类型文档 | 本地生成文档: ``` npm run docs # HTML API docs → docs/api/ npm run docs:md # Markdown API docs → docs/api-markdown/ npm run docs:build # Full documentation build (HTML + MD + coverage + test reports) ``` ### 核心文档 - [**API 使用指南**](./API_USAGE_GUIDE.md) - 包含示例的完整工具文档 - [**架构图**](./ARCHITECTURE_DIAGRAMS.md) - C4 模型图和数据流 - [**故障排除指南**](#troubleshooting) - 常见问题及解决方案 - [**开发者指南**](./DEVELOPER_GUIDE.md) - 开发工作流和贡献指南 - [**部署指南**](./DEPLOYMENT_GUIDE.md) - Claude Desktop、VS Code、Docker 设置 - [**性能指南**](./PERFORMANCE_GUIDE.md) - 优化策略 - [**文档即代码指南**](./DOCUMENTATION_AS_CODE.md) - 文档生成方式 ### 附加文档 - [**ARCHITECTURE.md**](./ARCHITECTURE.md) - 完整的架构和设计文档 - [**SECURITY.md**](./SECURITY.md) - 安全策略和漏洞披露 - [**SECURITY_HEADERS.md**](./SECURITY_HEADERS.md) - API 安全头实现 - [**docs/SBOM.md**](./docs/SBOM.md) - 软件物料清单文档 - [**CONTRIBUTING.md**](./CONTRIBUTING.md) - 贡献指南 - [**CODE_OF_CONDUCT.md**](./CODE_OF_CONDUCT.md) - 社区行为准则 - [**.github/copilot-instructions.md**](./.github/copilot-instructions.md) - GitHub Copilot 开发指南 - [**.github/agents/README.md**](./.github/agents/README.md) - 自定义 GitHub Copilot 代理 - [**.github/skills/README.md**](./.github/skills/README.md) - 可复用的技能模式 ## 🏗️ 架构概述 ``` graph TB Client[MCP Client
Claude / VS Code / Cursor] -->|MCP Protocol stdio| Server[EP MCP Server
TypeScript/Node.js] subgraph "MCP Server (src/)" direction TB Tools[🔧 46 Tools
getMEPs · analyzeCoalition
assessMepInfluence · …] Resources[📦 9 Resources
ep://meps/{id}
ep://procedures/{id} · …] Prompts[💬 7 Prompts
mep_briefing
coalition_analysis · …] end Server --> Tools Server --> Resources Server --> Prompts subgraph "Infrastructure" Cache[LRU Cache
500 entries · 15 min TTL] RateLimiter[Rate Limiter
100 req / 15 min] AuditLog[Audit Logger
GDPR Article 30] end Tools --> EPClient[EuropeanParliamentClient
Facade → 8 sub-clients] Resources --> EPClient EPClient --> Cache EPClient --> RateLimiter EPClient --> AuditLog EPClient -->|HTTPS/TLS 1.3| EPAPI[European Parliament
Open Data API v2
data.europarl.europa.eu] style Server fill:#4CAF50,stroke:#2E7D32,color:#fff style EPClient fill:#2196F3,stroke:#1565C0,color:#fff style EPAPI fill:#9C27B0,stroke:#6A1B9A,color:#fff style Cache fill:#FF9800,stroke:#E65100,color:#fff style RateLimiter fill:#F44336,stroke:#B71C1C,color:#fff style AuditLog fill:#607D8B,stroke:#37474F,color:#fff ``` **数据流:** MCP 客户端发送工具调用 → 服务器验证输入(Zod) → EP 客户端检查缓存 → 若未命中,则从 EP API 获取数据(受速率限制) → 响应被缓存并以结构化 JSON 返回。所有个人数据访问均按照 GDPR 第 30 条进行审计日志记录。 ## 🔌 MCP 工具(共 61 个) **61 个工具**按功能组织 —— 优先是 OSINT 情报,其次是分析、数据访问、Feed 端点和参考工具。每个工具都包含 Zod 输入验证、缓存和速率限制。 ### 🕵️ OSINT 情报工具(15 个) | 工具 | 描述 | 关键参数 | 输出 | |------|-------------|----------------|--------| | [`correlate_intelligence`](./API_USAGE_GUIDE.md#tool-correlate_intelligence) | 跨工具 OSINT 关联引擎 —— 将影响力、异常、联盟和网络信号融合为统一的情报警报 | mepIds(必填)、groups、sensitivityLevel | 带严重性和置信度的关联警报 | | [`assess_mep_influence`](./API_USAGE_GUIDE.md#tool-assess_mep_influence) | MEP 影响力评分(5 维度模型) | mepId(必填)、dateFrom、dateTo、includeDetails | 影响力记分卡 | | [`detect_voting_anomalies`](./API_USAGE_GUIDE.md#tool-detect_voting_anomalies) | 党派叛逃与异常检测 | mepId、groupId、sensitivityThreshold | 异常报告 | | [`analyze_coalition_dynamics`](./API_USAGE_GUIDE.md#tool-analyze_coalition_dynamics) | 联盟凝聚力与压力分析 | groupIds、dateFrom、minimumCohesion | 联盟指标 | | [`early_warning_system`](./API_USAGE_GUIDE.md#tool-early_warning_system) | 检测新兴的政治变动和联盟裂痕 | sensitivity、focusArea | 带严重性级别和稳定性评分的警告 | | [`comparative_intelligence`](./API_USAGE_GUIDE.md#tool-comparative_intelligence) | 跨维度比较 2-10 名 MEP 的活动 | mepIds(必填)、dimensions | 排名档案、相关性矩阵、聚类分析 | | [`network_analysis`](./API_USAGE_GUIDE.md#tool-network_analysis) | 通过委员会共同成员关系分析 MEP 关系网络 | mepId、analysisType、depth | 带中心性评分的网络图 | | [`sentiment_tracker`](./API_USAGE_GUIDE.md#tool-sentiment_tracker) | 政治团体机构立场评分 | groupId、timeframe | 立场评分和极化指数 | | [`generate_political_landscape`]() | 议会层面的政治版图 | dateFrom、dateTo | 版图概览 | | [`compare_political_groups`](./API_USAGE_GUIDE.md#tool-compare_political_groups) | 跨团体比较分析 | groupIds(必填)、dimensions、dateFrom | 比较矩阵 | | [`analyze_legislative_effectiveness`](./API_USAGE_GUIDE.md#tool-analyze_legislative_effectiveness) | MEP/委员会立法评分 | subjectType(必填)、subjectId(必填)、dateFrom | 有效性评分 | | [`monitor_legislative_pipeline`](./API_USAGE_GUIDE.md#tool-monitor_legislative_pipeline) | 管道状态与瓶颈检测 | committee、status、limit | 管道状态 | | [`analyze_committee_activity`](./API_USAGE_GUIDE.md#tool-analyze_committee_activity) | 委员会工作量和参与度分析 | committeeId(必填)、dateFrom、dateTo | 活动报告 | | [`track_mep_attendance`](./API_USAGE_GUIDE.md#tool-track_mep_attendance) | MEP 出勤模式和趋势 | mepId、country、groupId、dateFrom、dateTo、limit | 出勤报告 | | [`analyze_country_delegation`](./API_USAGE_GUIDE.md#tool-analyze_country_delegation) | 国家代表团投票和组成 | country(必填)、dateFrom、dateTo | 代表团分析 | ### 📊 高级分析工具(4 个) | 工具 | 描述 | 关键参数 | 输出 | |------|-------------|----------------|--------| | [`get_all_generated_stats`](./API_USAGE_GUIDE.md#tool-get_all_generated_stats) | 预计算的 EP 活动统计数据(2004-2026),包含排名、预测、政治版图和 [30 项 OSINT 衍生情报指标](./EP_POLITICAL_LANDSCAPE.md),包括 3 轴政治罗盘 | yearFrom、yearTo、category、includePredictions | 统计对象 | | [`analyze_voting_patterns`](./API_USAGE_GUIDE.md#tool-analyze_voting_patterns) | 分析 MEP 投票行为 | mepId(必填)、dateFrom、compareWithGroup | 分析对象 | | [`track_legislation`](./API_USAGE_GUIDE.md#tool-track_legislation) | 追踪立法程序 | procedureId(必填) | 程序对象 | | [`generate_report`](./API_USAGE_GUIDE.md#tool-generate_report) | 生成分析报告 | reportType(必填)、subjectId、dateFrom | 报告对象 | ### 👤 MEP 工具(7 个) | 工具 | 描述 | 关键参数 | EP API 端点 | |------|-------------|----------------|-----------------| | [`get_meps`](./API_USAGE_GUIDE.md#tool-get_meps) | 列出带筛选条件的 MEP | country、group、committee、limit | `GET /meps` | | [`get_mep_details`](./API_USAGE_GUIDE.md#tool-get_mep_details) | 详细的 MEP 信息 | id(必填) | `GET /meps/{id}` | | [`get_current_meps`](./API_USAGE_GUIDE.md#tool-get_current_meps) | 当前活跃的 MEP 及其现任任期 | limit、offset | `GET /meps/show-current` | | [`get_incoming_meps`](./API_USAGE_GUIDE.md#tool-get_incoming_meps) | 本届任期新到任的 MEP | limit、offset | `GET /meps/show-incoming` | | [`get_outgoing_meps`](./API_USAGE_GUIDE.md#tool-get_outgoing_meps) | 本届任期离任的 MEP | limit、offset | `GET /meps/show-outgoing` | | [`get_homonym_meps`](./API_USAGE_GUIDE.md#tool-get_homonym_meps) | 同名 MEP(消歧) | limit、offset | `GET /meps/show-homonyms` | | [`get_mep_declarations`](./API_USAGE_GUIDE.md#tool-get_mep_declarations) | MEP 财务利益申报 | docId、year、limit | `GET /meps-declarations`、`GET /meps-declarations/{id}` | ### 🏛️ 全体会议与会议工具(9 个) | 工具 | 描述 | 关键参数 | EP API 端点 | |------|-------------|----------------|-----------------| | [`get_plenary_sessions`](./API_USAGE_GUIDE.md#tool-get_plenary_sessions) | 列出全体会议/会议,或按 eventId 获取单个会议 | dateFrom、dateTo、eventId、limit | `GET /meetings`、`GET /meetings/{id}` | | [`get_voting_records`](./API_USAGE_GUIDE.md#tool-get_voting_records) | 检索汇总投票记录(不含每位 MEP 的立场) | sessionId、topic、dateFrom | `GET /meetings/{id}/vote-results` | | [`get_speeches`](./API_USAGE_GUIDE.md#tool-get_speeches) | 全体会议发言和辩论贡献 | speechId、dateFrom、dateTo、limit | `GET /speeches`、`GET /speeches/{id}` | | [`get_events`](./API_USAGE_GUIDE.md#tool-get_events) | EP 事件(听证会、会议、研讨会) | eventId、dateFrom、dateTo、limit | `GET /events`、`GET /events/{id}` | | [`get_meeting_activities`](./API_USAGE_GUIDE.md#tool-get_meeting_activities) | 关联到全体会议的活动 | sittingId(必填)、limit | `GET /meetings/{id}/activities` | | [`get_meeting_decisions`](./API_USAGE_GUIDE.md#tool-get_meeting_decisions) | 全体会议做出的决定 | sittingId(必填)、limit | `GET /meetings/{id}/decisions` | | [`get_meeting_foreseen_activities`](./API_USAGE_GUIDE.md#tool-get_meeting_foreseen_activities) | 即将召开会议的计划议程项目 | sittingId(必填)、limit | `GET /meetings/{id}/foreseen-activities` | | [`get_meeting_plenary_session_documents`](./API_USAGE_GUIDE.md#tool-get_meeting_plenary_session_documents) | 关联到特定会议的全体会议文件 | sittingId(必填)、limit、offset | `GET /meetings/{id}/plenary-session-documents` | | [`get_meeting_plenary_session_document_items`](./API_USAGE_GUIDE.md#tool-get_meeting_plenary_session_document_items) | 特定全体会议的议程项目文件 | sittingId(必填)、limit、offset | `GET /meetings/{id}/plenary-session-document-items` | ### 🏢 委员会工具(2 个) | 工具 | 描述 | 关键参数 | EP API 端点 | |------|-------------|----------------|-----------------| | [`get_committee_info`](./API_USAGE_GUIDE.md#tool-get_committee_info) | 委员会/机构信息,或所有现任机构 | id、abbreviation、showCurrent | `GET /corporate-bodies`、`GET /corporate-bodies/show-current` | | [`get_committee_documents`](./API_USAGE_GUIDE.md#tool-get_committee_documents) | 委员会文件和草案 | docId、year、limit | `GET /committee-documents`、`GET /committee-documents/{id}` | ### 📄 文档工具(7 个) | 工具 | 描述 | 关键参数 | EP API 端点 | |------|-------------|----------------|-----------------| | [`search_documents`](./API_USAGE_GUIDE.md#tool-search_documents) | 搜索文档或按 docId 获取单个文档 | keyword、docId、documentType、dateFrom | `GET /documents`、`GET /documents/{id}` | | [`get_adopted_texts`](./API_USAGE_GUIDE.md#tool-get_adopted_texts) | 已通过的立法文本和决议 | docId、year、limit | `GET /adopted-texts`、`GET /adopted-texts/{id}` | | [`get_plenary_documents`](./API_USAGE_GUIDE.md#tool-get_plenary_documents) | 全体会议立法文件 | docId、year、limit | `GET /plenary-documents`、`GET /plenary-documents/{id}` | | [`get_plenary_session_documents`](./API_USAGE_GUIDE.md#tool-get_plenary_session_documents) | 会议议程、会议记录、投票名单 | docId、limit | `GET /plenary-session-documents`、`GET /plenary-session-documents/{id}` | | [`get_plenary_session_document_items`](./API_USAGE_GUIDE.md#tool-get_plenary_session_document_items) | 会议文件中的单个项目 | limit、offset | `GET /plenary-session-documents-items` | | [`get_external_documents`](./API_USAGE_GUIDE.md#tool-get_external_documents) | 非 EP 文件(理事会、委员会) | docId、year、limit | `GET /external-documents`、`GET /external-documents/{id}` | | [`get_parliamentary_questions`](./API_USAGE_GUIDE.md#tool-get_parliamentary_questions) | 议会问答,或按 docId 获取单个问题 | type、author、topic、docId | `GET /parliamentary-questions`、`GET /parliamentary-questions/{id}` | ### ⚖️ 立法程序工具(4 个) | 工具 | 描述 | 关键参数 | EP API 端点 | |------|-------------|----------------|-----------------| | [`get_procedures`](./API_USAGE_GUIDE.md#tool-get_procedures) | 立法程序,或按 processId 获取单个程序 | processId、year、limit | `GET /procedures`、`GET /procedures/{id}` | | [`get_procedure_events`](./API_USAGE_GUIDE.md#tool-get_procedure_events) | 立法程序的时间线事件 | processId(必填)、limit | `GET /procedures/{id}/events` | | [`get_procedure_event_by_id`](./API_USAGE_GUIDE.md#tool-get_procedure_event_by_id) | 关联到立法程序的特定事件 | processId(必填)、eventId(必填) | `GET /procedures/{id}/events/{event-id}` | | [`get_controlled_vocabularies`](./API_USAGE_GUIDE.md#tool-get_controlled_vocabularies) | 标准化分类术语 | vocId、limit | `GET /controlled-vocabularies`、`GET /controlled-vocabularies/{id}` | ### 📡 Feed 工具(13 个) 用于监控 EP API 所有类别最近更新数据的实时变更 Feed。每个 Feed 都支持可配置的时间范围(今天、一天、一周、一个月、自定义)。 | 工具 | 描述 | 关键参数 | EP API 端点 | |------|-------------|----------------|-----------------| | [`get_meps_feed`](./API_USAGE_GUIDE.md#tool-get_meps_feed) | 最近更新的 MEP | timeframe、startDate | `GET /meps/feed` | | [`get_events_feed`](./API_USAGE_GUIDE.md#tool-get_events_feed) | 最近更新的事件 | timeframe、startDate、activityType | `GET /events/feed` | | [`get_procedures_feed`](./API_USAGE_GUIDE.md#tool-get_procedures_feed) | 最近更新的程序 | timeframe、startDate、processType | `GET /procedures/feed` | | [`get_adopted_texts_feed`](./API_USAGE_GUIDE.md#tool-get_adopted_texts_feed) | 最近更新的通过文本 | timeframe、startDate、workType | `GET /adopted-texts/feed` | | [`get_mep_declarations_feed`](./API_USAGE_GUIDE.md#tool-get_mep_declarations_feed) | 最近更新的 MEP 申报 | timeframe、startDate、workType | `GET /meps-declarations/feed` | | [`get_documents_feed`](./API_USAGE_GUIDE.md#tool-get_documents_feed) | 最近更新的文件 | timeframe、startDate | `GET /documents/feed` | | [`get_plenary_documents_feed`](./API_USAGE_GUIDE.md#tool-get_plenary_documents_feed) | 最近更新的全体会议文件 | timeframe、startDate | `GET /plenary-documents/feed` | | [`get_committee_documents_feed`](./API_USAGE_GUIDE.md#tool-get_committee_documents_feed) | 最近更新的委员会文件 | timeframe、startDate | `GET /committee-documents/feed` | | [`get_plenary_session_documents_feed`](./API_USAGE_GUIDE.md#tool-get_plenary_session_documents_feed) | 最近更新的全体会议文件 | timeframe、startDate | `GET /plenary-session-documents/feed` | | [`get_external_documents_feed`](./API_USAGE_GUIDE.md#tool-get_external_documents_feed) | 最近更新的外部文件 | timeframe、startDate、workType | `GET /external-documents/feed` | | [`get_parliamentary_questions_feed`](./API_USAGE_GUIDE.md#tool-get_parliamentary_questions_feed) | 最近更新的议会质询 | timeframe、startDate | `GET /parliamentary-questions/feed` | | [`get_corporate_bodies_feed`](./API_USAGE_GUIDE.md#tool-get_corporate_bodies_feed) | 最近更新的机构团体 | timeframe、startDate | `GET /corporate-bodies/feed` | | [`get_controlled_vocabularies_feed`](./API_USAGE_GUIDE.md#tool-get_controlled_vocabularies_feed) | 最近更新的受控词汇表 | timeframe、startDate | `GET /controlled-vocabularies/feed` | 📖 **[完整的 TypeDoc API 文档 →](https://hack23.github.io/European-Parliament-MCP-Server/api/)** · **[Markdown API 文档 →](https://hack23.github.io/European-Parliament-MCP-Server/api-markdown/)** ### 常见用例 **研究特定 MEP:** ``` 1. Find MEP: get_meps → {country: "SE"} 2. Get details: get_mep_details → {id: "MEP-123"} 3. Analyze voting: analyze_voting_patterns → {mepId: "MEP-123"} 4. Generate report: generate_report → {reportType: "MEP_ACTIVITY", subjectId: "MEP-123"} ``` **追踪立法:** ``` 1. Search documents: search_documents → {keywords: "climate change"} 2. Track procedure: track_legislation → {procedureId: "2024/0001(COD)"} 3. Get voting records: get_voting_records → {topic: "climate"} ``` **委员会分析:** ``` 1. Get committee: get_committee_info → {abbreviation: "ENVI"} 2. List members: get_meps → {committee: "ENVI"} 3. Generate report: generate_report → {reportType: "COMMITTEE_PERFORMANCE", subjectId: "COMM-ENVI"} ``` **OSINT 情报分析:** ``` 1. Score MEP influence: assess_mep_influence → {mepId: "MEP-123"} 2. Detect anomalies: detect_voting_anomalies → {mepId: "MEP-123"} 3. Analyze coalitions: analyze_coalition_dynamics → {groupIds: ["EPP", "S&D"]} 4. Compare groups: compare_political_groups → {groupIds: ["EPP", "S&D", "Renew"]} 5. Pipeline status: monitor_legislative_pipeline → {committee: "ENVI"} 6. Country delegation: analyze_country_delegation → {country: "SE"} 7. Political landscape: generate_political_landscape → {} ``` 🎯 **[更多用例和示例 →](./API_USAGE_GUIDE.md#common-use-cases)** ### 📝 MCP 提示词 预构建的情报分析提示词模板: | 提示词 | 描述 | 参数 | |--------|-------------|-----------| | `mep_briefing` | 全面的 MEP 情报简报 | mepId(必填)、period? | | `coalition_analysis` | 联盟动态和投票集团分析 | policyArea?、period? | | `legislative_tracking` | 立法程序追踪报告 | procedureId?、committee? | | `political_group_comparison` | 多维度团体比较 | groups? | | `committee_activity_report` | 委员会工作量和参与度 | committeeId(必填) | | `voting_pattern_analysis` | 投票模式趋势检测 | topic?、mepId? | | `country_delegation_analysis` | 国家代表团组成和活动 | country(必填)、period? | ### 📦 MCP 资源 通过 EP 资源 URI 直接访问数据: | 资源 URI | 描述 | |-------------|-------------| | `ep://meps` | 所有现任 MEP 列表 | | `ep://meps/{mepId}` | 单个 MEP 档案 | | `ep://committees/{committeeId}` | 委员会信息 | | `ep://plenary-sessions` | 全体会议 | | `ep://votes/{sessionId}` | 会议投票记录 | | `ep://political-groups` | 政治团体列表 | | `ep://procedures/{procedureId}` | 立法程序详情 | | `ep://plenary/{plenaryId}` | 单次全体会议详情 | | `ep://documents/{documentId}` | 立法文件详情 | ## 🗺️ 全球政治 MCP 服务器与 OSINT 覆盖范围 欧洲议会 MCP 服务器是日益增长的**政治和政府开放数据 MCP 服务器**生态系统的一部分,支持对全球民主机构的 AI 驱动 OSINT 分析。以下是最全面的政治和政府 MCP 服务器目录。 ### 🏛️ 议会与立法 MCP 服务器 | 国家 | 服务器 | 数据源 | 覆盖范围 | |---------|--------|-------------|----------| | 🇪🇺 **欧盟** | [**欧洲议会 MCP Server**](https://github.com/Hack23/European-Parliament-MCP-Server) | data.europarl.europa.eu | MEP、投票、立法、委员会、质询 — **47 个工具**(15 个 OSINT) | | 🇺🇸 **美国** | [Congress.gov API MCP Server](https://github.com/bsmi021/mcp-congress_gov_server) | congress.gov | 法案、成员、投票、委员会(TypeScript,v3 API) | | 🇺🇸 **美国** | [CongressMCP](https://github.com/amurshak/congressMCP) | congress.gov | 实时国会数据 — 法案、投票、成员 | | 🇺🇸 **美国** | [Congress.gov MCP](https://github.com/AshwinSundar/congress_gov_mcp) | congress.gov | 非官方 Congress.gov API 访问 | | 🇬🇧 **英国** | [Parliament MCP](https://github.com/i-dot-ai/parliament-mcp) | parliament.uk | Hansard、成员、辩论、表决 | | 🇸🇪 **瑞典** | [Riksdag & Regering MCP](https://github.com/isakskogstad/Riksdag-Regering-MCP) | riksdagen.se | 瑞典议会与政府数据([riksdagsmonitor.com](https://riksdagsmonitor.com/) 使用) | | 🇳🇱 **荷兰** | [OpenTK MCP](https://github.com/r-huijts/opentk-mcp) | tweedekamer.nl | 荷兰议会(二院)文件 | | 🇵🇱 **波兰** | [Parliament of Poland MCP](https://github.com/pkolawa/parliament-poland-mcp-server) | sejm.gov.pl | 成员、投票、委员会 | | 🇵🇱 **波兰** | [Sejm MCP](https://github.com/janisz/sejm-mcp) | api.sejm.gov.pl | 议会数据 + 立法 | | 🇮🇱 **以色列** | [Knesset MCP Server](https://github.com/zohar/knesset-mcp) | knesset.gov.il | 议会 API | | 🇧🇷 **巴西** | [Senado BR MCP](https://mcpservers.org/servers/sidneybissoli/senado-br-mcp) | senado.leg.br | 联邦参议院 — 成员、提案、投票 | ### 📊 政府开放数据 MCP 服务器 | 国家 | 服务器 | 数据源 | 覆盖范围 | |---------|--------|-------------|----------| | 🇺🇸 **美国** | [USA Spending MCP](https://github.com/thsmale/usaspending-mcp-server) | usaspending.gov | 联邦支出数据 | | 🇺🇸 **美国** | [Open Census MCP](https://mcpservers.org/servers/brockwebb/open-census-mcp-server) | census.gov | 人口统计与数据(自然语言) | | 🇺🇸 **美国** | [Data.gov MCP Server](https://github.com/melaodoidao/datagov-mcp-server) | data.gov | 联邦数据集目录 | | 🇺🇸 **美国** | [CMS Data.gov MCP](https://github.com/clarifyhealth/cms-datagov-mcp-server) | data.cms.gov | 医疗数据 — 搜索/过滤/分页 | | 🇺🇸 **美国** | [SEC EDGAR MCP](https://github.com/stefanoamorelli/sec-edgar-mcp) | sec.gov | SEC 文件 — 年报、内部人员数据 | | 🇺🇸 **美国** | [NPS MCP](https://github.com/amysatterlee/nps_mcp) | nps.gov | 国家公园管理局 API | | 🇸🇪 **瑞典** | [SCB MCP Server](https://mcpservers.org/servers/isakskogstad/scb-mcp) | scb.se | 瑞典官方统计 | | 🇸🇪 **瑞典** | [Skolverket MCP](https://mcpservers.org/servers/ksaklfszf921/skolverket-mcp) | skolverket.se | 瑞典国家教育局 | | 🇫🇷 **法国** | [data.gouv.fr MCP](https://github.com/datagouv/datagouv-mcp) | data.gouv.fr | 国家开放数据平台 | | 🇫🇷 **法国** | [Data Gouv MCP Server](https://mcpservers.org/servers/csonigo/datagouv-mcp-server) | data.gouv.fr | 公司和组织搜索 | | 🇬🇧 **英国** | [Planning Data MCP](https://github.com/alizoli/planningdatagovuk-api) | planning.data.gov.uk | 规划和土地利用数据 | | 🇬🇧 **英国** | [Property Prices MCP](https://github.com/joemclo/property-prices-mcp) | landregistry.data.gov.uk | 房价搜索 | | 🇳🇱 **荷兰** | [CBS Open Data MCP](https://github.com/dstotijn/mcp-cbs-cijfers-open-data) | cbs.nl | 荷兰统计局 | | 🇮🇱 **以色列** | [Data.gov.il MCP](https://github.com/DavidOsherProceed/data-gov-il-mcp) | data.gov.il | 国家 CKAN 数据门户 | | 🇮🇱 **以色列** | [DataGov Israel MCP](https://github.com/aviveldan/datagov-mcp) | data.gov.il | 替代实现 + 可视化 | | 🇮🇱 **以色列** | [Israel Statistics MCP](https://github.com/reuvenaor/israel-statistics-mcp) | cbs.gov.il | CPI 和经济时间序列 | | 🇮🇱 **以色列** | [BudgetKey MCP](https://github.com/OpenBudget/budgetkey-mcp) | open-budget.org.il | 国家预算、合同、补助 | | 🇹🇷 **土耳其** | [Mevzuat MCP](https://mcpservers.org/servers/MCP-Mirror/saidsurucu_mevzuat-mcp) | mevzuat.gov.tr | 立法系统 — 搜索/检索法律 | | 🇭🇰 **香港** | [HK Data.gov.hk MCP](https://github.com/hkopenai/hk-datagovhk-mcp-server) | data.gov.hk | 香港开放数据门户 | | 🇲🇾 **马来西亚** | [Data.gov.my MCP](https://github.com/manfye/data-dosm-mcp-nodejs) | data.gov.my | 国家数据门户 | | 🇮🇳 **印度** | [Data.gov.in MCP](https://github.com/adwait-ai/mcp_data_gov_in) | data.gov.in | 语义搜索 + 数据集访问 | | 🇸🇬 **新加坡** | [Gahmen MCP Server](https://github.com/aniruddha-adhikary/gahmen-mcp) | data.gov.sg | 政府数据集 + CKAN 搜索 | | 🇸🇬 **新加坡** | [Singapore Data MCPs](https://github.com/prezgamer/Singapore-Data-MCPs) | data.gov.sg | 多个服务器(停车、健康、数据集) | | 🇦🇺 **澳大利亚** | [ABS MCP Server](https://github.com/seansoreilly/mcp-server-abs) | abs.gov.au | 统计局(SDMX-ML) | ### 🌍 多门户与通用 MCP 服务器 | 范围 | 服务器 | 平台 | 覆盖范围 | |-------|--------|----------|----------| | 🌐 **全球 (CKAN)** | [CKAN MCP Server](https://github.com/ondata/ckan-mcp-server) | CKAN 门户 | 适用于任何基于 CKAN 的开放数据门户的通用服务器 | | 🌐 **全球 (Socrata)** | [OpenGov MCP Server](https://github.com/srobbin/opengov-mcp-server) | Socrata 门户 | 城市/县/州/联邦 Socrata 驱动的门户 | ### 🕵️ OSINT 情报能力对比 | 能力 | 🇪🇺 欧盟议会 MCP | 🇺🇸 Congress.gov MCP | 🇬🇧 英国议会 MCP | 🇸🇪 Riksdag MCP | |------------|----------------------|---------------------|----------------------|-----------------| | 成员画像 | ✅ 5 维度影响力模型 | ✅ 基础画像 | ✅ 基础画像 | ✅ 基础画像 | | 投票分析 | ✅ 异常检测 + 模式 | ✅ 点名投票 | ✅ 表决记录 | ✅ 投票记录 | | 联盟动态 | ✅ 凝聚力与压力分析 | ❌ | ❌ | ❌ | | 委员会情报 | ✅ 工作量与参与度指标 | ✅ 委员会数据 | ✅ 委员会数据 | ❌ | | 立法管道 | ✅ 瓶颈检测 + 预测 | ✅ 法案追踪 | ✅ 法案追踪 | ✅ 法案追踪 | | 国家代表团分析 | ✅ 国家凝聚力指标 | N/A | N/A | N/A | | 政治版图 | ✅ 议会层面的态势感知 | ❌ | ❌ | ❌ | | 出勤追踪 | ✅ 趋势检测 + 参与度评分 | ❌ | ❌ | ❌ | | GDPR 合规 | ✅ 隐私优先设计 | N/A | N/A | ✅ | | MCP 提示词和资源 | ✅ 7 个提示词 + 9 个资源 | ❌ | ❌ | ❌ | | 工具数量 | **47 个工具** | 约 5 个工具 | 约 5 个工具 | 约 4 个工具 | ## 🏛️ 欧洲议会数据集 ### 完整的 EP API v2 覆盖 所有 55 个 [欧洲议会开放数据 API v2](https://data.europarl.europa.eu/en/developer-corner/opendata-api) 端点均已完全覆盖 — 41 个核心数据端点、13 个 Feed 端点和 1 个可选端点(`/procedures/{id}/events/{event-id}`): | 类别 | 端点 | MCP 工具 | |----------|-----------|-----------| | **MEPs** | `/meps`、`/meps/{id}`、`/meps/show-current`、`/meps/show-incoming`、`/meps/show-outgoing`、`/meps/show-homonyms` | `get_meps`、`get_mep_details`、`get_current_meps`、`get_incoming_meps`、`get_outgoing_meps`、`get_homonym_meps` | | **MEP 文件** | `/meps-declarations`、`/meps-declarations/{id}` | `get_mep_declarations` | | **机构团体** | `/corporate-bodies`、`/corporate-bodies/{id}`、`/corporate-bodies/show-current` | `get_committee_info` | | **事件** | `/events`、`/events/{id}` | `get_events` | | **会议** | `/meetings`、`/meetings/{id}`、`/meetings/{id}/activities`、`/meetings/{id}/decisions`、`/meetings/{id}/foreseen-activities`、`/meetings/{id}/vote-results`、`/meetings/{id}/plenary-session-documents`、`/meetings/{id}/plenary-session-document-items` | `get_plenary_sessions`、`get_meeting_activities`、`get_meeting_decisions`、`get_meeting_foreseen_activities`、`get_voting_records`、`get_meeting_plenary_session_documents`、`get_meeting_plenary_session_document_items` | | **发言** | `/speeches`、`/speeches/{id}` | `get_speeches` | | **程序** | `/procedures`、`/procedures/{id}`、`/procedures/{id}/events`、`/procedures/{id}/events/{event-id}` | `get_procedures`、`get_procedure_events`、`get_procedure_event_by_id` | | **文件** | `/documents`、`/documents/{id}`、`/adopted-texts`、`/adopted-texts/{id}`、`/committee-documents`、`/committee-documents/{id}`、`/plenary-documents`、`/plenary-documents/{id}`、`/plenary-session-documents`、`/plenary-session-documents/{id}`、`/plenary-session-documents-items` | `search_documents`、`get_adopted_texts`、`get_committee_documents`、`get_plenary_documents`、`get_plenary_session_documents`、`get_plenary_session_document_items` | | **质询** | `/parliamentary-questions`、`/parliamentary-questions/{id}` | `get_parliamentary_questions` | | **外部文件** | `/external-documents`、`/external-documents/{id}` | `get_external_documents` | | **词汇表** | `/controlled-vocabularies`、`/controlled-vocabularies/{id}` | `get_controlled_vocabularies` | | **Feed 端点** | `/meps/feed`、`/events/feed`、`/procedures/feed`、`/adopted-texts/feed`、`/meps-declarations/feed`、`/documents/feed`、`/plenary-documents/feed`、`/committee-documents/feed`、`/plenary-session-documents/feed`、`/external-documents/feed`、`/parliamentary-questions/feed`、`/corporate-bodies/feed`、`/controlled-vocabularies/feed` | `get_meps_feed`、`get_events_feed`、`get_procedures_feed`、`get_adopted_texts_feed`、`get_mep_declarations_feed`、`get_documents_feed`、`get_plenary_documents_feed`、`get_committee_documents_feed`、`get_plenary_session_documents_feed`、`get_external_documents_feed`、`get_parliamentary_questions_feed`、`get_corporate_bodies_feed`、`_controlled_vocabularies_feed` | ### 数据源 - **API**: https://data.europarl.europa.eu/api/v2/ - **文档**: https://data.europarl.europa.eu/en/developer-corner - **格式**: JSON-LD, RDF/XML, Turtle - **许可**: 欧洲议会开放数据许可 ## 🔒 安全与合规 ### ISMS 合规 本项目符合 [Hack23 AB 的信息安全管理系统 (ISMS)](https://github.com/Hack23/ISMS-PUBLIC): - ✅ **ISO 27001:2022** - 信息安全管理 - ✅ **NIST CSF 2.0** - 网络安全框架 - ✅ **CIS Controls v8.1** - 安全最佳实践 - ✅ **GDPR** - 欧盟数据保护合规 ### 安全特性 - 🔐 **认证**: API 密钥 + OAuth 2.0(计划中) - 🛡️ **输入验证**: 所有输入使用 Zod schema - ⚡ **速率限制**: 每 15 分钟每 IP 100 个请求 - 🔒 **安全头**: CSP、HSTS、X-Frame-Options 等 - 📝 **审计日志**: 记录所有数据访问 - 🔍 **漏洞扫描**: CodeQL、Dependabot、OSSF Scorecard ### 供应链安全 本项目达到 **SLSA Level 3** 合规: - ✅ **构建来源** - 构建完整性的加密证明 - ✅ **证明** - 所有制品均已加密签名 - ✅ **验证** - `gh attestation verify --owner Hack23 --repo European-Parliament-MCP-Server` - ✅ **npm 来源** - 发布时带来源证明,确保包完整性 - ✅ **SBOM** - SPDX 格式的软件物料清单 - ✅ **依赖审查** - 自动化漏洞扫描 - ✅ **许可合规** - 仅允许 MIT、Apache-2.0、BSD、ISC 有关验证说明和安全优势,请参阅 [**ATTESTATIONS.md**](docs/ATTESTATIONS.md)。 ## 🧪 开发 ### 设置开发环境 ``` # 安装 dependencies npm install # 在 development mode 下运行并 auto-reload npm run dev # Type checking npm run type-check # Linting npm run lint # 格式化代码 npm run format # 运行 tests npm test # 运行 tests 并生成 coverage npm run test:coverage ``` ### 项目结构 ``` European-Parliament-MCP-Server/ ├── src/ # Source code │ ├── server.ts # MCP server entry point │ ├── tools/ # MCP tool implementations │ ├── resources/ # MCP resource handlers │ ├── prompts/ # MCP prompt templates │ ├── clients/ # European Parliament API client │ ├── schemas/ # Zod validation schemas │ ├── types/ # TypeScript type definitions │ └── utils/ # Utility functions ├── tests/ # Test files ├── .github/ # GitHub configuration │ ├── agents/ # Custom Copilot agents │ ├── skills/ # Reusable skill patterns │ └── workflows/ # CI/CD workflows └── docs/ # Additional documentation ``` ### 文档 #### 📚 开发者文档 - **[JSDoc 覆盖率报告](./JSDOC_COVERAGE_REPORT.md)** - 对所有源文件的 JSDoc 文档覆盖率的详细分析 - **[JSDoc 快速参考](./docs/JSDOC_QUICK_REFERENCE.md)** - 编写全面 JSDoc 注释的快速参考指南 - **[JSDoc 覆盖率摘要](./JSDOC_COVERAGE_SUMMARY.md)** - 文档状态和优先级的执行摘要 - **[JSDoc 覆盖率可视化](./docs/JSDOC_COVERAGE_VISUALIZATION.md)** - 带图表和图形的文档覆盖率可视化表示 #### 🏗️ 架构与设计 - **[架构文档](./ARCHITECTURE.md)** - 系统架构和设计模式 - **[数据模型](./DATA_MODEL.md)** - 数据结构和类型定义 - **[API 使用指南](./API_USAGE_GUIDE.md)** - 使用 MCP 服务器 API 的指南 - **[EP 政治版图](./EP_POLITICAL_LANDSCAPE.md)** - 📊 所有 EP 统计数据(2004–2026)的综合 Mermaid 可视化、政治罗盘、联盟动态和 OSINT 情报指标 — 所有年份均根据 EP API v2 验证 #### 🧪 测试与质量 - **[测试覆盖率报告](./TEST_COVERAGE_REPORT.md)** - 测试覆盖率统计和分析 - **[开发者指南](./DEVELOPER_GUIDE.md)** - 开发设置和指南 - **[性能指南](./PERFORMANCE_GUIDE.md)** - 性能优化策略 #### 🔒 安全与合规 - **[安全策略](./SECURITY.md)** - 漏洞报告和安全实践 - **[安全架构](./SECURITY_ARCHITECTURE.md)** - 安全控制和架构 - **[安全开发策略](./Secure_Development_Policy.md)** - 安全编码标准 - **[开源策略](./Open_Source_Policy.md)** - 开源合规指南 #### 📦 部署与运维 - **[部署指南](./DEPLOYMENT_GUIDE.md)** - 生产部署说明 - **[故障排除指南](#troubleshooting)** - 常见问题和解决方案 - **[NPM 发布指南](./NPM_PUBLISHING.md)** - 包发布工作流 ### 测试 ``` # Unit tests npm test # Integration tests (需要 EP_INTEGRATION_TESTS=true) EP_INTEGRATION_TESTS=true npm run test:integration # 带有 fixture capture 的 Integration tests EP_INTEGRATION_TESTS=true EP_SAVE_FIXTURES=true npm run test:integration # E2E tests npm run test:e2e # Coverage 报告 npm run test:coverage # Watch 模式 npm run test:watch ``` **集成测试**:当 `EP_INTEGRATION_TESTS=true` 时,所有 47 个 MCP 工具都会针对真实的欧洲议会 API 端点进行测试。所有工具返回真实数据 — 不使用模拟或占位符数据。默认情况下禁用实时 API 测试以遵守速率限制(15 分钟内 100 个请求)。有关完整指南,请参阅 [**INTEGRATION_TESTING.md**](INTEGRATION_TESTING.md)。 ### 代码质量 ``` # Lint 代码 npm run lint # 修复 Linting 问题 npm run lint:fix # 检查未使用的 dependencies npm run knip # Security audit npm audit # License 合规性 npm run test:licenses ``` ## 🛠️ 故障排除 ### API 速率限制 **症状:** 请求返回 `429 Too Many Requests` 或意外变慢。 欧洲议会开放数据 API 强制执行速率限制。MCP 服务器会自动应用令牌桶速率限制器(每 15 分钟 100 个请求)。 **解决方案:** ``` # 降低 concurrency — 不要并行批量调用多个 tools # 使用内置 cache — 重复的相同请求将从 LRU cache 中提供 # 在 bulk operations 之间添加 delay: # 例如,调用 get_meps,等待 1 秒,然后调用 get_mep_details # 检查当前 cache 统计信息(如果使用 programmatic access): const stats = epClient.getCacheStats(); console.log(`Cache hit rate: ${stats.hitRate}%`); ``` ### 连接问题 **症状:** 工具返回 `ECONNREFUSED`、`ETIMEDOUT` 或 `Network error`。 **解决方案:** 1. 验证 EP API 可达性:`curl https://data.europarl.europa.eu/api/v2/meps?limit=1` 2. 检查防火墙/代理设置 — 服务器向外连接到 `data.europarl.europa.eu:443` 3. 启用重试(默认:开启)— 客户端使用指数退避重试瞬时故障 4. 在 https://data.europarl.europa.eu/en/developer-corner 查看 API 状态 ### 安装问题 **症状:** `npm install` 失败,或 `node dist/index.js` 抛出导入错误。 **解决方案:** ``` # 确保已安装 Node.js 24+ node --version # Must be >= 24.0.0 # 清除 npm cache 并重新安装 npm cache clean --force rm -rf node_modules package-lock.json npm install # 重新构建 TypeScript output npm run build # 验证 package 是否正常启动 node dist/index.js --version ``` **症状:** MCP 客户端显示“未找到服务器”或未列出工具。 **解决方案:** - 确认 MCP 客户端配置中的 `command` 路径指向正确的二进制文件 - 对于 `npx`:确保 `european-parliament-mcp-server` 在您的 npm 注册表中 - 对于 `node`:使用 `dist/index.js` 的绝对路径 - 检查 MCP 客户端日志 — 大多数客户端(Claude Desktop、VS Code)会记录连接错误 ### 集成测试失败 **症状:** 集成测试失败并显示 `EP_INTEGRATION_TESTS must be set`。 集成测试默认禁用以遵守 API 速率限制。 ``` # 显式启用 integration tests: EP_INTEGRATION_TESTS=true npm run test:integration # 捕获新 fixtures 用于离线测试: EP_INTEGRATION_TESTS=true EP_SAVE_FIXTURES=true npm run test:integration ``` ### TypeScript / 构建错误 **症状:** 拉取最新更改后 `tsc` 报告类型错误。 ``` # 重新生成所有 types npm run type-check # 检查不匹配的 Node types npm install # updates @types/node # 确保 tsconfig 正确 cat tsconfig.json ``` ### 获取帮助 - 📋 [提交 Issue](https://github.com/Hack23/European-Parliament-MCP-Server/issues) - 💬 [发起讨论](https://github.com/Hack23/European-Parliament-MCP-Server/discussions) - 📖 [完整故障排除指南](#troubleshooting) - 🤖 [询问 DeepWiki](https://deepwiki.com/Hack23/European-Parliament-MCP-Server) ## 🤝 贡献 我们欢迎贡献!请参阅 [CONTRIBUTING.md](./CONTRIBUTING.md) 了解以下详情: - 行为准则 - 开发流程 - Pull Request 指南 - 编码标准 - 测试要求 ### GitHub Copilot 集成 此仓库包含 GitHub Copilot 的自定义代理和技能: - **代理**:用于开发、测试、安全和文档的专门 AI 助手 - **技能**:用于 MCP 开发、安全、测试和性能的可复用模式 - 参见 [.github/agents/README.md](./.github/agents/README.md) 和 [.github/skills/README.md](./.github/skills/README.md) ### 发布流程 我们遵循 [语义化版本控制](https://semver.org/) 并使用自动化发布管理: **版本类型:** - **主要版本** (x.0.0):破坏性更改(例如 API 不兼容更改) - **次要版本** (0.x.0):新功能,向后兼容(例如新的 MCP 工具) - **补丁版本** (0.0.x):错误修复、安全更新、向后兼容 **自动化发布工作流:** 1. 在功能分支中开发功能 2. 使用 [Conventional Commits](https://www.conventionalcommits.org/) 创建带有描述性标题的 PR 3. 根据更改的文件自动应用标签 4. 合并到 main 后,自动创建发布草案 5. 审核并发布版本(自动创建 git 标签) **发布说明包括:** - 按功能领域分类的更改 - 安全徽章(OpenSSF Scorecard、SLSA) - 技术栈和兼容性 - ISMS 合规状态 - 完整的更新日志链接 有关详细的工作流文档,请参阅 [.github/WORKFLOWS.md](./.github/WORKFLOWS.md)。 ## 🤖 AI 颠覆的情报与未来路线图 ### 🏗️ 代理架构概述 此仓库由一个全面的 AI 增强开发生态系统驱动 — **14 个专门的 Copilot 代理**、**41 个可复用技能**和 **11 个 CI/CD 工作流** — 协同工作以维护、分析和发展现存最先进的政治 MCP 服务器。 ``` %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#6366F1', 'primaryTextColor': '#fff', 'primaryBorderColor': '#4F46E5', 'lineColor': '#94A3B8', 'secondaryColor': '#F59E0B', 'tertiaryColor': '#10B981', 'background': '#0F172A', 'mainBkg': '#1E293B', 'nodeBorder': '#475569'}}}%% graph TB subgraph AGENTS["🤖 14 Copilot Agents"] style AGENTS fill:#1E1B4B,stroke:#6366F1,color:#E0E7FF A1["🎯 product-task-agent"] A2["📝 documentation-writer"] A3["🔧 frontend-specialist"] A4["🔌 api-integration-engineer"] A5["⚙️ mcp-developer"] A6["🛡️ security-specialist"] A7["🧪 test-engineer"] A8["🕵️ intelligence-operative"] A9["🏛️ european-parliament-specialist"] A10["📊 performance-optimizer"] A11["📋 isms-compliance-auditor"] A12["💼 business-development-specialist"] A13["📣 marketing-specialist"] A14["🧩 zod-schema-architect"] end subgraph SKILLS["🎯 41 Reusable Skills"] style SKILLS fill:#1C1917,stroke:#F59E0B,color:#FEF3C7 S1["🔧 10 Core Dev Skills"] S2["🛡️ 6 Security Skills"] S3["⚙️ 4 DevOps Skills"] S4["🔍 10 Intel & OSINT Skills"] S5["💼 2 Business Skills"] S6["🤖 3 AI & MCP Gateway Skills"] S7["📋 6 ISMS Compliance Skills"] end subgraph WORKFLOWS["⚙️ 11 CI/CD Workflows"] style WORKFLOWS fill:#022C22,stroke:#10B981,color:#D1FAE5 W1["🧪 test-and-report"] W2["🔍 codeql"] W3["📦 release"] W4["🌐 integration-tests"] W5["📋 sbom-generation"] W6["🔒 slsa-provenance"] W7["📊 scorecard"] W8["🔎 dependency-review"] W9["🏷️ labeler"] W10["⚙️ setup-labels"] W11["🤖 copilot-setup-steps"] end subgraph TOOLS["🔌 47 MCP Tools"] style TOOLS fill:#172554,stroke:#3B82F6,color:#DBEAFE T1["🕵️ 15 OSINT Intelligence"] T2["📊 4 Advanced Analysis"] T3["👤 7 MEP Data"] T4["🏛️ 9 Plenary & Meeting"] T5["📄 12 Document, Committee & Legislative"] end AGENTS --> SKILLS AGENTS --> TOOLS SKILLS --> WORKFLOWS WORKFLOWS --> TOOLS ``` ### 📅 未来高级路线图:2026–2037 #### 第 5 阶段:高级情报(2026–2027) ``` %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#6366F1', 'primaryTextColor': '#fff', 'primaryBorderColor': '#4F46E5', 'lineColor': '#94A3B8', 'secondaryColor': '#22D3EE', 'tertiaryColor': '#10B981'}}}%% timeline title 2026–2027 · Advanced Intelligence Era section Q1–Q2 2026 Agentic News Generation : Opus 4.6–4.7 : AI-generated parliamentary briefings : Automated committee intelligence reports : Real-time vote analysis summaries section Q3–Q4 2026 Deep Analysis Pipelines : Opus 4.8–4.9 : Cross-institutional correlation engine : MEP behavioral prediction models : Legislative outcome forecasting section Q1–Q2 2027 Predictive Analytics : Opus 5.0–5.1 : Coalition formation prediction : Amendment survival probability : Policy impact pre-assessment section Q3–Q4 2027 Multi-source Intelligence : Opus 5.2–5.3 : EUR-Lex deep integration : Council position analysis : Commission proposal tracking ``` #### 第 6 阶段:AGI 时代与变革性民主(2034–2037) ``` %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#A855F7', 'primaryTextColor': '#fff', 'lineColor': '#C084FC', 'secondaryColor': '#F59E0B', 'tertiaryColor': '#EC4899'}}}%% mindmap root((🌐 AGI Era\n2034–2037)) 🤖 AGI-Enhanced Intelligence Autonomous real-time analysis All 195 parliamentary systems Every legislative session globally Sub-second pattern detection Universal language support All UN official languages Regional dialects & legal terminology Real-time translation & summarization 📊 Predictive Governance Policy impact prediction Before legislation is proposed Economic modeling integration Social impact forecasting Democratic health monitoring Voter engagement indices Institutional resilience scores Democratic backsliding alerts ⚖️ Ethical AI Governance Human oversight maintained Regardless of AI capability level Escalation protocols for critical decisions Transparency reports on AI judgments Bias detection & correction Multi-cultural fairness auditing Political neutrality verification Algorithmic accountability logs 🛡️ Democratic Safeguards Anti-weaponization architecture Platform prevents manipulation Disinformation detection layer Foreign influence monitoring Sovereignty protection EU data sovereignty enforced Quantum-resistant encryption Air-gapped government deployments ``` #### 🧬 AI 模型演进策略 ``` %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#6366F1', 'primaryTextColor': '#fff', 'primaryBorderColor': '#4F46E5', 'lineColor': '#94A3B8', 'secondaryColor': '#F59E0B', 'tertiaryColor': '#10B981'}}}%% gantt title AI Model Evolution & Platform Capability Growth dateFormat YYYY axisFormat %Y todayMarker off section AI Models Opus 4.6–4.9 :a1, 2026, 2027 Opus 5.x :a2, 2027, 2028 Opus 6.x Multimodal :a3, 2028, 2029 Opus 7.x Autonomous :a4, 2029, 2030 Opus 8.x Near-Expert :a5, 2030, 2031 Opus 9–10.x Pre-AGI :a6, 2031, 2034 AGI / Post-AGI :a7, 2034, 2037 section Platform Phases Phase 5 Advanced Intel :p5, 2026, 2028 Phase 5b Predictive :p5b, 2028, 2030 Phase 5c Autonomous :p5c, 2030, 2031 Phase 6 Pre-AGI Global :p6a, 2031, 2034 Phase 6 AGI Transformative :p6b, 2034, 2037 ``` #### 📊 工作流数量与能力预测 | 年份 | 工作流总数 | AI 模型 | 关键能力 | 工具数 | |:----:|:---------------:|:--------:|:---------------|:-----:| | **2026** | 44–50 | Opus 4.6–4.9 | 🤖 代理新闻生成、AI 撰写的简报 | 46→55 | | **2027** | 50–55 | Opus 5.x | 📈 预测分析、联盟预测 | 55→65 | | **2028** | 55–65 | Opus 6.x | 🎥 多模态内容、视频/语音分析 | 65→80 | | **2029** | 65–75 | Opus 7.x | ⚡ 自主管道、自优化 CI/CD | 80→90 | | **2030** | 75–85 | Opus 8.x | 🧠 近专家分析、领域专家 AI | 90→100 | | **2031–2033** | 85–100 | Opus 9–10.x / Pre-AGI | 🌍 全球覆盖、所有欧盟国家议会 | 100→120 | | **2034–2037** | 100–120+ | AGI / Post-AGI | 🌐 变革性平台、195 个议会 | 120→200+ | #### 🔮 战略考量 | 支柱 | 描述 | 保障措施 | |:------:|:------------|:----------| | 🤖 **自主分析** | 跨所有 195 个议会系统的 AGI 驱动实时政治情报 | 高风险评估由人类分析师审核 | | 🌐 **通用语言** | 原生支持所有联合国语言,具备法律术语精确性 | 每次发布进行多文化公平性审计 | | 📊 **预测性治理** | 在立法提出之前进行政策影响预测 | 强制要求置信区间和不确定性量化 | | ⚖️ **道德 AI 治理** | 无论 AI 能力水平如何,都保持人类监督 | 符合 ISMS 的升级协议、透明度报告 | | 🛡️ **民主保障** | 平台架构防止武器化或操纵 | 季度红队演练、主权优先的数据策略 | #### 🗺️ 扩展路线图可视化 ``` %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#6366F1', 'primaryTextColor': '#fff', 'lineColor': '#94A3B8'}}}%% graph LR subgraph Y2026["2026"] style Y2026 fill:#1E40AF,stroke:#3B82F6,color:#DBEAFE Y26["🤖 Opus 4.6–4.9\n44–50 workflows\nAgentic news gen"] end subgraph Y2027["2027"] style Y2027 fill:#1E3A8A,stroke:#3B82F6,color:#DBEAFE Y27["📈 Opus 5.x\n50–55 workflows\nPredictive analytics"] end subgraph Y2028["2028"] style Y2028 fill:#312E81,stroke:#6366F1,color:#E0E7FF Y28["🎥 Opus 6.x\n55–65 workflows\nMulti-modal content"] end subgraph Y2029["2029"] style Y2029 fill:#4C1D95,stroke:#8B5CF6,color:#EDE9FE Y29["⚡ Opus 7.x\n65–75 workflows\nAutonomous pipeline"] end subgraph Y2030["2030"] style Y2030 fill:#581C87,stroke:#A855F7,color:#F3E8FF Y30["🧠 Opus 8.x\n75–85 workflows\nNear-expert analysis"] end subgraph Y2031_33["2031–33"] style Y2031_33 fill:#701A75,stroke:#D946EF,color:#FAE8FF Y31["🌍 Pre-AGI\n85–100 workflows\nGlobal coverage"] end subgraph Y2034_37["2034–37"] style Y2034_37 fill:#831843,stroke:#EC4899,color:#FCE7F3 Y34["🌐 AGI Era\n100–120+ workflows\nTransformative platform"] end Y26 --> Y27 --> Y28 --> Y29 --> Y30 --> Y31 --> Y34 ``` ### 📚 未来架构文档 有关特定演进方向的深入探讨,请参阅: | 文档 | 重点 | 链接 | |:---------|:------|:-----| | 📊 **EP 政治版图** | OSINT 情报仪表板(2004–2026)— 议席组成、碎片化、政治罗盘、联盟动态、衍生指标;所有年份均根据 EP API v2 验证 | [EP_POLITICAL_LANDSCAPE.md](./EP_POLITICAL_LANDSCAPE.md) | | 🧠 **未来思维导图** | 能力扩展愿景、AI 分析、OSINT 演进 | [FUTURE_MINDMAP.md](./FUTURE_MINDMAP.md) | | ⚙️ **未来工作流** | CI/CD 演进、AI 增强管道、2027–2037 路线图 | [FUTURE_WORKFLOWS.md](./FUTURE_WORKFLOWS.md) | | 🏛️ **未来架构** | 平台架构演进、AWS 部署、联邦化 | [FUTURE_ARCHITECTURE.md]() | | 🛡️ **未来安全** | 安全成熟度路线图、量子就绪加密 | [FUTURE_SECURITY_ARCHITECTURE.md](./FUTURE_SECURITY_ARCHITECTURE.md) | | 📊 **未来数据模型** | 增强数据结构、图数据库、时序模型 | [FUTURE_DATA_MODEL.md](./FUTURE_DATA_MODEL.md) | | 💼 **未来 SWOT** | 战略定位、竞争分析、市场演进 | [FUTURE_SWOT.md](./FUTURE_SWOT.md) | ## 📜 许可证 本项目采用 **Apache License 2.0** 许可 - 详情请参阅 [LICENSE.md](./LICENSE.md)。 ## 🔗 链接 ### 项目资源 - [GitHub 仓库](https://github.com/Hack23/European-Parliament-MCP-Server) - [Issue 追踪器](https://github.com/Hack23/European-Parliament-MCP-Server/issues) - [讨论区](https://github.com/Hack23/European-Parliament-MCP-Server/discussions) - [安全策略](./SECURITY.md) ### Hack23 生态系统 - [Hack23](https://hack23.com/) — AI 驱动的民主透明平台 - [EU Parliament Monitor](https://github.com/Hack23/euparliamentmonitor) — 欧洲议会监控仪表板 - [Riksdagsmonitor](https://riksdagsmonitor.com/) · [GitHub](https://github.com/Hack23/riksdagsmonitor) — 瑞典议会监控 - [Citizen Intelligence Agency](https://github.com/Hack23/cia) — 综合政治情报平台 ### 欧洲议会 - [开放数据门户](https://data.europarl.europa.eu/) - [开发者专区](https://data.europarl.europa.eu/en/developer-corner) - [数据隐私政策](https://www.europarl.europa.eu/portal/en/legal-notice) ### MCP 协议 - [MCP 规范](https://spec.modelcontextprotocol.io/) - [MCP SDK](https://github.com/modelcontextprotocol/sdk) - [MCP 文档](https://modelcontextprotocol.io/docs) ### 政治与政府 MCP 服务器 - [Congress.gov API MCP Server](https://github.com/bsmi021/mcp-congress_gov_server) — 美国国会数据(TypeScript) - [UK Parliament MCP](https://github.com/i-dot-ai/parliament-mcp) — 英国 Hansard、成员、辩论 - [Riksdag & Regering MCP](https://github.com/isakskogstad/Riksdag-Regering-MCP) — 瑞典议会数据 - [Parliament of Poland MCP](https://github.com/pkolawa/parliament-poland-mcp-server) — 波兰议会数据 - [OpenTK MCP](https://github.com/r-huijts/opentk-mcp) — 荷兰议会(二院)文件 - [Knesset MCP](https://github.com/zohar/knesset-mcp) — 以色列议会数据 - [CKAN MCP Server](https://github.com/ondata/ckan-mcp-server) — 通用 CKAN 门户访问 - [OpenGov MCP Server](https://github.com/srobbin/opengov-mcp-server) — Socrata 驱动的门户 ### Hack23 ISMS - [ISMS 策略](https://github.com/Hack23/ISMS-PUBLIC) - [开源策略](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Open_Source_Policy.md) - [安全开发策略](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md) ## 🙏 致谢 - **欧洲议会** 提供开放数据访问 - **Model Context Protocol** 团队提供 MCP 规范 - **Hack23 AB** 提供 ISMS 策略和安全标准 - **OpenSSF** 提供供应链安全工具 - **贡献者** 帮助改进此项目

Hack23 AB 用 ❤️ 构建
通过透明的开源展示安全卓越性

标签:ESC4, MCP服务器, MEP影响力评分, MITM代理, NLP, OSINT, RAG, TypeScript, 人工智能助手, 委员会工作负载, 安全插件, 安全访问, 开源数据, 异常检测, 投票模式分析, 政党联盟分析, 政治数据分析, 政治透明度, 模型上下文协议, 欧洲议会, 欧盟, 特征检测, 立法文档, 立法监督, 自动化攻击