@cyanheads/openfec-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@cyanheads/openfec-mcp-serverfind candidates for president in 2024"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Public Hosted Server: https://openfec.caseyjhand.com/mcp
Tools
Twelve tools for querying federal election campaign finance data:
Tool Name | Description |
| Find federal candidates by name, state, office, party, or cycle. |
| Find political committees by name, type, candidate affiliation, or state. |
| Get pre-aggregated committee financial totals for one committee, or rank committees of one entity type. |
| Search itemized individual contributions or aggregate breakdowns by size, state, employer, or occupation. |
| Search itemized committee spending or aggregate breakdowns by purpose or recipient. |
| Search independent expenditures supporting or opposing federal candidates. |
| Search coordinated party expenditures (Schedule F) made on behalf of a candidate. |
| Search FEC filings and reports by committee, candidate, form type, or date range. |
| Look up election races and candidate financial summaries. |
| Search FEC legal documents: advisory opinions, enforcement cases, and administrative fines. |
| Fetch one legal document in full, including the arrays legal search trims away. |
| Look up FEC calendar events, filing deadlines, and election dates. |
openfec_search_candidates
Find federal candidates with optional financial totals.
Full-text name search plus filters for state, district, office, party, cycle, incumbent status
Fetch a specific candidate by FEC ID (H/S/P prefix) with full detail
Optional financial totals: receipts, disbursements, cash on hand
Pagination up to 100 results per page
openfec_search_committees
Find political committees (campaign, PAC, Super PAC, party).
Full-text name search plus filters for type, designation, party, state, candidate affiliation
Fetch a specific committee by FEC ID (C prefix)
Committee types: House, Senate, Presidential, Super PAC, PAC, Party
Treasurer name search
openfec_get_committee_totals
Pre-aggregated committee finances, without paginating Schedule A.
single: One committee's totals, one row per two-year cycle it filed
by_entity_type: Every committee of one type — presidential, pac, party, pac-party, house-senate, ie-only
Receipts, disbursements, cash on hand, debts, and the itemized/unitemized contribution split
Grouped mode filters by state, committee type, designation, organization type, and receipts/disbursements thresholds
openfec_search_contributions
Search Schedule A contribution data with five query modes.
itemized: Individual contribution records with keyset cursor pagination
by_size: Aggregate breakdowns by contribution size range
by_state: Geographic breakdown of contributions
by_employer: Top employer aggregates
by_occupation: Top occupation aggregates
Filters: donor name, employer, occupation, city, state, ZIP, date range, amount range
openfec_search_disbursements
Search Schedule B spending data with four query modes.
itemized: Individual disbursement records with keyset cursor pagination
by_purpose: Aggregate by spending purpose category
by_recipient: Aggregate by payee name
by_recipient_id: Aggregate by recipient committee ID
Filters: recipient name, description, date range, amount range
openfec_search_expenditures
Search Schedule E independent expenditure data.
itemized: Individual expenditure records with support/oppose indicator; scoped to the current cycle unless another is given
by_candidate: Aggregated totals per targeted candidate, scoped by candidate ID or by a whole race (office alone for President, plus state for Senate, plus district as well for House)
Filters: committee, candidate, office, party, 24/48-hour notices, date and amount range
openfec_search_coordinated_expenditures
Search Schedule F coordinated party expenditures.
Party committee spending made on behalf of a candidate, in coordination with that campaign — a separate legal category from independent expenditures and from direct contributions
Filters: spending committee, benefiting candidate, cycle, payee name, date range, amount range
Page-based pagination; the shared spending committee is hoisted out of the rows when the query names one
openfec_search_filings
Search FEC filings and reports.
Form types: F3 (House/Senate quarterly), F3P (Presidential), F3X (PAC/party), F24 (24-hour IE notice), F1/F2 (organizational/candidacy), F5 (IE by persons)
Report type codes: Q1/Q2/Q3, YE, monthly, pre/post election
Amendment filtering with most-recent-only option
Date range filtering by FEC receipt date
openfec_search_legal
Search across FEC legal document types.
Advisory opinions, MURs (enforcement cases), ADRs, administrative fines, statutes
Look up specific cases by AO number or case number
Filter by respondent, regulatory/statutory citation, penalty amount range
Date filtering is type-scoped: pick a
date_kindthe document type records (advisory opinions issue/request/document, cases open/close/document, admin fines RTB/final determination)Offset-based pagination (up to 200 results per page)
openfec_get_legal_document
Fetch one legal document in full by type and number.
Returns the full
documentsarray thatopenfec_search_legalreplaces with a count and category summary, and the completecommission_votesit cuts down to a date and a truncated actiondoc_typeis the plural of a search result'sdocument_type(mur→murs);nois that result'snofield, which every document type carriesReports how many related filings the record carries, so it can be checked against the search result's
document_count
openfec_lookup_elections
Look up federal election races.
search: Candidates in a race with financial totals
summary: Aggregate race financial summary
Office types: H (House), S (Senate), P (President)
ZIP code lookup to find races covering a location
Full election period expansion (4yr president, 6yr senate, 2yr house)
openfec_lookup_calendar
Look up FEC dates and deadlines.
events: FEC calendar events
filing_deadlines: Report due dates by type and year
election_dates: Upcoming and past election dates by state and office
Date range filtering
Related MCP server: mcp-open-fec
Resources
URI Pattern | Description |
| Federal candidate profile with current financial totals. |
| Political committee profile with type, designation, and financial summary. |
| Presidential or at-large election race with candidate financial totals. |
| Senate or state-level election race with candidate financial totals. |
| House district election race with candidate financial totals. |
Prompts
Prompt | Description |
| Structured analysis of a candidate's financial position — fundraising trajectory, burn rate, cash reserves, donor composition, and opponent comparison. |
| Framework for tracing the flow of money around a candidate or race — direct fundraising, PAC support, independent expenditures, and party spending. |
Features
Built on @cyanheads/mcp-ts-core:
Declarative tool definitions — single file per tool, framework handles registration and validation
Unified error handling across all tools
Pluggable auth (
none,jwt,oauth)Swappable storage backends:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1Structured logging with optional OpenTelemetry tracing
Runs locally (stdio/HTTP) or via Docker from the same codebase
OpenFEC-specific:
Type-safe client wrapping the OpenFEC REST API
Multi-mode tools supporting both itemized records and aggregate breakdowns
Keyset cursor pagination for high-volume Schedule A/B/E data
Automatic retry with configurable timeout and max retries
Error sanitization strips API keys from error messages; HTTP status errors enriched with actionable hints
Two guided investigation prompts for campaign finance analysis workflows
Getting Started
Public Hosted Instance
A public instance is available at https://openfec.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"openfec-mcp-server": {
"type": "streamable-http",
"url": "https://openfec.caseyjhand.com/mcp"
}
}
}Self-Hosted / Local
Add the following to your MCP client configuration file.
{
"mcpServers": {
"openfec-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/openfec-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"FEC_API_KEY": "your-api-key"
}
}
}
}Or with Docker:
{
"mcpServers": {
"openfec-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "-e", "FEC_API_KEY=your-api-key", "ghcr.io/cyanheads/openfec-mcp-server:latest"]
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 FEC_API_KEY=your-key bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.3.0 or higher (or Node ≥24)
(Optional) A free OpenFEC API key for higher rate limits (1,000 req/hr vs 30 req/hr with the default
DEMO_KEY)
Installation
Clone the repository:
git clone https://github.com/cyanheads/openfec-mcp-server.gitNavigate into the directory:
cd openfec-mcp-serverInstall dependencies:
bun installConfiguration
Variable | Description | Default |
| OpenFEC API key. Optional — defaults to |
|
| OpenFEC API base URL. |
|
| Max retry attempts for failed API requests. |
|
| Request timeout in milliseconds. |
|
| Transport: |
|
| Port for HTTP server. |
|
| Hostname for HTTP server. |
|
| Auth mode: |
|
| Log level (RFC 5424). |
|
| Directory for log files (Node.js only). |
|
| Storage backend. |
|
| Enable OpenTelemetry instrumentation (spans, metrics, completion logs). |
|
Running the Server
Local Development
Build and run:
bun run rebuild bun run start:stdio # or start:httpRun checks and tests:
bun run devcheck # Lint, format, typecheck, security audit bun run test # Runs test suite
Project Structure
Directory | Purpose |
| Tool definitions ( |
| Resource definitions ( |
| Prompt definitions ( |
| OpenFEC API client and domain types. |
| Environment variable parsing and validation with Zod. |
| Unit and integration tests. |
| Build, clean, devcheck, tree, and lint scripts. |
| Design docs and OpenAPI spec. |
Development Guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor domain-specific logging,ctx.statefor storageRegister new tools and resources in the
index.tsbarrel files
Contributing
Issues and pull requests are welcome. Run checks before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityBmaintenanceQuery FEC campaign finance data — search candidates, track donations, analyze spending, and monitor Super PAC activity via the OpenFEC API.8154MIT
- Alicense-qualityCmaintenanceAccess Federal Election Commission campaign finance data through MCP tools. Enables querying OpenFEC data using natural language via ask_pipeworx or direct tool calls.7MIT
- Alicense-qualityAmaintenanceExposes the FBI Crime Data Explorer API — crime estimates, agency offense rates, and LEOKA officer safety data via MCP. Supports STDIO or Streamable HTTP transport.1171Apache 2.0
Related MCP Connectors
Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.
OpenFEC MCP — Federal Election Commission campaign finance data
USAspending MCP — Federal spending data from USAspending.gov API
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/openfec-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server