Civiq

io.github.civdotiqPublished by GitHub account civdotiqv1.0.0Updated Oct 24, 2026

U.S. civic data for AI agents: reps, votes, bills, finance, lobbying, cited gov sources. 47 tools.

VerifiedStreamable HTTPWeb executableFinanceKnowledge & MemoryData & Analytics

Overview

AI-generated overview

Remote MCP server exposing U.S. civic data — representatives, bills, votes, campaign finance, lobbying and district statistics — from cited government sources.

What you can do
  • Look up representatives by street address, state delegation, profiles and side-by-side comparisons
  • Search bills, read bill details, and pull voting records and House roll call votes
  • Retrieve FEC campaign finance, Senate lobbying filings and federal spending by district
  • Search Federal Register rules, EPA facilities, FEMA disasters, crime, CFPB complaints, NHTSA recalls, CMS providers, HUD housing and College Scorecard data
  • Run cross-domain analyses such as influence chains, district profiles and industry or policy-area landscapes
When to use it
Useful when an assistant needs to answer questions about U.S. federal or state legislators, legislation, money in politics, or district-level statistics, and when answers should trace back to named government datasets rather than general knowledge.
Requirements
A remote streamable HTTP endpoint; no package install, account or API key is declared for connecting. The README's API key setup applies to self-hosting the underlying platform, not to the hosted endpoint.
Before you install
Analysis tools present statistical correlations about money and politics; the project states these are correlations, not causation, and carry confidence scores. Some figures are statewide aggregates rather than district-level. Data coverage is partial: no local government, no state campaign finance or lobbying, and House-only roll call votes.

Installation

In SourceWeft

  1. Open Civiq in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.civdotiq%2Fciviq/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "civiq": {
      "type": "http",
      "url": "https://civdotiq.org/api/mcp"
    }
  }
}

README

[CIV.IQ]

CIV.IQ

Civic intelligence from government sources, organized for public use.

civdotiq.org • API Reference • Contribute • License

[CI status] [License: Apache-2.0] [@civiq/sdk on npm]

[A CIV.IQ representative profile on civdotiq.org: Senator Gary C. Peters of Michigan, with party, current term, next election, contact details, and counts of roll-call votes, sponsored bills, money raised and committees.]


What this is

A civic intelligence platform. Enter an address to find your federal and state representatives, with voting records, federal campaign finance, committee assignments, legislative activity, and machine-learning-powered analysis of money-in-politics patterns. Local (city/county) government: not covered. Local records lack a shared standard or central source; CIV.IQ intends to add them only once a verified public source exists.

Data comes from official government records. Most are read straight from the agency's API or bulk files; some are read through named open datasets, such as OpenStates for state legislatures and the Congress Trading Monitor for parsed STOCK Act filings. All analysis is statistical, with confidence scores and methodology disclosed. If data is unavailable, the interface and the response payload say so explicitly. Nothing is fabricated.

Honest coverage matrix: docs/COVERAGE.md. It is the canonical answer to "what does CIV.IQ actually cover?" — every other claim in this README defers to that page.

What it does

Representatives: Federal and state legislators with photos, contact info, committee assignments, and voting records.

Campaign Finance: Federal only — FEC contributions, PAC spending, expenditure tracking, and donor sector analysis. State campaign finance is not currently available (FollowTheMoney.org is in maintenance mode during the OpenSecrets merger).

Intelligence Layer: Statistical analyzers that cross-reference voting records with campaign finance, lobbying filings, stock trades, and committee jurisdictions to surface patterns of potential influence. Every insight carries a confidence score, methodology note, and correlation-not-causation disclaimer.

Money Report: Address-based lookup that traces the path from campaign contributions through committee assignments to legislative outcomes for your specific representatives.

Regulations & Comment Periods: Federal Register integration for proposed rules, final rules, executive orders, and open public comment periods.

