{"id":"882bbf07-3c81-4685-bf5e-3df7811d0b1c","slug":"openfec-mcp-server","kind":"mcp","name":"openfec-mcp-server","summary":"Access FEC campaign finance data on candidates, money trails, and election filings via MCP. STDIO or Streamable HTTP.","owner":"cyanheads","repoUrl":"https://github.com/cyanheads/openfec-mcp-server","license":"Apache-2.0","licenseTier":"permissive","trust":"community","stars":2,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-04-05T00:58:50.000Z","addedAt":"2026-10-14T05:32:25.556Z","logoUrl":"https://avatars.githubusercontent.com/u/10339515?u=4c01abceabee90f9b5a4a4861cc791a239241fa3&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["data-analytics","cloud-infra","memory-knowledge"],"tags":["campaign-finance","elections","fec","openfec","federal-elections","political-contributions","ai-agent","typescript"],"runtime":"node","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-17T15:19:49.619Z","sample":false,"url":"https://conduits.dev/tools/openfec-mcp-server","language":"TypeScript","transports":["stdio"],"install":{"npm":"@cyanheads/openfec-mcp-server"},"requirements":{"env":[{"name":"FEC_API_KEY","secret":false,"required":false,"description":"OpenFEC API key — optional (DEMO_KEY: 30 req/hr). Own key: 1000 req/hr. Free at api.data.gov."},{"name":"MCP_LOG_LEVEL","secret":false,"required":false,"description":"Sets the minimum log level for output (e.g., 'debug', 'info', 'warn')."}],"upstreamMayCharge":false},"tools":null,"readme":"<div align=\"center\">\n  <h1>@cyanheads/openfec-mcp-server</h1>\n  <p><b>Access FEC campaign finance data on candidates, money trails, and election filings via MCP. STDIO or Streamable HTTP.</b>\n  <div>12 Tools • 5 Resources • 2 Prompts</div>\n  </p>\n</div>\n\n<div align=\"center\">\n\n[![Version](https://img.shields.io/badge/Version-0.9.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/openfec-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.2.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/openfec-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/openfec-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-^1.4.2-f9f1e1.svg?style=flat-square)](https://bun.sh/)\n\n</div>\n\n<div align=\"center\">\n\n[![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/openfec-mcp-server/releases/latest/download/openfec-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=openfec-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvb3BlbmZlYy1tY3Atc2VydmVyIl0sImVudiI6eyJGRUNfQVBJX0tFWSI6InlvdXItYXBpLWtleSJ9fQ==) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22openfec-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fopenfec-mcp-server%22%5D%2C%22env%22%3A%7B%22FEC_API_KEY%22%3A%22your-api-key%22%7D%7D)\n\n[![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)\n\n</div>\n\n<div align=\"center\">\n\n**Public Hosted Server:** [https://openfec.caseyjhand.com/mcp](https://openfec.caseyjhand.com/mcp)\n\n</div>\n\n---\n\n## Overview\n\nUS federal campaign finance data from the FEC's OpenFEC API. Search candidates, committees, and filings, trace contributions (Schedule A), disbursements (Schedule B), and independent and coordinated party expenditures (Schedules E/F), and look up election races, legal documents, and filing deadlines. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.\n\n### Tools\n\n| Tool | Description |\n|:---|:---|\n| `openfec_search_candidates` | Find federal candidates by name, state, office, party, or cycle; fetch one by FEC ID with financial totals |\n| `openfec_search_committees` | Find political committees by name, type, candidate affiliation, or state; fetch one by FEC ID |\n| `openfec_get_committee_totals` | Pre-aggregated financial totals for one committee by cycle, or ranked across committees of one entity type |\n| `openfec_search_contributions` | Itemized contributions (Schedule A), or aggregates by size, state, employer, or occupation |\n| `openfec_search_disbursements` | Itemized committee spending (Schedule B), or aggregates by purpose or recipient |\n| `openfec_search_expenditures` | Independent expenditures (Schedule E) supporting or opposing candidates, itemized or totaled per candidate |\n| `openfec_search_coordinated_expenditures` | Coordinated party expenditures (Schedule F) made on behalf of a candidate |\n| `openfec_search_filings` | FEC filings and reports by committee, candidate, form type, or date range |\n| `openfec_lookup_elections` | Candidates in a federal race with their fundraising totals, or an aggregate race summary |\n| `openfec_search_legal` | Advisory opinions, enforcement cases, alternative dispute resolutions, administrative fines, and statutes |\n| `openfec_get_legal_document` | One legal document in full, including the arrays search trims away, paged by entry when too large for one response |\n| `openfec_lookup_calendar` | FEC calendar events, filing deadlines, and election dates |\n\n### Resources\n\n| Resource | Description |\n|:---|:---|\n| `openfec://candidate/{candidate_id}` | Candidate profile with financial totals and principal committees |\n| `openfec://committee/{committee_id}` | Committee profile with type, designation, and financial summary |\n| `openfec://election/{cycle}/{office}` | Presidential race with candidate financial totals |\n| `openfec://election/{cycle}/{office}/{state}` | Senate or at-large House race with candidate financial totals |\n| `openfec://election/{cycle}/{office}/{state}/{district}` | House district race with candidate financial totals |\n\nThe same data is reachable through `openfec_search_candidates`, `openfec_search_committees`, and `openfec_lookup_elections` for tool-only clients.\n\n### Prompts\n\n| Prompt | Description |\n|:---|:---|\n| `openfec_money_trail` | Trace the money around a candidate: direct fundraising, PAC support, independent expenditures, and party spending |\n| `openfec_campaign_analysis` | Structured analysis of a candidate's financial position |\n\n## Capability reference\n\n### `openfec_search_candidates` <sub>tool</sub>\n\n- `query` name search filtered by state, district, office, party, cycle, election_year, incumbent_challenge, candidate_status, and has_raised_funds, up to 100 per page; or a `candidate_id` lookup (H/S/P + eight letters or digits) returning one full record\n- `include_totals` (default on for an ID lookup) adds per-cycle `totals` rows and caps a search page at 35 candidates when cycle or election_year scopes the totals, 5 when they span every cycle; candidates the totals fetch didn't reach are listed in `missing_totals`\n- Typed errors: `candidate_not_found`, `inputs_not_applicable_to_id_lookup`\n\n---\n\n### `openfec_search_committees` <sub>tool</sub>\n\n- `query` name search filtered by candidate_id, state, party, committee_type, designation, cycle, and treasurer_name, up to 100 per page; or a `committee_id` lookup (`C` + eight digits)\n- Typed errors: `committee_not_found`, `inputs_not_applicable_to_id_lookup`\n\n---\n\n### `openfec_get_committee_totals` <sub>tool</sub>\n\n- `mode: \"single\"` (default) takes a `committee_id` and returns one row per two-year cycle; `mode: \"by_entity_type\"` ranks every committee of one `entity_type` (`presidential`, `pac`, `party`, `pac-party`, `house-senate`, `ie-only`), filterable by state, type, designation, organization type, and receipts/disbursements bounds; up to 100 per page\n- Rows carry receipts, disbursements, cash on hand, debts, and the itemized/unitemized split; the output `mode` says whether rows are cycles or committees\n- Typed errors: `committee_id_required_for_single_mode`, `entity_type_required_for_group_mode`, `committee_totals_not_found`\n\n---\n\n### `openfec_search_contributions` <sub>tool</sub>\n\n- `itemized` (default) needs a `committee_id` and filters by contributor name, employer, occupation, city, state, ZIP, date and amount ranges, and `is_individual`, 30 rows per page; `by_size` / `by_state` take a `committee_id` or `candidate_id`, `by_employer` / `by_occupation` a `committee_id`\n- The output `mode` becomes `by_size_candidate` or `by_state_candidate` when scoped by candidate, a different row shape; itemized responses carry `next_cursor`, `count`, and `count_is_approximate`\n- Typed errors: `itemized_requires_committee_id`, `aggregate_requires_committee_id`\n\n---\n\n### `openfec_search_disbursements` <sub>tool</sub>\n\n- `committee_id` required in every mode: `itemized` (default; recipient name, state, city, and committee ID, description, purpose category, date and amount ranges, 30 rows per page), `by_purpose`, `by_recipient`, `by_recipient_id`\n- Itemized responses carry `next_cursor`, `count`, and `count_is_approximate`; aggregate modes page by number\n\n---\n\n### `openfec_search_expenditures` <sub>tool</sub>\n\n- `itemized` (default) filters by committee, candidate, `support_oppose`, payee, targeted office/state/district, party, `is_notice` (24/48-hour notices), dates, and amounts; `most_recent` defaults to true; 60 rows per page when scoped by `committee_id`, 30 otherwise\n- `by_candidate` totals need a `candidate_id` or a full race scope (`candidate_office=P` alone, `S` plus `candidate_office_state`, `H` plus state and `candidate_office_district`), or fail as `by_candidate_requires_scope`\n\n---\n\n### `openfec_search_coordinated_expenditures` <sub>tool</sub>\n\n- Scope by spending party `committee_id`, benefiting `candidate_id`, `cycle`, payee, dates, and amounts; unscoped queries span all years\n- Page-based, 80 rows per page when scoped by `committee_id` and 25 otherwise; rows carry `subordinate_committee_id`, the committee the spending is attributed to\n\n---\n\n### `openfec_search_filings` <sub>tool</sub>\n\n- Filters: committee_id, candidate_id, filer_name, form_type (F3, F3P, F3X, F24, F1, F2, F5), report_type, report_year, cycle, is_amended, and receipt date range; 65 rows per page\n- `most_recent` defaults to true, hiding superseded amendments; rows carry form and report type, financial totals, and `pdf_url`\n\n---\n\n### `openfec_lookup_elections` <sub>tool</sub>\n\n- `office` and an even `cycle` are required; Senate also needs `state` and House `state` plus `district`, unless a `zip` scopes a search\n- `mode: \"search\"` (default) returns the race's candidates with totals and `candidate_pcc_id` / `candidate_pcc_name`, that cycle's principal campaign committee; `mode: \"summary\"` returns one aggregate race row\n- Typed errors: `cycle_must_be_even`, `missing_state_for_office`, `missing_district_for_house`, `summary_does_not_support_zip`\n\n---\n\n### `openfec_search_legal` <sub>tool</sub>\n\n- `type` (`advisory_opinions`, `murs`, `adrs`, `admin_fines`, `statutes`), query, ao_number, case_number, respondent, citations, penalty bounds, or dates; at least one is required (`missing_filter`), and a date bound needs `type` plus a `date_kind` that type records\n- Citations, penalty bounds, respondent, ao_number, and case_number each filter only some types; one sent with a `type` it doesn't filter fails as `filter_not_valid_for_type`, and with `type` omitted the search returns only the types they all apply to, with a total over those types. On MURs and ADRs a citation can't be combined with case_number, respondent, a penalty bound, or an open/close date bound, which upstream would ignore; the two citation fields together match either one\n- Citations take the form upstream parses — `52 U.S.C. 30104` or `11 CFR 110.1` (`USC`, `C.F.R.`, `§`, and suffixes like `30104(g)` are fine); a bare `30106` or `110.1` fails as `invalid_citation` instead of silently returning unfiltered results. One citation per field: upstream applies only the first citation in a value, so `52 U.S.C. 30104, 52 U.S.C. 30118` fails the same way\n- Offset paging via `from_hit` / `hits_returned`, up to 200 per type within a 10,000-result window\n- Results are trimmed: `documents` becomes `document_count` and `document_categories`, `dispositions` becomes `disposition_count` and `disposition_categories`, highlights stop at 3 with their `<em>` match markup removed and render one per line, and `commission_votes` shrink to a date and a 200-character action; `openfec_get_legal_document` returns the full record\n- Each response stays under 100,000 bytes: whole results are admitted one type at a time until the next would not fit, and a page that held some back reports `truncated`, `shown`, and `nextFromHit` — the `from_hit` that continues each type, passed back with that `type`\n\n---\n\n### `openfec_get_legal_document` <sub>tool</sub>\n\n- `doc_type` is the plural of a search result's `document_type` (`mur` → `murs`); `no` is that result's `no` field\n- Returns the untrimmed record, including `documents`, `commission_votes`, and `dispositions`; fails as `legal_document_not_found`\n- A record over 100,000 bytes returns its scalar fields, the arrays that fit (smallest first), and `withheld` — each held-back array with its entry count and size; re-call with `array` and `offset` for that array's entries while they fit, plus `next_offset`. An array the record lacks fails as `array_not_in_record`\n\n---\n\n### `openfec_lookup_calendar` <sub>tool</sub>\n\n- `events` (default; `category`, one of 18 codes, and `description`), `filing_deadlines` (`report_type`, `report_year`), or `election_dates` (`state`, `office`, `district`, `election_year`); `min_date` / `max_date` apply in every mode, up to 100 per page\n- A `district` filter never matches an at-large race; pair it with `state`\n\n---\n\n### `openfec://candidate/{candidate_id}` <sub>resource</sub>\n\n- Candidate record merged with its financial totals and `principal_committees` (current designation `P`, not scoped to a cycle)\n- `candidate_id` comes from `openfec_search_candidates`; fails as `candidate_not_found`\n\n---\n\n### `openfec://committee/{committee_id}` <sub>resource</sub>\n\n- Committee record merged with its financial totals, which are absent for a committee that files no Form 3/3X/3P\n- `committee_id` comes from `openfec_search_committees`; fails as `committee_not_found`\n\n---\n\n### `openfec://election/{cycle}/{office}` <sub>resource</sub>\n\n- Presidential races (`office` `P`), with totals for the full election period\n- First page only: a longer race carries `truncation_notice` pointing to `openfec_lookup_elections`, and an empty one `empty_result_notice`\n\n---\n\n### `openfec://election/{cycle}/{office}/{state}` <sub>resource</sub>\n\n- Senate races, or an at-large House race in a single-district state (`office` `S` or `H`)\n- Same first-page limit and notices as the presidential template\n\n---\n\n### `openfec://election/{cycle}/{office}/{state}/{district}` <sub>resource</sub>\n\n- House district races (`office` `H`)\n- Same first-page limit and notices as the presidential template\n\n---\n\n### `openfec_money_trail` <sub>prompt</sub>\n\n- Arguments: `candidate_name` or `candidate_id` (one required), optional `cycle`\n- Seven steps: identify the candidate, resolve the cycle's principal committee via `candidate_pcc_id`, then direct fundraising, independent expenditures, coordinated party spending, disbursements, and a synthesis\n\n---\n\n### `openfec_campaign_analysis` <sub>prompt</sub>\n\n- Arguments: `candidate_name` or `candidate_id` (one required), optional `cycle`\n- Seven steps: candidate overview, principal committee and per-cycle trajectory, fundraising mix, burn rate, competitive position, outside money, and an assessment\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://github.com/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.\n\nOpenFEC-specific:\n\n- Type-safe client for the [OpenFEC REST API](https://api.open.fec.gov/developers/) with retry and a configurable timeout; error messages have the API key stripped and HTTP failures carry recovery hints\n- Cycles are even years covering two calendar years (2024 = Jan 2023 – Dec 2024); itemized Schedule A/B/E default to the current cycle when `cycle` is omitted, and `election_full` (default true) widens a race total to the full election period (4yr president, 6yr senate, 2yr house)\n- Itemized contributions and disbursements scope to a `committee_id`, not a `candidate_id`. Committee `designation` and `principal_committees` reflect current designation only, so for a cycle's principal committee read `candidate_pcc_id` from `openfec_lookup_elections`\n- Itemized Schedule A/B/E page with an opaque `next_cursor`, valid only for an otherwise-identical call; other tools page by number, and legal search by offset\n\nAgent-friendly output:\n\n- Effective-query echo: every tool response carries `search_criteria` with the post-default filters, and an empty result carries a `notice` on how to broaden it\n- Response budget of 100,000 bytes per surface: high-volume tools cap rows per page and report `truncated`, `shown`, and `cap` when a page falls below the requested `per_page` (page-based tools also echo the applied size in `pagination.per_page`); legal search holds back whole results and reports `nextFromHit`, and a large legal document pages its arrays by `offset`; a single-committee query lifts that committee into one top-level `committee` field instead of repeating it per row\n- Typed contracts: multi-mode tools echo the resolved `mode` and reject a filter the mode can't apply (`itemized_only_filters_in_aggregate_mode`, `inputs_not_applicable_to_mode`) instead of dropping it; every failure carries a typed `reason` and `recovery` text, and estimated totals are flagged `count_is_approximate`\n\n## Getting started\n\n### Public Hosted Instance\n\nA public instance is available at `https://openfec.caseyjhand.com/mcp` — no installation required. Point any MCP client at it via Streamable HTTP:\n\n```json\n{\n  \"mcpServers\": {\n    \"openfec-mcp-server\": {\n      \"type\": \"streamable-http\",\n      \"url\": \"https://openfec.caseyjhand.com/mcp\"\n    }\n  }\n}\n```\n\n### Self-Hosted / Local\n\nAdd the following to your MCP client configuration file.\n\n```json\n{\n  \"mcpServers\": {\n    \"openfec-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"bunx\",\n      \"args\": [\"@cyanheads/openfec-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"FEC_API_KEY\": \"your-api-key\"\n      }\n    }\n  }\n}\n```\n\nOr with npx (no Bun required):\n\n```json\n{\n  \"mcpServers\": {\n    \"openfec-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cyanheads/openfec-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"FEC_API_KEY\": \"your-api-key\"\n      }\n    }\n  }\n}\n```\n\nOr with Docker:\n\n```json\n{\n  \"mcpServers\": {\n    \"openfec-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"-e\", \"MCP_TRANSPORT_TYPE=stdio\", \"-e\", \"FEC_API_KEY=your-api-key\", \"ghcr.io/cyanheads/openfec-mcp-server:latest\"]\n    }\n  }\n}\n```\n\nFor Streamable HTTP, set the transport and start the server:\n\n```sh\nMCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 FEC_API_KEY=your-key bun run start:http\n# Server listens at http://localhost:3010/mcp\n```\n\n### Prerequisites\n\n- [Bun v1.4.0](https://bun.sh/) or higher (or Node.js v24+).\n- Optional: a free [OpenFEC API key](https://api.data.gov/signup/) raises the rate limit from 30 to 1,000 requests per hour over the default `DEMO_KEY`.\n\n### Installation\n\n1. **Clone the repository:**\n\n```sh\ngit clone https://github.com/cyanheads/openfec-mcp-server.git\n```\n\n2. **Navigate into the directory:**\n\n```sh\ncd openfec-mcp-server\n```\n\n3. **Install dependencies:**\n\n```sh\nbun install\n```\n\n4. **Configure environment:**\n\n```sh\ncp .env.example .env\n# edit .env and set FEC_API_KEY (optional)\n```\n\n## Configuration\n\n| Variable | Description | Default |\n|:---|:---|:---|\n| `FEC_API_KEY` | OpenFEC API key from [api.data.gov](https://api.data.gov/signup/). `DEMO_KEY` allows 30 req/hr; your own key allows 1,000. | `DEMO_KEY` |\n| `FEC_BASE_URL` | OpenFEC API base URL. | `https://api.open.fec.gov/v1` |\n| `FEC_MAX_RETRIES` | Retry attempts for failed API requests. | `3` |\n| `FEC_REQUEST_TIMEOUT` | Per-request timeout, in ms. | `30000` |\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |\n| `MCP_HTTP_PORT` | HTTP server port. | `3010` |\n| `MCP_SESSION_MODE` | HTTP session mode: `stateless`, `stateful`, or `auto`. Overrides the `stateless` mode the server declares. | `stateless` |\n| `MCP_AUTH_MODE` | Authentication: `none`, `jwt`, or `oauth`. | `none` |\n| `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`, etc.). | `info` |\n| `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |\n| `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1`. | `in-memory` |\n| `OTEL_ENABLED` | Enable [OpenTelemetry](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry). | `false` |\n\nSee [`.env.example`](./.env.example) for the full list of optional overrides.\n\n## Running the server\n\n### Local development\n\n- **Build and run:**\n\n  ```sh\n  bun run rebuild\n  bun run start:stdio   # or start:http\n  ```\n\n- **Run checks and tests:**\n\n  ```sh\n  bun run devcheck      # Lint, format, typecheck, security audit\n  bun run test          # Vitest test suite\n  bun run lint:mcp      # Validate MCP definitions against spec\n  ```\n\n### Docker\n\n```sh\ndocker build -t openfec-mcp-server .\ndocker run --rm -e FEC_API_KEY=your-key -p 3010:3010 openfec-mcp-server\n```\n\nThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/openfec-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.\n\n## Project structure\n\n| Directory | Purpose |\n|:---|:---|\n| `src/index.ts` | `createApp()` entry point — registers tools/resources/prompts and inits the OpenFEC service. |\n| `src/config` | Server-specific environment variable parsing and validation with Zod. |\n| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`), with shared validators and formatters in `definitions/utils/`. |\n| `src/mcp-server/resources` | Resource definitions (`*.resource.ts`). Candidate, committee, and three election-race templates. |\n| `src/mcp-server/prompts` | Prompt definitions (`*.prompt.ts`). Money trail and campaign analysis. |\n| `src/services/openfec` | OpenFEC API client and domain types. |\n| `tests/` | Unit and integration tests, mirroring the `src/` structure. |\n| `scripts/` | Build, clean, devcheck, tree, changelog, and lint scripts. |\n| `docs/` | Design notes and the OpenFEC OpenAPI spec. |\n\n## Development guide\n\nSee [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:\n\n- Handlers throw, framework catches — no `try/catch` in tool logic\n- Use `ctx.log` for logging, `ctx.state` for storage\n- Register new tools and resources in the barrels at `src/mcp-server/*/definitions/index.ts`\n- Wrap the OpenFEC API: validate raw → normalize to domain type → return the output schema; never fabricate fields the upstream response omitted\n\n## Contributing\n\nIssues are welcome. Run checks and tests before submitting:\n\n```sh\nbun run devcheck\nbun run test\n```\n\n## License\n\nApache-2.0 — see [LICENSE](LICENSE) for details.\n"}