civicapi-mcp

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.

Category
Visit Server

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-07
  • district — English district name
  • election_type
  • start_date / end_dateYYYY-MM-DD
  • limit — 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 data
  • datajson or csv
  • embed — embed iframe JSON
  • precinct — include precinct-level results
  • format — 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 timestamp to 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured