Skip to main content
Glama
MCP OpenFEC Server

MCP OpenFEC Server

by psalzman

MCP OpenFEC 服务器

模型上下文协议 (MCP) 服务器,通过 OpenFEC API 提供对联邦选举委员会 (FEC) 竞选财务数据的访问。

特征

  • 按姓名、州或办公室搜索候选人

  • 获取详细的候选人信息和财务数据

  • 访问委员会信息

  • 查看个人贡献

  • 追踪独立支出

  • 访问联邦选举委员会备案文件和审计案件

  • 下载批量数据

Related MCP server: FireHydrant MCP Server

要求

  • Node.js(v16 或更高版本)

  • OpenFEC API 密钥(在此获取)

安装

  1. 克隆存储库:

git clone https://github.com/psalzman/mcp-openfec
cd mcp-openfec
  1. 安装依赖项:

npm install
  1. 在根目录中创建一个.env文件并添加您的 OpenFEC API 密钥:

OPENFEC_API_KEY=your_api_key_here
  1. 构建服务器:

npm run build

配置

要将此 MCP 服务器与 Claude Desktop 一起使用:

  1. 找到您的 Claude Desktop 配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • Linux: ~/.config/Claude/claude_desktop_config.json

  2. 在文件中添加以下配置:

{
  "mcpServers": {
    "openfec": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-openfec/build/server.js"],
      "env": {
        "OPENFEC_API_KEY": "your_api_key_here"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

重要配置说明:

  1. 将/absolute/path/to/mcp-openfec替换为您克隆存储库的实际路径

  2. 使用绝对路径,而不是相对路径

  3. 将disabled设置为false以启用服务器

  4. 为了安全起见,将autoApprove保留为空数组

  5. 在env部分添加您的 OpenFEC API 密钥

可用工具

  1. get_candidate :获取候选人的详细信息

  2. get_candidate_financials :获取候选人的财务数据

  3. search_candidates :按姓名或其他条件搜索候选人

  4. get_committee :获取委员会的详细信息

  5. get_candidate_contributions :获取候选人的个人贡献

  6. get_filings :检索官方 FEC 文件

  7. get_independent_expenditures :获取独立支出

  8. get_electioneering :获取竞选通讯

  9. get_party_coordinated_expenditures :获取派对协调支出

  10. get_communication_costs :获取公司/工会沟通成本

  11. get_audit_cases :获取 FEC 审计案例和结果

  12. get_bulk_downloads :获取批量数据下载的链接

速率限制

服务器实施速率限制以符合 OpenFEC API 指南:

  • 每小时 1000 个请求

  • 超出此限制的请求将收到错误响应

发展

修改服务器:

  1. 更改src目录中的 TypeScript 文件

  2. 重建服务器:

npm run build

执照

本项目遵循 BSD 三条款许可证,这是一个宽松的开源许可证,在确保用户最大自由度的同时,满足署名要求。该许可证允许您:

  • 将代码用于商业用途

  • 修改代码

  • 分发代码

  • 私下使用代码

主要有三个条件:

  1. 您必须包含原始版权声明

  2. 您必须在发行版中包含许可证文本

  3. 未经许可,不得使用贡献者的名字来认可衍生产品

BSD 3 条款许可证广泛应用于学术和商业环境,在许可和保护贡献者之间提供了良好的平衡。

贡献

  1. 分叉存储库

  2. 创建你的功能分支( git checkout -b feature/my-new-feature )

  3. 提交您的更改( git commit -am 'Add some feature' )

  4. 推送到分支( git push origin feature/my-new-feature )

  5. 创建新的 Pull 请求

版权

版权所有 (c) 2025,Phillip Salzman 和 Foundry Peak, LLC。保留所有权利。网址: http://foundrypeak.com/

有关许可的详细信息,请参阅LICENSE文件。

Available Tools

12 tools
get_audit_casesC

Get FEC audit cases and findings

Inputs: committee_id, audit_id, audit_year, finding_types.

get_bulk_downloadsB

Get links to bulk data downloads

Inputs: data_type (required), election_year.

get_candidateC

Get detailed information about a candidate

Inputs: candidate_id (required), election_year.

get_candidate_contributionsC

Get individual contributions for a candidate

Inputs: candidate_id (required), election_year, sort.

get_candidate_financialsC

Get financial data for a candidate

Inputs: candidate_id (required), election_year (required).

get_committeeC

Get detailed information about a committee

Inputs: committee_id (required).

get_communication_costsC

Get corporate/union communication costs

Inputs: committee_id, candidate_id, min_date, max_date, +3 more.

get_electioneeringC

Get electioneering communications

Inputs: committee_id, candidate_id, min_date, max_date, +3 more.

get_filingsC

Retrieve official FEC filings with filters

Inputs: committee_id, candidate_id, form_type, min_receipt_date, +3 more.

get_independent_expendituresC

Get independent expenditures supporting or opposing candidates

Inputs: candidate_id, committee_id, support_oppose_indicator, min_date, +4 more.

get_party_coordinated_expendituresD

Get party coordinated expenditures

Inputs: committee_id, candidate_id, min_date, max_date, +3 more.

search_candidatesC

Search for candidates by name or other criteria

Inputs: name (required), state, office, election_year.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific FEC data types like candidates, committees, contributions, expenditures, filings, and downloads. There is no overlap in functionality—tools like get_candidate, get_committee, and get_filings serve separate resources, and even related tools like get_candidate_contributions and get_candidate_financials focus on different aspects of candidate data.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, starting with 'get_' or 'search_' followed by a specific noun phrase (e.g., get_candidate, search_candidates, get_audit_cases). This uniformity makes the tool set predictable and easy to navigate, with no deviations in naming style.

    Tool Count5/5

    With 12 tools, the server is well-scoped for accessing U.S. Federal Election Commission data, covering key areas like candidates, committees, financials, expenditures, and filings. Each tool serves a distinct data retrieval function, avoiding bloat while providing comprehensive coverage for the domain.

    Completeness4/5

    The tool set offers strong coverage for retrieving FEC data, including candidates, committees, financials, expenditures, filings, and bulk downloads. A minor gap exists in update or management operations (e.g., no create or modify tools), but this is reasonable for a read-only data access server focused on public records, and agents can work effectively with the provided retrieval functions.

    Related MCP Connectors

    Related MCP Servers