Us Lobbying Mcp Server

io.github.cyanheads由 GitHub 账号 cyanheads 发布v0.1.2更新于 Oct 26, 2026

Search US lobbying disclosures and foreign-agent registrations via MCP.

已验证Streamable HTTP可网页运行网页搜索与抓取金融数据与分析

概览

AI 生成的概览

检索美国联邦游说披露(参议院 LDA)与外国代理人登记(司法部 FARA),并可用本地 SQL 分析已暂存记录。

可以做什么
  • 搜索游说登记与活动报告,或按 UUID 获取完整申报文件
  • 解析客户关系,并按指定客户 ID 与年份生成档案
  • 汇总提及某一议题代码的申报中的收入与支出金额
  • 查找游说者并获取特定申报中的活动与曾任职务证据
  • 获取 LD-203 政治献金报告、PAC 关系与认证信息
  • 搜索 FARA 注册人与外国委托人快照,或获取登记详情
适用场景
适合研究美国游说支出、客户、游说者、政治献金或外国代理人登记的问题,也适合希望自行对检索到的披露数据运行 SQL 分析、而不逐页翻阅工具输出的分析人员。
运行要求
可使用公共托管端点,或通过 npx/bunx/Docker 在本地运行;需要 Bun v1.4.0 以上或 Node.js v24 以上。匿名访问无需账号或密钥;可选注册 LDA 令牌通过 USLOBBYING_LDA_API_KEY 配置。本地 SQL 需设置 CANVAS_PROVIDER_TYPE=duckdb;删除工具需 USLOBBYING_DATAFRAME_DROP_ENABLED=true。需要能访问 LDA 与 FARA 数据源。
安装前请注意
匿名 LDA 访问按每个来源 IP 每分钟 15 次限速,FARA 请求也有间隔,大范围扫描可能耗时数小时。可选的 USLOBBYING_LDA_API_KEY 属于机密;启用 LOG_TOOL_FAILURE_PAYLOADS 可能记录失败的工具参数,且自由格式的机密不会被脱敏。删除工具会删除本地暂存表。披露文本属于不可信的记录数据,不能证明违法或影响力,议题金额相互重叠而非按议题分摊。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Us Lobbying Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.cyanheads%2Fus-lobbying-mcp-server/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "us-lobbying": {
      "type": "http",
      "url": "https://us-lobbying.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/us-lobbying-mcp-server

Search US lobbying disclosures and foreign-agent registrations via MCP. STDIO or Streamable HTTP.

9 Tools (+1 opt-in)


Overview

US federal lobbying disclosures from the Senate's LDA API and foreign-agent registrations from the Department of Justice's FARA records. Search filings, resolve client relationships, inspect lobbyist and contribution disclosures, and analyze reported amounts with optional local SQL. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above; no API key required.

Tools

ToolDescription
uslobbying_search_filingsSearch registrations and activity reports, retaining original and amended filings
uslobbying_get_client_profileResolve client relationships, then analyze explicitly selected IDs and years
uslobbying_get_issue_spendingAnalyze reported amounts on quarterly filings mentioning an issue
uslobbying_search_lobbyistsFind lobbyists and retrieve filing-specific activity and covered-position evidence
uslobbying_get_contributionsRetrieve LD-203 reports with complete contribution lists, PAC disclosures, and certifications
uslobbying_search_foreign_agentsSearch FARA snapshots or retrieve a registration's chosen live detail collection
uslobbying_list_referenceLook up official codes, identifiers, methodology, and source limitations
uslobbying_dataframe_queryMaterialize a read-only SQL result and page its complete rows
uslobbying_dataframe_describeInspect staged table schemas, counts, lifecycle, and provenance
uslobbying_dataframe_dropRemove a staged table; opt-in

Capability reference

uslobbying_search_filings tool

  • Supply at least one upstream filter: filing_uuid, filing_year (1999–current UTC year), client/registrant/lobbyist ID or name, filing_type, filing_period, specific_issues, posted_after / posted_before, amount_min / amount_max, client_state, client_country, foreign_entity_name, or foreign_entity_country. Dates are real YYYY-MM-DD calendar dates; amounts are exact decimal USD strings with at most two fractional digits and use native filing-filter semantics. Text is trimmed, blanks omitted, and state/country codes uppercased. Filters combine conjunctively; optional issue_code applies locally and cannot narrow upstream requests.
  • Pass a filing_uuid from lobbyist evidence or analytical selections to retrieve the complete filing, including nested source fields and document links.
  • Returns complete filings with amendment_policy: "all_versions", separate nullable USD decimal-string income / expenses, document links, and nested disclosures. Shared acquisition and record-window rules appear under Features.

uslobbying_get_client_profile tool

  • mode: "resolve" (default) requires client_name; mode: "profile" requires explicit client_ids and years (1999–current UTC year). Pass each candidate's id, not its registrant-assigned client_id. IDs identify relationships with registrants; candidates are never automatically merged into a corporate identity.
  • Profile returns status: "collecting" until acquisition completes, then typed annual_ledgers, selections, firms, issue_codes, targeted_entities, selected_filings, activities, and raw_filings across output windows. row_set_totals / row_set_offsets describe each list's delivery.
  • Optional nonempty, unique row_sets selects which of those lists to deliver inline. Omission delivers every set; raw_filings always means every acquired version, including selected versions. Selection never limits acquisition, analysis, complete-set totals or SQL staging. Omitted sets remain available by restarting the same scope with another selection or querying staged tables. Continue with omitted or equivalent row_sets; changing the selection fails cursor_invalid. Offsets, handles and output_complete follow the selected stream; notices remain deliverable for every selection.
  • Empty client/year partitions produce factual notices naming the selected ID and year; zero rows do not establish whether an ID is valid. Notices share bounded delivery windows and count in total_records and delivery counters, while row_set_totals counts domain rows only. Follow every cursor.
  • With CANVAS_PROVIDER_TYPE=duckdb, the first completed-acquisition delivery window returns a dataset containing all acquired filings, selected filings, and selected activities. Its exact replay retains the dataset; later windows retain canvas_id, describe_tool, query_tool and table guidance without repeating schemas. Optional input canvas_id reuses an existing canvas; an expired token fails canvas_not_found.

uslobbying_get_issue_spending tool

  • Requires issue_code and explicit years; optional client_id / registrant_id narrow upstream acquisition. All versions are acquired before latest-period selection and local issue filtering; broad scans can take hours.
  • Returns the same collecting/final analytical lists, optional row_sets selection and dataset routing as profile mode, with attribution_basis: "whole_filing_mentions_issue". Whole-filing amounts overlap across issue buckets and are not allocated issue spending.

uslobbying_search_lobbyists tool

  • mode: "search" (default) requires name, registrant_name, or registrant_id; mode: "activity" requires lobbyist_id and filing_year, with optional client_id and covered_positions_only.
  • Returns identity lobbyists or filing-scoped evidence, including the matching participant, complete activity, original indexes, and filing UUID/document. Use that UUID with uslobbying_search_filings for the complete filing. Covered positions are disclosed text, not verified current employment.

uslobbying_get_contributions tool

  • Requires filing_year (2008–current UTC year); optional filing_period (mid_year / year_end), registrant/lobbyist selectors, contribution_type, contributor, payee, honoree, inclusive contribution_date_after / contribution_date_before, and inclusive local item amount_min / amount_max decimal USD strings. Unknown item amounts cannot satisfy a bound. Contribution amount predicates run locally because native amount filters do not reliably select matching reports.
  • Returns full parent reports, complete contribution_items, and matched_item_indexes where every child predicate matched the same item. Originals and amendments remain separate; report_count_in_batch and item_count_in_batch are not donation totals.

uslobbying_search_foreign_agents tool

  • mode: "search" (default) searches daily XML snapshots; choose entity: "registrants" (default) or "foreign_principals", optional literal token-AND name_contains, and exact country labels for principals only. status is active (default), terminated, or all; principal status is independent of registrant status.
  • mode: "detail" requires a digit-string registration_number and retrieves only the chosen live collection: foreign_principals (default), short_forms, or documents. Documents require status: "all" (the effective default for documents); an empty collection does not prove a registration never existed.
  • page_size controls local windows over pinned results (default 25; larger positive integers clamp to 25); follow next_cursor. Responses retain source fields, official links, and snapshot retrieval metadata where applicable.

uslobbying_list_reference tool

  • Start with topic: issue_codes, filing_types, government_entities, contribution_types, countries, identifiers, methodology, or fara_rules; optional filter applies literal case-insensitive token-AND matching.
  • Returns attributed entries, total_entries, and matched_entries; follow next_cursor for pinned windows of up to 125 entries, or record_handles for oversized entries. Countries retain separately attributed LDA codes and FARA labels, without a guessed ISO mapping.

uslobbying_dataframe_query tool

  • Requires canvas_id and either one read-only SELECT in sql (optional fresh register_as) or a stored result_table with optional offset. row_limit defaults to 25; larger positive integers clamp to 100, then any lower provider ceiling. The response byte budget may deliver fewer whole rows.
  • New SQL materializes the complete result. Continue with result_table / next_offset; row_count is exact and row_order: "canonical_values" describes delivery ordering. Writes, multiple statements, external reads, and prohibited plan operators fail with typed reasons.
  • A row that cannot fit fails query_row_too_large while retaining the materialization: select fewer columns or explicit SUBSTR windows. Missing/expired tables fail missing_table; SQL is unavailable without an enabled canvas.

uslobbying_dataframe_describe tool

  • Requires a returned canvas_id; optional table_name selects one table. Inspect authoritative columns and types before SQL.
  • Returns exact row counts, grain, creation/expiry, source tool, acquisition provenance, and materializing SQL where applicable. It does not enumerate other canvases.

uslobbying_dataframe_drop tool

  • Requires canvas_id and table_name; idempotent, returning dropped: false for an absent table.
  • Off unless USLOBBYING_DATAFRAME_DROP_ENABLED=true; when disabled it is absent from tools/list. This deletes local staged data only.

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

LDA/FARA-specific:

  • Shared source pacing: anonymous LDA access uses 15 requests/minute per originating IP; an optional registered token uses 120/minute. FARA requests start at least 4.1 seconds apart; separate processes must coordinate shared upstream budgets.
  • Analytical selection uses the latest posting within each registrant/client/year/quarter. Equal-latest candidates are marked ambiguous and excluded from sums; this is an analytical rule, not a verified legal amendment lineage.
  • Income and expenses remain separate, missing amounts remain unknown, and expense methods retain separate ledgers. Disclosure records establish neither wrongdoing nor policy outcomes or influence.
  • FARA search uses complete official daily XML snapshots cached for 24 hours; chosen registration details use the live API. LDA pagination is live and does not promise an immutable historical snapshot.

Agent-friendly output:

  • Explicit completion: LDA page_size defaults to 25 and max_pages to one for discovery, five for analytics; larger positive integers clamp to 25 and five respectively. Follow next_cursor until coverage.complete, then continue final windows until output_complete. Filters may be omitted or repeated unchanged; page sizes compare after clamping, while workload controls do not change scope identity.
  • Complete record retrieval: responses target 24,000 UTF-8 bytes across both surfaces. Oversized parents come back as record_handles, readable through the same tool with JSON Pointer record_path and record_offset / record_limit (default 25 entries or items, larger positive integers clamp to 25); strings page by Unicode code point within the byte budget.
  • Delivery controls: source/reference responses expose delivery_limits with {requested,effective} pairs for controls clamped on this call; an empty map means none. SQL returns the same metadata when a ceiling lowers its request. Exact cursor replay retains the original response and its disclosure. Zero, negative, fractional and nonfinite controls remain invalid.
  • Source counts: coverage.upstream_count, when known for every partition, sums each partition's latest observed envelope count. It can include duplicate source rows and differs from unique_records; live pagination is not a frozen snapshot.
  • Recoverable progress: cursors and retained parents expire 24 hours after acquisition starts. The latest cursor replays its response; older or expired ones fail cursor_invalid. In-memory restarts lose progress, filesystem storage keeps it until expiry, and the default 128 MiB acquisition budget favors narrow year/client/registrant scopes.
  • Matching response surfaces: structuredContent and the JSON text in content[] carry the same fields, plus clickable official source links. Analytical dataset responses name the staged tables and route to the describe/query tools.

Getting started

Connect to the hosted instance, no install:

sh
claude mcp add --transport http us-lobbying-mcp-server https://us-lobbying.caseyjhand.com/mcp

Or run it locally. Add the following to your MCP client configuration file.

json
{  "mcpServers": {    "us-lobbying-mcp-server": {      "type": "stdio",      "command": "bunx",      "args": ["@cyanheads/us-lobbying-mcp-server@latest"],      "env": { "MCP_TRANSPORT_TYPE": "stdio" }    }  }}

Or with npx (no Bun required):

json
{  "mcpServers": {    "us-lobbying-mcp-server": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@cyanheads/us-lobbying-mcp-server@latest"],      "env": { "MCP_TRANSPORT_TYPE": "stdio" }    }  }}

Or with Docker:

json
{  "mcpServers": {    "us-lobbying-mcp-server": {      "type": "stdio",      "command": "docker",      "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/us-lobbying-mcp-server:latest"]    }  }}

For Streamable HTTP, set the transport and start the server:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http# Server listens at http://localhost:3010/mcp

Prerequisites

  • Bun v1.4.0 or higher (or Node.js v24+).
  • Anonymous access needs no account or key. Optional registered LDA tokens can be configured as USLOBBYING_LDA_API_KEY.

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/us-lobbying-mcp-server.git
  1. Navigate into the directory:
sh
cd us-lobbying-mcp-server
  1. Install dependencies:
sh
bun install
  1. Configure environment:
sh
cp .env.example .env# edit .env for optional overrides

Configuration

VariableDescriptionDefault
USLOBBYING_LDA_API_KEYOptional registered LDA token for the authenticated request allowance.—
USLOBBYING_DATAFRAME_DROP_ENABLEDExpose uslobbying_dataframe_drop, which removes local staged tables.false
CANVAS_PROVIDER_TYPEnone or duckdb; npm/Docker installs can enable local SQL. MCPB fixes this to none and keeps complete inline delivery.none
STORAGE_PROVIDER_TYPEAcquisition checkpoint storage; filesystem opts into durable public-record retention.in-memory
STORAGE_FILESYSTEM_PATHExplicit writable directory when selecting filesystem storage. Checkpoints expire 24 hours after acquisition starts.—
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_HOSTHTTP bind address; Docker defaults to 0.0.0.0.127.0.0.1
MCP_HTTP_PORTHTTP server port.3010
MCP_HTTP_ENDPOINT_PATHMCP endpoint path./mcp
MCP_AUTH_MODEAuthentication: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (debug, info, warning, error, etc.).info
LOG_TOOL_FAILURE_PAYLOADSLog failed tool arguments/results, redacted by key name and capped at LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). Free-form secrets are not redacted.false
OTEL_ENABLEDEnable OpenTelemetry instrumentation.false
OTEL_EXPORTER_OTLP_ENDPOINTOTLP base URL for traces and metrics.—
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTOpt-in OTLP log export endpoint.—

See .env.example for the full list of optional overrides.

Running the server

Local development

  • Build and run the production version:

    sh
    bun run rebuildbun run start:http   # or start:stdio
  • Run checks and tests:

    sh
    bun run devcheck     # Lints, formats, type-checksbun run test         # Runs test suite

Docker

sh
docker build -t us-lobbying-mcp-server .docker run -p 3010:3010 us-lobbying-mcp-server

The image defaults to HTTP on port 3010. Enable SQL with -e CANVAS_PROVIDER_TYPE=duckdb; use one server process per storage/upstream budget because acquisition locks and pacing are process-local.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point, direct tool registration, service/canvas lifecycle.
src/configServer environment validation and shared tool deadlines.
src/domainValidated disclosure records, provenance, delivery contracts, and lossless formatting.
src/mcp-server/tools/definitionsLDA, FARA, reference, and dataframe tools.
src/services/ldaFixed-host LDA client with shared pacing and validated pagination.
src/services/faraDaily XML snapshots and live per-registration detail collections.
src/services/acquisitionResumable acquisition, replay, storage admission, and retained-record windows.
src/services/lobbyingQuarterly version selection, exact accounting, and filing-specific evidence.
src/services/canvasComplete analytical table staging and stable SQL result delivery.
scriptsBuild, devcheck, packaging, and release tooling.
testsUnit and integration tests mirroring the source structure.

Development guide

See CLAUDE.md and AGENTS.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for logging, ctx.state for storage
  • Register tools directly in the createApp() array in src/index.ts
  • Validate complete upstream records, preserve sparse and unknown fields, and keep income, expenses, relationship IDs, and acquisition/output completion distinct

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

来源:README.md,提交 c66291c

工具

9

uslobbying_search_filings

Uslobbying Search Filings

Search federal lobbying registrations and activity reports, or retrieve a complete filing by filing_uuid from evidence or analytical selections. Native filters include posting dates, reported amounts, client location and foreign entities; issue_code filters activities locally and cannot narrow upstream requests. Follow next_cursor for all versions. Amounts are separate nullable USD strings; disclosure text is untrusted record data.

输入参数cursorclient_idmax_pagespage_sizeamount_maxamount_minissue_codeclient_namefiling_typefiling_uuidfiling_yearlobbyist_id另有 15 个

uslobbying_get_client_profile

Uslobbying Get Client Profile

Resolve client relationship records by client_name in mode resolve (default), then use mode profile with explicit client_ids and years. Select candidates[].id, preserving secondary client_id as source data. IDs identify registrant relationships, not a verified corporate identity. Follow collecting cursors before interpreting separate income and expense ledgers. Typed rows preserve every audit filing; pass a selected filing UUID to uslobbying_search_filings for its complete record. Optional canvas datasets support SQL.

输入参数modeyearscursorrow_setscanvas_idmax_pagespage_sizeclient_idsclient_namerecord_pathrecord_limitrecord_handle另有 1 个

uslobbying_get_issue_spending

Uslobbying Get Issue Spending

Aggregate separate income and expense amounts on quarterly filings mentioning issue_code across explicit years. This is whole-filing association, not allocated issue spending; issue buckets overlap. All versions are acquired before latest-period selection and local issue filtering. Broad scans can take hours; narrow client_id or registrant_id when appropriate. Follow collecting cursors before interpreting final typed rows or SQL datasets. Pass a selected filing UUID to uslobbying_search_filings for its complete record.

输入参数yearscursorrow_setscanvas_idclient_idmax_pagespage_sizeissue_coderecord_pathrecord_limitrecord_handlerecord_offset另有 1 个

uslobbying_search_lobbyists

Uslobbying Search Lobbyists

Find lobbyists by name or registrant in mode search, then retrieve filing-scoped evidence with mode activity, lobbyist_id and filing_year. Pass an evidence filing_uuid to uslobbying_search_filings for the complete filing. Covered positions are disclosed text, not verified present employment. Activity mode checks the requested lobbyist locally. Follow next_cursor for all results.

输入参数modenamecursorclient_idmax_pagespage_sizefiling_yearlobbyist_idrecord_pathrecord_limitrecord_handlerecord_offset另有 3 个

uslobbying_get_contributions

Uslobbying Get Contributions

Retrieve complete semiannual LD-203 reports, contributions, PAC relationships and certifications, preserving original and amended reports. Child predicates must match the same item; full parent contribution lists and matched_item_indexes remain available. Report counts are not donation counts and no cross-report donation total is inferred.

输入参数payeecursorhonoreemax_pagespage_sizeamount_maxamount_mincontributorfiling_yearlobbyist_idrecord_pathrecord_limit另有 9 个

uslobbying_search_foreign_agents

Search foreign agents

Search official FARA daily registrant or foreign-principal snapshots, or retrieve one registration principal, short-form or document collection. Follow cursors to pinned local windows; principal status differs from registrant status. Disclosure records do not establish wrongdoing or influence.

输入参数modecursordetailentitystatuscountrypage_sizerecord_pathrecord_limitname_containsrecord_handlerecord_offset另有 1 个

uslobbying_list_reference

Uslobbying List Reference

List official issue codes, filing types, government entities, contribution types and countries, or explain identifiers, methodology and FARA rules. Optional filter performs case-insensitive literal token-AND matching across the complete vocabulary. Follow next_cursor for pinned result windows; retrieve oversized entries with this tool using record_handle and record_path. Countries include separately attributed LDA codes and FARA source labels; FARA labels are not guessed ISO codes.

输入参数topiccursorfilterrecord_pathrecord_limitrecord_handlerecord_offset

uslobbying_dataframe_query

Query disclosure tables

Run one read-only SELECT over staged disclosure tables, materialize the complete result, then retrieve whole rows by result_table and next_offset without rerunning SQL. Inspect columns with uslobbying_dataframe_describe first.

输入参数sqloffsetcanvas_id必填row_limitregister_asresult_table

uslobbying_dataframe_describe

Describe disclosure tables

Inspect exact staged table schemas, row counts, lifecycle, acquisition coverage and provenance before SQL.

输入参数canvas_id必填table_name

版本历史

2
  1. v0.1.2最新Oct 26, 2026
  2. v0.1.1Oct 25, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分