State Legislatures: All 50 states via OpenStates — legislators, bills, committees, and calendars. Per-legislator vote history is in progress. Interactive district boundary maps for all 7,383 state legislative districts. State-level campaign finance, lobbying, and stock-trade data are not part of state coverage.

Local Government: Not covered (city/county). Local records lack a shared standard or central source; CIV.IQ intends to add them only once a verified public source exists.

District Intelligence: Demographics, economic indicators (BLS employment data), federal spending (USASpending), infrastructure metrics, and bills ranked by relevance to each congressional district.

Nostr Publishing: Civic events (new bills, votes, hearings) are signed and published to the Nostr network for decentralized, verifiable distribution.

Developer integrations

IntegrationWhat it provides
OpenAPI spec39 endpoints, 38 schemas — generate clients in any language
@civiq/sdkZero-dependency TypeScript client (npm install @civiq/sdk)
MCP server46 tools for AI assistants (Claude, Cursor, etc.)
Atom feedsRSS-compatible feeds for bills, members, districts, committees
Embeddable widgetsDrop-in HTML for legislator cards, district lookup, bill status
llms.txtAI-discoverable documentation

Data sources

SourceWhat it provides
Congress.gov v3Bills, members, committees, hearings
FEC.govCampaign contributions, expenditures, PAC filings
U.S. Census BureauGeocoding, demographics, district boundaries (TIGER)
Senate.gov XMLSenate floor votes, roll calls
House Clerk XMLHouse voting records
GovInfoHearing transcripts, legislative documents
Federal RegisterExecutive orders, proposed rules, comment periods
USASpending.gov v2Federal contracts, grants, awards by district
LDA (lda.gov)Lobbying disclosure filings
Bureau of Labor StatisticsEmployment, wages, labor force data
SEC EDGARCompany filings
FREDFederal Reserve economic indicators
Regulations.govPublic comments on proposed rules
OpenStates (open dataset)State legislators, bills, committees (all 50 states)
Congress Trading Monitor (open dataset)STOCK Act trades for both chambers, parsed from the official House and Senate filings
Wikidata (open dataset)State executives, state judiciary

The table lists the primary sources. Other federal agency datasets (CDC PLACES, CMS, FEMA, FBI, FDIC, VA, Treasury, CFPB, NHTSA, EPA, College Scorecard, and more) power district and intelligence features. In total CIV.IQ reads 40 data sources: 29 government and 11 open datasets. The full list and the counting rule are in docs/COVERAGE.md.

No data is fabricated or generated. When a source is unavailable, the response says so.

Setup

bash
git clone https://github.com/civdotiq/civ.iq.gitcd civ.iqnpm installcp .env.example .env.local

Add API keys to .env.local. All are free:

env
# RequiredCONGRESS_API_KEY=       # api.congress.gov/sign-upFEC_API_KEY=            # api.open.fec.gov/developersCENSUS_API_KEY=         # api.census.gov/data/key_signup.htmlOPENSTATES_API_KEY=     # openstates.org/accounts/profile
# RecommendedUPSTASH_REDIS_REST_URL= # upstash.com (caching)UPSTASH_REDIS_REST_TOKEN=GOOGLE_GENERATIVE_AI_API_KEY= # aistudio.google.com/apikey (AI summaries)
# Optional (enhanced features)FRED_API_KEY=           # fredaccount.stlouisfed.org/apikeysDATA_GOV_API_KEY=       # api.data.gov/signup (Regulations.gov)GOVINFO_API_KEY=        # api.govinfo.gov/docs

See .env.example for the full list, including Nostr publishing and ActivityPub federation.

bash
npm run dev

Verify at localhost:3000/api/health.

Structure

