@cyanheads/openfec-mcp-server 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** openfec-mcp-server
4
- **Version:** 0.4.2
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.8.19`
4
+ **Version:** 0.4.4
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.1`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
7
 
8
8
  > **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
@@ -359,12 +359,15 @@ import { getOpenFecService } from '@/services/openfec/openfec-service.js';
359
359
 
360
360
  ## Checklist
361
361
 
362
- - [ ] Zod schemas: all fields have `.describe()` (including nested object fields and array element types), only JSON-Schema-serializable types (no `z.custom()`, `z.date()`, `z.transform()`, `z.bigint()`, `z.symbol()`, `z.void()`, `z.map()`, `z.set()`, `z.function()`, `z.nan()`)
363
- - [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`)
362
+ - [ ] Zod schemas: all fields have `.describe()` (including nested object fields and array element types), only JSON-Schema-serializable types (no `z.custom()`, `z.date()`, `z.transform()`, `z.bigint()`, `z.symbol()`, `z.void()`, `z.map()`, `z.set()`, `z.function()`, `z.nan()`); avoid non-portable `format` emitters (`z.url()`, `z.cuid()`, `z.ulid()`, `z.nanoid()`, `z.base64()`, `z.jwt()`) — use `z.string()` with the constraint in `.describe()`
363
+ - [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`). When regex/length constraints matter, use `z.union([z.literal(''), z.string().regex(...).describe(...)])` — literal variants are exempt from `describe-on-fields`.
364
364
  - [ ] JSDoc `@fileoverview` + `@module` on every file
365
365
  - [ ] `ctx.log` for logging, `ctx.state` for storage
366
366
  - [ ] Handlers throw on failure — error factories or plain `Error`, no try/catch
