civicapi-mcp
MCP server for civicAPI that provides live and historical election results worldwide with tools for searching races, retrieving race details and history, and accessing election dates and API status.
README
civicAPI MCP Server
Model Context Protocol (MCP) server for civicAPI - live and historical US election results . No API keys or authentication required.
Hosted MCP (Vercel)
Production: https://civicapi-mcp.vercel.app/mcp
Use Streamable HTTP transport (not stdio).
Cursor
{
"mcpServers": {
"civic-api-hosted": {
"url": "https://civicapi-mcp.vercel.app/mcp"
}
}
}
Zed
"civic-api-hosted": {
"enabled": true,
"url": "https://civicapi-mcp.vercel.app/mcp"
}
Local stdio MCP (Python)
Clone the project, then:
pip install -r python/requirements.txt
python python/server.py
Cursor (local)
{
"mcpServers": {
"civic-api": {
"command": "python",
"args": ["/absolute/path/to/civicapi-mcp/python/server.py"]
}
}
}
Zed (local)
"civic-api": {
"enabled": true,
"remote": false,
"command": "python",
"args": ["/absolute/path/to/civicapi-mcp/python/server.py"]
}
Tools
| Tool | civicAPI endpoint |
|---|---|
search_races |
GET /api/v2/race/search |
get_race_by_id |
GET /api/v2/race/{raceid} |
get_race_history |
GET /api/v2/race/{raceid}/history or /history/{timestamp} |
get_election_dates |
GET /api/v2/getElectionDates |
get_election_years |
GET /api/v2/getElectionYears |
get_api_status |
GET /api/v2/status |
search_races
Search by name, country, province, district, election type, and date range. At least one filter is required.
query— race name (slow alone; prefer geographic/date filters)country— ISO 3166-1 alpha-2 (US) or alpha-3 for limited-recognition states (USA)province— e.g.AL,JP-07district— English district nameelection_typestart_date/end_date—YYYY-MM-DDlimit— default 20, max 50000
get_race_by_id
Full race payload. Optional flags:
generate_map/generate_map_png— rendered map (SVG or PNG)testdata— random test datadata—jsonorcsvembed— embed iframe JSONprecinct— include precinct-level resultsformat— map style (percentage,raw, etc.)
Non-JSON responses (CSV, SVG, PNG) are returned with _content_type and _body or _body_base64.
get_race_history
Historical snapshots for timeline/progression views. Data available for races tracked after October 9, 2025.
- Omit
timestampto list available UTC timestamps - Set
timestamp(YYYY-MM-DDTHH:MM:SS.sssZ) for a full snapshot - Optional:
generate_map,generate_map_png,light,precinct
get_election_dates
Election dates for a year (defaults to current year). Optional country and province filters.
get_election_years
All election years in the database.
get_api_status
Service health check ({"status":"ok"} when available).
Attribution
civicAPI requires attribution for non-personal projects. Link to civicapi.org or mention civicAPI in your project.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。