Civiq

io.github.civdotiq由 GitHub 帳號 civdotiq 發布v1.0.0更新於 Oct 24, 2026

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

已驗證Streamable HTTP可網頁執行金融知識與記憶資料與分析

概覽

AI 產生的概覽

遠端 MCP 伺服器,提供美國公民資料——民意代表、法案、投票、競選經費、遊說與選區統計,皆來自可引用的政府來源。

可以做什麼
  • 依街道地址、州代表團查詢民意代表,取得個人檔案並做並列比較
  • 搜尋法案、查看法案詳情,取得民意代表投票紀錄與眾議院記名表決
  • 取得 FEC 競選經費、參議院遊說申報,以及依選區劃分的聯邦支出
  • 檢索聯邦公報法規、EPA 設施、FEMA 災害、犯罪統計、CFPB 申訴、NHTSA 召回、CMS 醫療機構、HUD 住宅與 College Scorecard 資料
  • 執行跨領域分析,例如影響力鏈、選區概況,以及產業或政策領域全貌
適用情境
當助理需要回答美國聯邦或州民意代表、立法、政治獻金或選區統計資料的問題,且希望答案能追溯到具名政府資料集而非一般知識時適用。
執行需求
需要一個遠端 streamable HTTP 端點;連線本身未宣告需要安裝套件、帳號或 API 金鑰。README 中的 API 金鑰設定是針對自行架設底層平台,而非託管端點。
安裝前請注意
分析類工具呈現的是金錢與政治之間的統計相關性;專案說明這些是相關而非因果,並附有信賴分數。部分數據為全州彙總而非選區層級。涵蓋範圍有限:不含地方政府,不含州級競選經費與遊說,記名表決僅限眾議院。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Civiq,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.civdotiq%2Fciviq/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "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]

來源:README.md,提交 ee9e7b4

工具

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.

輸入參數zipcity必填state必填street必填

list_state_delegation

State delegation list

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

輸入參數state必填

get_representative_profile

Legislator profile

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

輸入參數bioguideId必填

compare_legislators

Legislator comparison

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

輸入參數bioguideIds必填

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).

輸入參數typelimitquerycongress

get_bill_details

Bill details

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

輸入參數billId必填

get_voting_history

Voting history

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

輸入參數limitchamber必填bioguideId必填

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.

輸入參數sessioncongressrollCallNumber必填

get_campaign_finance

Campaign finance summary

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

輸入參數cyclebioguideId必填

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).

輸入參數yearlimitquarterorganization

get_federal_spending

Federal spending lookup

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

輸入參數state必填district

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.

輸入參數bioguideId必填

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數sector必填stateCode

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.

輸入參數policyArea必填

get_committee_info

Committee details

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

輸入參數committeeId必填

get_federal_register

Federal Register search

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

輸入參數typelimitqueryagency

get_district_info

District profile

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

輸入參數stateCode必填districtNumber必填

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.

輸入參數ziplimitstate必填sicCode

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數state必填

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.

輸入參數yearstateCode必填

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.

輸入參數typeyearlimitstate必填

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.

輸入參數stateCode必填yearsBackdistrictNumber必填

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.

輸入參數yearstate必填

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.

輸入參數stateCode必填yearsBack

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.

輸入參數sizestatedateTocompanyproductdateFrom

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數countyFips必填

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數makeyearmodel

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.

輸入參數makemodelcomponent

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.

輸入參數citytypestate必填

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數state必填

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數namelimitstate

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數limitstatetopicinstitution

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數citynamelimitstate

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.

輸入參數stateCode必填districtNumber必填

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.

輸入參數year

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.

無需輸入參數。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分