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 分