367
367
  - [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data
368
+ - [ ] Wrapping the OpenFEC API: raw/domain/output schemas reviewed against real upstream sparsity/nullability before finalizing required vs optional fields
369
+ - [ ] Wrapping the OpenFEC API: normalization and `format()` preserve uncertainty; do not fabricate facts from missing upstream data
370
+ - [ ] Wrapping the OpenFEC API: tests include at least one sparse payload case with omitted upstream fields
368
371
  - [ ] Registered in `createApp()` arrays (directly or via barrel exports)
369
372
  - [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
370
373
  - [ ] `bun run devcheck` passes
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <div align="center">
8
8
 
9
- [![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) [![Version](https://img.shields.io/badge/Version-0.4.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-259?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/)
9
+ [![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) [![Version](https://img.shields.io/badge/Version-0.4.4-blue.svg?style=flat-square)](./CHANGELOG.md) [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-259?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/)
10
10
 
11
11
  [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-^1.3.0-f9f1e1.svg?style=flat-square)](https://bun.sh/)
12
12
 
@@ -233,7 +233,7 @@ MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 FEC_API_KEY=your-key bun run start:ht
233
233
 
234
234
  ### Prerequisites
235
235
 
236
- - [Bun v1.2.0](https://bun.sh/) or higher
236
+ - [Bun v1.3.0](https://bun.sh/) or higher (or Node ≥24)
237
237
  - A free [OpenFEC API key](https://api.data.gov/signup/)
238
238
 
239
239
  ### Installation
@@ -271,27 +271,22 @@ bun install
271
271
  | `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |
272
272
  | `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |
273
273
  | `STORAGE_PROVIDER_TYPE` | Storage backend. | `in-memory` |
274
- | `OTEL_ENABLED` | Enable OpenTelemetry tracing. | `false` |
274
+ | `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry) (spans, metrics, completion logs). | `false` |
275
275
 
276
276
  ## Running the Server
277
277
 
278
278
  ### Local Development
279
279
 
280
- - **Build and run the production version:**
280
+ - **Build and run:**
281
281
  ```sh
282
- bun run build
283
- bun run start:http # or start:stdio
284
- ```
285
-
286
- - **Run in dev mode (with watch):**
287
- ```sh
288
- bun run dev:stdio # or dev:http
282
+ bun run rebuild
283
+ bun run start:stdio # or start:http
289
284
  ```
290
285
 
291
286
  - **Run checks and tests:**
292
287
  ```sh
293
- bun run devcheck # Lints, formats, type-checks
294
- bun run test # Runs test suite
288
+ bun run devcheck # Lint, format, typecheck, security audit
289
+ bun run test # Runs test suite
295
290
  ```
296
291
 
297
292
  ## Project Structure
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ await createApp({
13
13
  tools: allToolDefinitions,
14
14
  resources: allResourceDefinitions,
15
15
  prompts: allPromptDefinitions,
16
+ instructions: 'Use the openfec_* tools for US federal campaign finance data: candidates, committees, contributions (Schedule A), disbursements (Schedule B), independent expenditures (Schedule E), filings, elections, calendar, and legal documents. Candidate IDs use H/S/P prefixes (House/Senate/President); committee IDs use C. Cycles are even-year integers covering the prior 2 years (2024 = Jan 2023 – Dec 2024). Itemized contributions and disbursements scope to committee_id, not candidate_id.',
16
17
  setup() {
17
18
  initOpenFecService();
18
19
  },
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,MAAM,SAAS,CAAC;IACd,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,sBAAsB;IACjC,OAAO,EAAE,oBAAoB;IAC7B,KAAK;QACH,kBAAkB,EAAE,CAAC;IACvB,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,MAAM,SAAS,CAAC;IACd,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,sBAAsB;IACjC,OAAO,EAAE,oBAAoB;IAC7B,YAAY,EACV,keAAke;IACpe,KAAK;QACH,kBAAkB,EAAE,CAAC;IACvB,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyanheads/openfec-mcp-server",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "mcpName": "io.github.cyanheads/openfec-mcp-server",
5
5
  "description": "Access FEC campaign finance data through MCP. Query data about candidates, money trails, and election filings. STDIO & Streamable HTTP.",
6
6
  "type": "module",
@@ -77,17 +77,17 @@
77
77
  "lodash": ">=4.17.24"
78
78
  },
79
79
  "dependencies": {
80
- "@cyanheads/mcp-ts-core": "^0.8.19",
80
+ "@cyanheads/mcp-ts-core": "^0.9.1",
81
81
  "@opentelemetry/api": "^1.9.1",
82
82
  "pino-pretty": "^13.1.3"
83
83
  },
84
84
  "devDependencies": {
85
- "@biomejs/biome": "^2.4.14",
86
- "@types/node": "^25.6.2",
85
+ "@biomejs/biome": "^2.4.15",
86
+ "@types/node": "^25.8.0",
87
87
  "depcheck": "^1.4.7",
88
88
  "ignore": "^7.0.5",
89
89
  "tsc-alias": "^1.8.17",
90
90
  "typescript": "^6.0.3",
91
- "vitest": "^4.1.5"
91
+ "vitest": "^4.1.6"
92
92
  }
93
93
  }
package/server.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/cyanheads/openfec-mcp-server",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.4.3",
9
+ "version": "0.4.4",
10
10
  "remotes": [
11
11
  {
12
12
  "type": "streamable-http",
@@ -19,7 +19,7 @@
19
19
  "registryBaseUrl": "https://registry.npmjs.org",
20
20
  "identifier": "@cyanheads/openfec-mcp-server",
21
21
  "runtimeHint": "bun",
22
- "version": "0.4.3",
22
+ "version": "0.4.4",
23
23
  "packageArguments": [
24
24
  { "type": "positional", "value": "run" },
25
25
  { "type": "positional", "value": "start:stdio" }
@@ -46,7 +46,7 @@
46
46
  "registryBaseUrl": "https://registry.npmjs.org",
47
47
  "identifier": "@cyanheads/openfec-mcp-server",
48
48
  "runtimeHint": "bun",
49
- "version": "0.4.3",
49
+ "version": "0.4.4",
50
50
  "packageArguments": [
51
51
  { "type": "positional", "value": "run" },
52
52
  { "type": "positional", "value": "start:http" }