src/├── app/│   ├── api/                  # API routes (public contract: /api/v1 + openapi.json)│   └── (civic)/              # Pages (representatives, districts, legislation, etc.)├── components/│   ├── intelligence/         # Insight cards, leaderboards, influence chains│   └── ...                   # Shared UI, search, visualizations├── features/                 # Feature modules│   ├── campaign-finance/│   ├── legislation/│   ├── representatives/│   └── state-legislature/├── lib/│   ├── intelligence/         # Analyzers, ML models, embeddings, entity resolution│   ├── nostr/                # Nostr event signing and relay publishing│   ├── data-sources/         # Federal Register, FRED, SEC, lobbying services│   └── ...                   # API clients, services, utilities├── hooks/                    # Custom React hooks└── types/                    # TypeScript definitionspackages/├── sdk/                      # @civiq/sdk (TypeScript API client)├── civic-statistics/         # @civiq/civic-statistics (confidence scoring, correlation)└── entity-resolution/        # @civiq/entity-resolution (entity matching, deduplication)

Stack

Next.js 16, React 18, TypeScript (strict), Tailwind CSS, SWR, Zustand, MapLibre GL, D3.js, Recharts, Redis (Upstash + ioredis), Zod, simple-statistics, HuggingFace Transformers (small models), Google Gemini AI, nostr-tools.

Intelligence layer

17 statistical analyzers cross-reference the federal data domains:

AnalyzerWhat it computes
Finance-Jurisdiction OverlapHow far a member's donor industries overlap with their committees' jurisdictions
Vote-Finance AlignmentShare of a member's votes cast on bills in their top donor sectors
Party-Line AlignmentHow often a member votes with their party's majority, from real roll calls
Temporal Vote ShiftsQuarter-by-quarter party-line alignment, alongside committee, contribution, and election events
Chamber BaselinesChamber and party medians for votes cast, missed votes, and party alignment (peer baselines)
Lobbying PipelineLobbying filings aimed at a committee, grouped by issue and matched to bills
PAC-to-Vote TracingA PAC's recipients and how they voted on the PAC's issue areas
Stock-Committee OverlapSTOCK Act trades in sectors a member's committees oversee
Stock Trade LeaderboardMembers ranked by trade count, trade value, or late filings
Sector LeaderboardEach member's yes-vote rate on bills in one donor sector
Influence ChainLobbying → contribution → committee → matching bill → vote pathways
Influence GraphInfluence chains extended with related regulations, enforcement actions, and court cases
Temporal ProximityTiming patterns, such as a contribution within 90 days of a related vote
Bill IntelligenceSponsors' funding sources against a bill's policy sectors, plus bill-to-lobbying text similarity
EnforcementEPA and OSHA enforcement actions and CFPB complaints, by sector, state, or organization
Federal Register ExtractionIndustries, costs, and timelines extracted from rule preambles
Civic BriefA one-page representative brief: statistics and pattern detection first, then an AI summary

One more analyzer, the regulation analyzer, is in the code but not listed because nothing calls it.

Every insight carries: confidence score (0–1), data-as-of timestamp, methodology description, and a disclaimer that correlation does not imply causation.

ML pipeline

All models are small and run server-side through HuggingFace Transformers. Setting CIVIQ_ML_PIPELINES=off disables them.

  • Text similarity: all-MiniLM-L6-v2 embeddings for bill-to-lobbying matching and bill sector classification
  • Classification: nli-deberta-v3-xsmall for zero-shot bill sector classification
  • Named entity recognition: distilbert-NER (ONNX) for extracting entities from Federal Register preambles
  • Influence clusters: Offline Python computation (scripts/compute-influence-clusters.py) served as JSON

Open-source packages

Three packages are extracted as standalone npm workspace packages:

  • @civiq/sdk — TypeScript API client with 33 typed methods across 9 resources, error hierarchy, custom fetch injection
  • @civiq/civic-statistics — Confidence scoring, peer comparison, correlation (Spearman/Pearson), anomaly detection, sample size enforcement
  • @civiq/entity-resolution — Committee alias resolution, ticker-to-industry mapping, FEC recipient deduplication

