关于 André — Analyse électorale française
André 是面向选举分析的 MCP 服务,汇集法国 1999—2026 年 55 场选举的投票站结果,并关联 INSEE 社会人口数据、民选官员及行政区划。它提供只读查询、地图和可视化工具,适用于研究者及公共数据分析者。
主要功能
- 01查询 55 场选举结果
- 02关联 INSEE 社会人口数据
- 03查询行政区划与民选官员
- 04生成多图层选举地图
- 05创建 Plotly 可视化与数据表
- 06导出 CSV、JSON 和 TSV
适用场景
- 01比较同一地区的不同选举
- 02按投票站分析投票率与社会人口特征
- 03筛选或排序符合条件的市镇
- 04制作部门选举专题地图
MCP 相关
通过 MCP 提供选举、行政区划、民选官员和 INSEE 数据查询工具,并提供文档资源与预设提示词。远程服务为只读,使用公开数据。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://mcp.andre.vote/mcpclaude mcp add --transport http vote-andre-elections https://mcp.andre.vote/mcp{"mcpServers":{"vote-andre-elections":{"type":"http","url":"https://mcp.andre.vote/mcp"}}}在 Cursor 中打开{"servers":{"vote-andre-elections":{"type":"http","url":"https://mcp.andre.vote/mcp"}}}在 VS Code 中打开{"mcpServers":{"vote-andre-elections":{"type":"http","url":"https://mcp.andre.vote/mcp"}}}{"mcpServers":{"vote-andre-elections":{"serverUrl":"https://mcp.andre.vote/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
11| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| epci | any | 否 | |
| tour | any | 否 | |
| limit | any | 否 | |
| order | any | 否 | |
| top_n | any | 否 | |
| action | string | 是 | |
| offset | any | 否 | |
| famille | any | 否 | |
| sort_by | any | 否 | |
| group_by | any | 否 | |
| bureau_id | any | 否 | |
| by_family | boolean | 否 | |
| condition | any | 否 | |
| elections | any | 否 | |
| bureau_code | any | 否 | |
| canton_code | any | 否 | |
| election_id | any | 否 | |
| family_name | any | 否 | |
| list_search | any | 否 | |
| nuance_code | any | 否 | |
| rank_metric | any | 否 | |
| region_code | any | 否 | |
| commune_code | any | 否 | |
| nuance_level | any | 否 | |
| scrutin_type | any | 否 | |
| commune_codes | any | 否 | |
| with_sociodem | boolean | 否 | |
| candidate_name | any | 否 | |
| commune_metric | any | 否 | |
| population_max | any | 否 | |
| population_min | any | 否 | |
| candidate_query | any | 否 | |
| use_ferd_coding | boolean | 否 | |
| candidate_search | any | 否 | |
| departement_code | any | 否 | |
| compare_to_election | any | 否 | |
| circonscription_code | any | 否 |
详细介绍
André MCP — 法国选举分析
MCP(Model Context Protocol)服务,可访问 55 场法国选举的投票站级结果 (1999-2026),并与 INSEE 的社会人口数据、共和国民选官员数据库及 官方行政区划数据进行交叉分析。
托管服务,开箱即用: https://mcp.andre.vote/mcp
无需安装、下载数据或身份验证。
此代码库包含 MCP 服务的代码,采用 MIT 许可证发布。它是 André 单体代码库中
andre-mcp/的自动镜像;单体代码库仍是唯一可信来源: 请在此处提交 issue,而不是直接提交 commit(直接提交的内容会在下次镜像时被覆盖)。
连接
Claude Code
claude mcp add --transport http andre https://mcp.andre.vote/mcp
Claude Desktop、Cursor、VS Code…
{
"mcpServers": {
"andre": {
"type": "http",
"url": "https://mcp.andre.vote/mcp"
}
}
}
Claude Desktop 的配置文件位置:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
对于尚未支持 HTTP 传输的客户端:
{
"mcpServers": {
"andre": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.andre.vote/mcp"]
}
}
}
Claude.ai / Claude Desktop 上的工具调用次数限制
Claude 对每轮对话的工具调用次数设定了约 15-20 次的限制。深入分析 (T1+T2 结果、投票站、社会人口交叉分析……)可能会达到此限制。点击 继续即可接着分析。如需不间断地完成全面分析, andre.vote 不受此限制。
工具
| 工具 | 描述 |
|---|---|
query_elections | 选举结果(55 场选举,1999-2026) |
query_admin | 行政区划(市镇、EPCI、县、省) |
query_elus | 共和国民选官员(BRÉF 数据库,Zenodo) |
query_sociodem | INSEE 投票站级社会人口数据 |
query_sql | 直接查询 DuckDB 数据库的 SQL(只读) |
query_dlp | 2020 年市镇选举候选人的社会构成 |
generate_map | 多图层选举地图 |
visualize | Plotly 可视化(柱状图、折线图、散点图……) |
simulate_fusions | 模拟市镇选举名单合并 |
export_data | 导出 CSV/JSON/TSV |
create_data_table | 格式化数据表 |
所有工具都带有 title 和 readOnlyHint / destructiveHint 注解。没有任何工具会造成破坏:此服务以只读方式访问公开数据。
query_elections 提供可在一次调用中完成查询的 “panel” 操作,以降低达到工具调用上限的风险:
compare_elections— 比较某个地区的两场选举query_all_circonscriptions— 查询每个选区的获胜者(立法选举)vote_reserve— 按投票站查询某个政治派系的得分和弃权率(选票储备)select_communes— 按地理、人口和选举标准筛选或排序市镇cross_election_panel— 查询某个政治派系或细分类别在 N 场选举中按市镇的变化bureau_breakdown— 按投票站透视(得分最高的细分类别及投票率,可选社会人口数据)
文档资源
客户端可自动查询的参考资料:
andre://references/methodologies— 分析方法(选票储备、类型划分、ACP)andre://references/data_schema— 选举数据模式andre://references/political_colors— 政治派系颜色andre://references/election_dates— 55 场选举的日期andre://references/victory_rules— 各类选举的获胜规则andre://references/nuances— 政治细分类别代码andre://references/insee_variables— INSEE 社会人口变量andre://skills/electoral-analysis— 主要 skill(工作流、调试)
预构建提示词
- analyser_commune — 对一个市镇进行全面的选举分析
- reserves_de_voix — 识别某政治力量的潜在选票
- carte_electorale — 某省的专题地图
- comparer_elections — 比较两场选举的时间变化
- resultats_rapides — 某场选举的综合结果
示例
Analyse les résultats des législatives 2024 à Marseille
→ query_admin (code 13055) puis query_elections puis query_sociodem
Quelles sont les communes les plus abstentionnistes des Bouches-du-Rhône
aux européennes 2024 ?
→ query_sql avec une requête agrégée
数据
仅使用官方公共来源:
| 来源 | 许可证 | 内容 |
|---|---|---|
| data.gouv.fr | Licence Ouverte 2.0 | 选举结果、候选资格 |
| IGN / Etalab | Licence Ouverte 2.0 | 行政区划边界 |
| INSEE | Licence Ouverte 2.0 | 社会人口统计数据 |
| BRÉF (Zenodo) | CC BY 4.0 | 法兰西共和国民选代表 |
| FERD | CC BY 4.0 | 三层级政治编码 |
社会人口统计数据通过法国国家投票站观察站的权重,从 IRIS 插值到投票站。
限制与稳健性
该服务以只读方式公开数据,无需身份验证。已设置以下防护措施:
query_sql— DuckDB 只读连接,禁止写入查询;对没有显式限制的SELECT/WITH注入安全LIMIT。- 并发保护 — 限制同时执行的重型任务数量;超过限制时会友好地返回“服务器繁忙”。
- 指标 — 在
/metrics上提供 Prometheus 序列(工具、延迟、错误率、并发数)。不会暴露参数、结果或会话标识符。
本地运行
即使没有任何数据,服务也能启动并响应自省请求(tools/list、resources/list、prompts/list):
pip install .
python -c "from andre_mcp.server import run; run()"
或通过 Docker:
docker build -t andre-mcp .
docker run -i --rm andre-mcp
但是,工具调用目前无法在 monorepo 之外运行:服务会将查询委托给尚未打包的脚本(query_elections.py、query_admin.py、generate_map.py 等),并且需要预置完整数据集(约 1.5 GB)。独立的 PyPI 软件包正在筹备中。
如需实际使用,请连接到远程服务。
注册
已以 vote.andre/elections 的名称发布到 MCP 官方注册表(命名空间通过 DNS 在 andre.vote 上验证)。请参阅 server.json。
许可证
MIT — 请参阅 LICENSE。
数据仍受其各自提供方的许可证约束(Licence Ouverte 2.0、CC BY 4.0)。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。