Commands

bash
npm run dev            # Dev server at localhost:3000npm run build          # Production buildnpm run lint           # ESLintnpm run type-check     # TypeScript strict checknpm test               # Run all tests (Jest)npm run test:e2e       # Playwright end-to-end testsnpm run validate:all   # lint + type-check + test + buildnpm run diagnose:apis  # Test API connectivity

Additional scripts for performance benchmarking, data/ML processing, and security scanning are defined in package.json.

Contributing

See CONTRIBUTING.md.

License

Apache License 2.0. Copyright 2019-2026 Mark Sandford.

Use it, modify it, distribute it. Include the copyright, license, and NOTICE file per Apache 2.0 Section 4. Credit is appreciated but not required: "Powered by CIV.IQ." The government data the API serves is in the public domain. The @civiq/* npm packages are MIT. The CIV.IQ name and logo are trademarks and require written permission to use. See LICENSE and NOTICE.


Mark Sandford - [email protected]

Source: README.md at commit ee9e7b4

Tools

46

lookup_representatives

Representative lookup by address

Find everyone who represents a full street address: the two US Senators and House member (bioguideId, name, party, state, district, chamber) plus every state legislator for the address (name, party, district, chamber, phone, email). The Census Geocoder resolves the exact districts; a ZIP code alone is not accepted because ZIPs cross district lines.

Parameterszipcityrequiredstaterequiredstreetrequired

list_state_delegation

State delegation list

List all federal legislators for a state (both senators and all House representatives).

Parametersstaterequired

get_representative_profile

Legislator profile

Get detailed profile for a specific legislator including committees, social media, biography, and contact info.

ParametersbioguideIdrequired

compare_legislators

Legislator comparison

Compare multiple legislators side-by-side. Returns profiles for each bioguideId.

ParametersbioguideIdsrequired

search_legislation

Bill search

Search for bills in Congress. Provide `query` for full-text keyword/topic search (e.g. "broadband", "veterans healthcare") via GovInfo's full-text bill index; results include a congress-type-number id you can pass to get_bill_details. Without `query`, returns the most recently updated bills (optionally filtered by type).

Parameterstypelimitquerycongress

get_bill_details

Bill details

Get detailed information about a specific bill including sponsor, cosponsors, committees, actions, and policy area.

ParametersbillIdrequired

get_voting_history

Voting history

Get a legislator's recent voting record. Returns vote ID, bill info, position, result, and date.

ParameterslimitchamberrequiredbioguideIdrequired

get_vote_record

House roll call vote

Get details about a specific House roll call vote including all member positions. Note: only House votes are available via this tool.

ParameterssessioncongressrollCallNumberrequired

get_campaign_finance

Campaign finance summary

Get FEC campaign finance data for a legislator including total raised/spent, PAC contributions, and industry breakdown.

ParameterscyclebioguideIdrequired

search_lobbying

Lobbying filings search

Search Senate LDA lobbying filings from the complete corpus — every quarterly report (LD-2) in the covered window, not a sample. Returns registrant, client, spending amount, issue codes and the committees each filing touches, plus exact totals. Filter by quarter, by organization, or both. Amounts are plausibility-gated (income <= $5M, expenses <= $50M per filing).

Parametersyearlimitquarterorganization

get_federal_spending

Federal spending lookup

Get federal contracts and grants for a congressional district from USASpending.gov.

Parametersstaterequireddistrict

get_influence_chain

Influence chain trace

Trace lobbying money through contributions, committee assignments, and votes for a legislator. Shows the path from lobbying org to legislative outcome.

ParametersbioguideIdrequired

analyze_district_comprehensive

District cross-domain profile

District representative info combined with STATE-level context across domains: environment (EPA), safety (FEMA, CFPB), health (CMS), economy (EIA, education, research, banking). Domain counts are statewide aggregates — these sources do not publish district-level rollups.

ParametersstateCoderequireddistrictNumberrequired

analyze_industry_regulatory_landscape

Industry regulatory landscape

For a given industry sector: all regulatory actions (EPA, FDA, NHTSA), lobbying filings, campaign contributions, and committee jurisdiction. Maps sector to agencies and oversight committees.

ParameterssectorrequiredstateCode

analyze_policy_area_ecosystem

Policy area ecosystem

For a Congress.gov policy area: related agencies, industry sectors, lobbying activity, committee oversight, and Federal Register keywords. Uses policy-area-map as the cross-domain join hub.

ParameterspolicyArearequired

get_committee_info

Committee details

Get detailed information about a congressional committee including members, jurisdiction, and subcommittees.

ParameterscommitteeIdrequired

get_federal_register

Federal Register search

Search Federal Register for rules, proposed rules, notices, and executive orders.

Parameterstypelimitqueryagency

get_district_info

District profile

Get comprehensive information about a congressional district including demographics, economics, and representative.

ParametersstateCoderequireddistrictNumberrequired

search_epa_facilities

EPA facility search

Search EPA-regulated facilities by state, ZIP, or SIC code. Returns facility name, address, compliance status, violations, and penalties.

ParametersziplimitstaterequiredsicCode

get_district_environmental_profile

District environmental profile

Environmental profile for a congressional district: regulated facilities, active violations and toxic releases, all scoped to the district by county FIPS. Superfund sites are returned STATEWIDE, not per district, because the EPA layer serving them carries no county FIPS. Includes serving representative.

ParametersstateCoderequireddistrictNumberrequired

analyze_environmental_influence

Environmental influence analysis

Cross-reference EPA violations in a district with lobbying and campaign finance. Maps facility SIC codes to sectors, finds lobbying in those sectors by the district rep, checks EPA-oversight committee membership overlap, and identifies environmental legislation votes.

ParametersstateCoderequireddistrictNumberrequired

get_climate_data

State climate normals

NOAA climate normals for a state: average temperature, min/max temperatures, precipitation, and snowfall from 30-year normal period. Requires NOAA_TOKEN.

Parametersstaterequired

get_state_climate_profile

State climate profile

Climate profile for a state: NOAA climate normals, severe weather event history, and the state delegation's Environment committee membership for climate policy context.

ParametersyearstateCoderequired

search_fema_disasters

FEMA disaster search

Search FEMA disaster declarations by state, year, or type (DR=Major Disaster, EM=Emergency, FM=Fire Management). Returns declaration number, dates, programs, and designated areas.

Parameterstypeyearlimitstaterequired

get_district_disaster_history

District disaster history

Disaster history for a congressional district: FEMA declarations, recurring hazard types, total assistance amounts. Cross-references with USASpending disaster relief in the district.

ParametersstateCoderequiredyearsBackdistrictNumberrequired

search_crime_statistics

Crime statistics search

FBI UCR crime statistics by state and offense type. Returns actual counts, rates per 100,000, clearances, and national comparison. Offense types: violent-crime, property-crime, HOM, RPE, ROB, ASS, BUR, LAR, MVT, ARS.

Parametersyearstaterequired

get_state_public_safety_profile

State public safety profile

State crime trends with national comparison, Judiciary committee memberships from the state's congressional delegation, and relevant policy area context for criminal justice legislation.

ParametersstateCoderequiredyearsBack

search_consumer_complaints

Consumer complaint search

Search CFPB consumer complaints by company, product, state, or date range. Returns complaint details including issue, response, and timeliness.

ParameterssizestatedateTocompanyproductdateFrom

get_district_consumer_complaints

District consumer complaints

Consumer complaints aggregated by congressional district using ZIP-district mapping. Shows top complained-about companies, products, and issues for a district.

ParametersstateCoderequireddistrictNumberrequired

analyze_consumer_protection_influence

Consumer protection influence

Cross-reference top complained-about companies in a state with lobbying registrants (entity resolution fuzzy match) and campaign contributions to the district representative. Checks rep votes on Finance-related legislation. Shows correlations only — not causation.

ParametersstateCoderequireddistrictNumberrequired

get_housing_affordability

Housing affordability data

HUD Fair Market Rents and income limits by county FIPS code. Returns rental rates by bedroom count and income thresholds (very low, extremely low, low) by household size.

ParameterscountyFipsrequired

get_district_housing_profile

District housing profile

Housing affordability profile for a congressional district: HUD Fair Market Rents and income limits for district counties, representative's Housing committee membership, and relevant housing policy context.

ParametersstateCoderequireddistrictNumberrequired

search_vehicle_recalls

Vehicle recall search

Search NHTSA vehicle recalls by make, model, and/or year. Returns campaign number, affected component, safety summary, consequence, remedy, and whether to park the vehicle immediately.

Parametersmakeyearmodel

search_vehicle_complaints

Vehicle complaint search

Search NHTSA consumer complaints about vehicles by make, model, and/or component. Returns incident details including injuries, deaths, crashes, fires, and complaint summary.

Parametersmakemodelcomponent

search_healthcare_providers

Healthcare provider search

Search CMS hospitals and nursing homes by state with quality ratings. Returns overall star ratings, safety/mortality comparisons for hospitals, and inspection/staffing ratings for nursing homes.

Parameterscitytypestaterequired

get_district_healthcare_profile

District healthcare profile

Healthcare infrastructure for a congressional district: CMS hospitals and nursing homes with quality ratings, representative's Health committee membership, and pending health legislation context.

ParametersstateCoderequireddistrictNumberrequired

get_state_energy_profile

State energy profile

State energy profile from EIA: total consumption, production, electricity generation, renewable percentage, and top energy sources. Returns production mix and trends.

Parametersstaterequired

analyze_energy_policy_influence

Energy policy influence

Cross-reference state energy profile with energy sector lobbying registrants (entity resolution fuzzy match), Energy/Commerce committee membership, campaign contributions, and energy legislation votes. Shows correlations only — not causation.

ParametersstateCoderequireddistrictNumberrequired

search_colleges

College search

Search College Scorecard for higher education institutions by state and/or name. Returns admission rate, graduation rate, average net price, median earnings, median debt, and size.

Parametersnamelimitstate

get_district_education_profile

District education profile

Higher education landscape for a congressional district: colleges/universities by state with outcomes data, representative's Education committee membership, and relevant education policy context.

ParametersstateCoderequireddistrictNumberrequired

search_nih_grants

NIH grant search

Search NIH-funded research grants by state, institution, or topic. Returns project title, principal investigator, award amount, NIH institute, and organization.

Parameterslimitstatetopicinstitution

get_district_research_profile

District research profile

NIH-funded research in a congressional district: grants by state, top institutions, top-funded topics, total award amounts, and representative's Science/Health committee membership.

ParametersstateCoderequireddistrictNumberrequired

search_fdic_institutions

FDIC institution search

Search FDIC-insured banks and financial institutions by state, name, or city. Returns total assets, deposits, number of offices, charter class, and regulator.

Parameterscitynamelimitstate

get_district_banking_profile

District banking profile

Banking landscape for a congressional district: FDIC-insured institutions, total deposits/assets, recent bank failures, and representative's Banking/Financial Services committee membership.

ParametersstateCoderequireddistrictNumberrequired

get_federal_fiscal_data

Federal fiscal data

Federal fiscal overview from Treasury: national debt, monthly revenue by category, and spending by category. Returns current figures and fiscal year totals.

Parametersyear

get_federal_debt_context

Federal debt context

Current federal debt with context: total public debt outstanding, debt held by public vs intragovernmental holdings, and record date. Useful for fiscal policy discussions.

Takes no parameters.

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts