@cyanheads/usaspending-mcp-server 0.4.1 → 0.4.3

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.
Files changed (89) hide show
  1. package/AGENTS.md +428 -0
  2. package/CLAUDE.md +55 -26
  3. package/Dockerfile +18 -4
  4. package/README.md +29 -67
  5. package/changelog/0.4.x/0.4.2.md +28 -0
  6. package/changelog/0.4.x/0.4.3.md +33 -0
  7. package/changelog/template.md +62 -40
  8. package/dist/index.js +18 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.d.ts +2 -0
  11. package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.d.ts.map +1 -1
  12. package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js +2 -0
  13. package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js.map +1 -1
  14. package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts +2 -0
  15. package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/disaster-spending.tool.js +2 -0
  17. package/dist/mcp-server/tools/definitions/disaster-spending.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/get-agency.tool.d.ts +3 -1
  19. package/dist/mcp-server/tools/definitions/get-agency.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/get-agency.tool.js +7 -21
  21. package/dist/mcp-server/tools/definitions/get-agency.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.d.ts +2 -0
  23. package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.js +2 -0
  25. package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.js.map +1 -1
  26. package/dist/mcp-server/tools/definitions/get-award-subawards.tool.d.ts +2 -0
  27. package/dist/mcp-server/tools/definitions/get-award-subawards.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/definitions/get-award-subawards.tool.js +2 -0
  29. package/dist/mcp-server/tools/definitions/get-award-subawards.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/definitions/get-award-transactions.tool.d.ts +2 -0
  31. package/dist/mcp-server/tools/definitions/get-award-transactions.tool.d.ts.map +1 -1
  32. package/dist/mcp-server/tools/definitions/get-award-transactions.tool.js +2 -0
  33. package/dist/mcp-server/tools/definitions/get-award-transactions.tool.js.map +1 -1
  34. package/dist/mcp-server/tools/definitions/get-award.tool.d.ts +2 -0
  35. package/dist/mcp-server/tools/definitions/get-award.tool.d.ts.map +1 -1
  36. package/dist/mcp-server/tools/definitions/get-award.tool.js +3 -5
  37. package/dist/mcp-server/tools/definitions/get-award.tool.js.map +1 -1
  38. package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.d.ts +2 -0
  39. package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.d.ts.map +1 -1
  40. package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.js +2 -0
  41. package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.js.map +1 -1
  42. package/dist/mcp-server/tools/definitions/get-federal-account.tool.d.ts +2 -0
  43. package/dist/mcp-server/tools/definitions/get-federal-account.tool.d.ts.map +1 -1
  44. package/dist/mcp-server/tools/definitions/get-federal-account.tool.js +3 -5
  45. package/dist/mcp-server/tools/definitions/get-federal-account.tool.js.map +1 -1
  46. package/dist/mcp-server/tools/definitions/get-idv-awards.tool.d.ts +2 -0
  47. package/dist/mcp-server/tools/definitions/get-idv-awards.tool.d.ts.map +1 -1
  48. package/dist/mcp-server/tools/definitions/get-idv-awards.tool.js +2 -0
  49. package/dist/mcp-server/tools/definitions/get-idv-awards.tool.js.map +1 -1
  50. package/dist/mcp-server/tools/definitions/get-recipient.tool.d.ts +2 -0
  51. package/dist/mcp-server/tools/definitions/get-recipient.tool.d.ts.map +1 -1
  52. package/dist/mcp-server/tools/definitions/get-recipient.tool.js +3 -5
  53. package/dist/mcp-server/tools/definitions/get-recipient.tool.js.map +1 -1
  54. package/dist/mcp-server/tools/definitions/index.d.ts +37 -1
  55. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  56. package/dist/mcp-server/tools/definitions/list-agencies.tool.d.ts +2 -0
  57. package/dist/mcp-server/tools/definitions/list-agencies.tool.d.ts.map +1 -1
  58. package/dist/mcp-server/tools/definitions/list-agencies.tool.js +2 -0
  59. package/dist/mcp-server/tools/definitions/list-agencies.tool.js.map +1 -1
  60. package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts +2 -0
  61. package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts.map +1 -1
  62. package/dist/mcp-server/tools/definitions/search-awards.tool.js +4 -10
  63. package/dist/mcp-server/tools/definitions/search-awards.tool.js.map +1 -1
  64. package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.d.ts +2 -0
  65. package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.d.ts.map +1 -1
  66. package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.js +2 -0
  67. package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.js.map +1 -1
  68. package/dist/mcp-server/tools/definitions/search-recipients.tool.d.ts +2 -0
  69. package/dist/mcp-server/tools/definitions/search-recipients.tool.d.ts.map +1 -1
  70. package/dist/mcp-server/tools/definitions/search-recipients.tool.js +2 -0
  71. package/dist/mcp-server/tools/definitions/search-recipients.tool.js.map +1 -1
  72. package/dist/mcp-server/tools/definitions/spending-by-category.tool.d.ts +2 -0
  73. package/dist/mcp-server/tools/definitions/spending-by-category.tool.d.ts.map +1 -1
  74. package/dist/mcp-server/tools/definitions/spending-by-category.tool.js +2 -0
  75. package/dist/mcp-server/tools/definitions/spending-by-category.tool.js.map +1 -1
  76. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.d.ts +2 -0
  77. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.d.ts.map +1 -1
  78. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js +2 -0
  79. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js.map +1 -1
  80. package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts +2 -0
  81. package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts.map +1 -1
  82. package/dist/mcp-server/tools/definitions/spending-over-time.tool.js +2 -0
  83. package/dist/mcp-server/tools/definitions/spending-over-time.tool.js.map +1 -1
  84. package/dist/services/usaspending/usaspending-service.d.ts +7 -1
  85. package/dist/services/usaspending/usaspending-service.d.ts.map +1 -1
  86. package/dist/services/usaspending/usaspending-service.js +11 -2
  87. package/dist/services/usaspending/usaspending-service.js.map +1 -1
  88. package/package.json +12 -10
  89. package/server.json +3 -3
package/CLAUDE.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** usaspending-mcp-server
4
- **Version:** 0.4.1
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.0`
6
- **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
- **MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
8
- **Zod:** ^4.4.3
4
+ **Version:** 0.4.3
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
6
+ **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
+ **MCP SDK:** `@modelcontextprotocol/server` + `@modelcontextprotocol/client` ^2.0.0
8
+ **Zod:** ^4.6.5
9
9
 
10
10
  > **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.
11
11
 
@@ -35,8 +35,9 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
35
35
  - **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
36
36
  - **Use `ctx.log`** for request-scoped logging. No `console` calls.
37
37
  - **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
38
- - **Check `ctx.elicit`** for presence before calling.
38
+ - **Need input the caller didn't supply?** `return ctx.requestInput(...)` and read `ctx.inputs` when the handler is re-entered. Never `await` for user input mid-handler.
39
39
  - **Secrets in env vars only** — never hardcoded.
40
+ - **Cut noise.** Add only what earns its place: no speculative generality, no guards for states the framework already prevents (Zod-validated params, classified errors), no abstraction until a third caller proves it, no option nothing sets.
40
41
  - **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed and close it. Do both — a comment without a close leaves stale issues open; a close without a comment leaves no record of what shipped. The comment is for future readers — state the concrete changes, not the conversation that produced them.
41
42
 
42
43
  ---
@@ -91,7 +92,7 @@ export const itemData = resource('inventory://{itemId}', {
91
92
  params: z.object({ itemId: z.string().describe('Item identifier') }),
92
93
  auth: ['inventory:read'],
93
94
  async handler(params, ctx) {
94
- const item = await ctx.state.get(`item:${params.itemId}`);
95
+ const item = await ctx.state.get(`item/${params.itemId}`);
95
96
  if (!item) throw notFound(`Item ${params.itemId} not found`, { itemId: params.itemId });
96
97
  return item;
97
98
  },
@@ -125,6 +126,7 @@ import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
125
126
  const ServerConfigSchema = z.object({
126
127
  apiKey: z.string().describe('External API key'),
127
128
  maxResults: z.coerce.number().default(100),
129
+ verboseLogging: z.stringbool().default(false).describe('Enable verbose logging'),
128
130
  });
129
131
 
130
132
  let _config: z.infer<typeof ServerConfigSchema> | undefined;
@@ -132,6 +134,7 @@ export function getServerConfig() {
132
134
  _config ??= parseEnvConfig(ServerConfigSchema, {
133
135
  apiKey: 'MY_API_KEY',
134
136
  maxResults: 'MY_MAX_RESULTS',
137
+ verboseLogging: 'MY_VERBOSE_LOGGING',
135
138
  });
136
139
  return _config;
137
140
  }
@@ -158,6 +161,22 @@ await createApp({
158
161
 
159
162
  `instructions` is optional server-level orientation, sent on every `initialize` as session-level context. Use it for deployment guidance (connection aliases, regional notes, scope hints) instead of repeating the same context across tool descriptions. Client adoption is uneven, but there's no downside when set.
160
163
 
164
+ ### Session posture and shutdown
165
+
166
+ Two more `createApp()` options shape how the server runs rather than how it presents itself:
167
+
168
+ ```ts
169
+ await createApp({
170
+ sessionMode: 'stateless', // or { default: 'stateful', require: 'stateful' }
171
+ setup(core) { startMyWatcher(core.config); },
172
+ async teardown() { await stopMyWatcher(); },
173
+ });
174
+ ```
175
+
176
+ `sessionMode` declares the HTTP session posture in `src/` instead of leaving it to a deployment's `MCP_SESSION_MODE`, which still wins whenever it carries a meaningful value (an empty string and an unsubstituted `${…}` placeholder read as unset and fall through to the option). Add `require: 'stateful'` when a tool asks the caller for input mid-handler via `ctx.requestInput`: startup then fails with a `ConfigurationError` rather than serving a mode in which a 2025-era client can never answer the prompt. Stdio is never refused.
177
+
178
+ `teardown(core)` is the `setup()` counterpart — release a watcher, socket, or non-`unref()`'d timer there. It runs after the transport stops and before the logger closes, on every shutdown path, and a signal-triggered shutdown then exits the process explicitly (0, or 1 if a step never settles within the framework's 10 s ceiling).
179
+
161
180
  ---
162
181
 
163
182
  ## Context
@@ -166,13 +185,13 @@ Handlers receive a unified `ctx` object. Key properties:
166
185
 
167
186
  | Property | Description |
168
187
  |:---------|:------------|
169
- | `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
188
+ | `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. Dual-sink: Pino **and** `notifications/message` to the client, so treat it as client-visible. |
170
189
  | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
171
- | `ctx.elicit` | Ask user for structured input — form call `(message, schema)` or `.url(message, url)` for an external link. **Check for presence first:** `if (ctx.elicit) { ... }` |
190
+ | `ctx.requestInput` | Suspend and ask the caller for more input — `return ctx.requestInput({ inputRequests: { key: inputRequired.elicit({ message, requestedSchema }) } })`. Never returns; the handler is re-entered with the answers. Always present. |
191
+ | `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
172
192
  | `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
173
193
  | `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
174
194
  | `ctx.signal` | `AbortSignal` for cancellation. |
175
- | `ctx.progress` | Task progress (present when `task: true`) — `.setTotal(n)`, `.increment()`, `.update(message)`. |
176
195
  | `ctx.requestId` | Unique request ID. |
177
196
  | `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
178
197
 
@@ -182,7 +201,7 @@ Handlers receive a unified `ctx` object. Key properties:
182
201
 
183
202
  Handlers throw — the framework catches, classifies, and formats.
184
203
 
185
- **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
204
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Forwarding it is lint-enforced per throw site (`error-contract-recovery-unforwarded`). Mark an entry the service layer throws with `thrownBy: 'service'` so `error-contract-unthrown` skips it — lint-only metadata, nothing at runtime reads it. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
186
205
 
187
206
  ```ts
188
207
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
@@ -215,7 +234,7 @@ throw new Error('Invalid query format'); // → ValidationError
215
234
 
216
235
  // McpError — when no factory exists for the code
217
236
  import { McpError, JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
218
- throw new McpError(JsonRpcErrorCode.DatabaseError, 'Connection failed', { pool: 'primary' });
237
+ throw new McpError(JsonRpcErrorCode.InitializationFailed, 'Connection failed', { pool: 'primary' });
219
238
  ```
220
239
 
221
240
  See framework CLAUDE.md and the `api-errors` skill for the full auto-classification table, all available factories, and the contract reference.
@@ -257,9 +276,9 @@ src/
257
276
 
258
277
  ## Skills
259
278
 
260
- Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry.
279
+ Skills are modular instructions in `framework-skills/` at the project root. Read them directly when a task matches — e.g., `framework-skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry. The directory is deliberately not `skills/`: Claude Code and Codex auto-load a plugin's root `skills/`, so a server that ships `.claude-plugin/` or `.codex-plugin/` would hand these development skills to every agent that installs it. Keep `skills/` free for skills meant for those agents.
261
280
 
262
- **Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
281
+ **Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `framework-skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
263
282
 
264
283
  Available skills:
265
284
 
@@ -278,8 +297,9 @@ Available skills:
278
297
  | `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
279
298
  | `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
280
299
  | `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
281
- | `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
282
- | `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
300
+ | `git-wrapup` | Land working-tree changes as a commit stack — version bump, changelog, verify, commit by concern, release commit on top. No tag, no push to main; opens the release PR when the project declares release PR mode |
301
+ | `release-pr-review` | Review pass on an open release PR — simplifier + correctness review, fixes as ordinary commits on top of the stack, PR body kept in sync. Release PR mode only |
302
+ | `release-and-publish` | Fast-forward merge (release PR mode) + tag + push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
283
303
  | `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
284
304
  | `orchestrations` | Chain task skills into a gated multi-phase pipeline — build-out, QA-fix, update-ship — when you can spawn sub-agents |
285
305
  | `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
@@ -288,7 +308,7 @@ Available skills:
288
308
  | `api-auth` | Auth modes, scopes, JWT/OAuth |
289
309
  | `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
290
310
  | `api-config` | AppConfig, parseConfig, env vars |
291
- | `api-context` | Context interface, logger, state, progress |
311
+ | `api-context` | Context interface, RequestContext, logger, state, multi-round-trip input |
292
312
  | `api-errors` | McpError, JsonRpcErrorCode, error patterns |
293
313
  | `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
294
314
  | `api-mirror` | MirrorService: persistent self-refreshing local mirror (embedded SQLite + FTS5) of a bulk upstream dataset — Tier 3 opt-in |
@@ -298,7 +318,7 @@ Available skills:
298
318
  | `api-telemetry` | OTel catalog: spans, metrics, completion logs, env config, cardinality rules |
299
319
  | `api-workers` | Cloudflare Workers runtime |
300
320
 
301
- **Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
321
+ **Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `framework-skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
302
322
 
303
323
  When you complete a skill's checklist, check the boxes and add a completion timestamp at the end (e.g., `Completed: 2026-03-11`).
304
324
 
@@ -314,7 +334,8 @@ When you complete a skill's checklist, check the boxes and add a completion time
314
334
  | `bun run rebuild` | Clean + build |
315
335
  | `bun run clean` | Remove build artifacts |
316
336
  | `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
317
- | `bun run audit:refresh` | Delete `bun.lock`, reinstall, and re-run `bun audit`. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
337
+ | `bun run audit:fix` | `bun audit fix` — upgrade vulnerable packages to the lowest safe version within existing ranges (`--dry-run` previews, `--latest` rewrites ranges). First response when `devcheck` flags a transitive advisory; then `bun update <name>`, then `bun dedupe` |
338
+ | `bun run audit:refresh` | Delete `bun.lock` and reinstall. Last resort after `audit:fix`, `bun update <name>`, and `bun dedupe` — re-resolves every ranged dep (the framework pin included) and rewrites the lockfile as `lockfileVersion: 2` |
318
339
  | `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
319
340
  | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
320
341
  | `bun run list-skills` | Print the skill registry |
@@ -328,15 +349,17 @@ When you complete a skill's checklist, check the boxes and add a completion time
328
349
  | `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
329
350
  | `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
330
351
 
352
+ **CI is one file.** `.github/workflows/codeql.yml` (scaffolded) is the only GitHub Actions workflow: CodeQL is GitHub-owned end to end, and the file runs only while the repo's CodeQL *default setup* is turned off. Verification — `devcheck`, tests, the release gates — runs locally; don't add a workflow that re-runs it.
353
+
331
354
  ---
332
355
 
333
356
  ## Bundling
334
357
 
335
- `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
358
+ `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
336
359
 
337
- **Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
360
+ **Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match, that every `user_config` option is wired into `mcp_config.env` as `"X": "${user_config.X}"` (the host substitutes nothing else — `"${X}"` reaches the server as that literal string), and that an optional string option carries `"default": ""`.
338
361
 
339
- **README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `skills/polish-docs-meta/references/readme.md`.
362
+ **README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `framework-skills/polish-docs-meta/references/readme.md`.
340
363
 
341
364
  ---
342
365
 
@@ -361,12 +384,18 @@ security: false # optional — true ONLY for a source
361
384
 
362
385
  `agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
363
386
 
364
- **Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security. Include only sections with entries — don't ship empty headers.
387
+ **Section order:** the Keep a Changelog sequence — Added, Changed, Deprecated, Removed, Fixed, Security — then `Dependencies` last. Include only sections with entries — don't ship empty headers.
365
388
 
366
389
  **Tag annotations** render as GitHub Release bodies via `--notes-from-tag`. They must be structured markdown — never a flat comma-separated string. Subject omits the version number (GitHub prepends it). See `changelog/template.md` for the full format reference.
367
390
 
368
391
  ---
369
392
 
393
+ ## Publishing
394
+
395
+ **Every release goes through a release PR, straight-through** — `git-wrapup`'s "Release PR mode", mode `straight-through`. One run: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the changelog entry plus a gates section); `release-and-publish` then fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. A caller's brief may run a given release as `gated` instead — a `release-pr-review` pass on the open PR before `release-and-publish`. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
396
+
397
+ ---
398
+
370
399
  ## Imports
371
400
 
372
401
  ```ts
@@ -393,7 +422,7 @@ import { getMyService } from '@/services/my-domain/my-service.js';
393
422
  - [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
394
423
  - [ ] Registered in `createApp()` arrays (directly or via barrel exports)
395
424
  - [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
396
- - [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = package name; `interface.shortDescription` from `package.json` description
397
- - [ ] `.codex-plugin/mcp.json` updated — server name key matches `package.json` name; env vars added for any required API keys
398
- - [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; inline `mcpServers` entry with server name key, env vars for any required API keys
425
+ - [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = the unscoped repo name (never the npm scope — `lint:packaging` enforces this); `interface.shortDescription` from `package.json` description
426
+ - [ ] `.codex-plugin/mcp.json` updated — server name key is the unscoped repo name; every user-supplied variable (API key, contact email, instance URL) is listed in `env_vars` so Codex forwards it from the user's environment. Never write `"KEY": ""` into `env` — an empty value replaces the user's exported key and is read as unset
427
+ - [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `author`, `repository`, `license`, `keywords` from `package.json`; inline `mcpServers` entry keyed by the unscoped repo name. Every user-supplied variable is declared under `userConfig` (`type`, `title`, `description`; `sensitive: true` for keys and tokens; `required: true` or `default: ""`) and referenced from `env` as `"KEY": "${user_config.<option>}"` — mirror the `user_config` block in `manifest.json`. Never write `"KEY": ""` into `env`
399
428
  - [ ] `npm run devcheck` passes
package/Dockerfile CHANGED
@@ -3,8 +3,17 @@
3
3
  #
4
4
  # This stage installs all dependencies (including dev), builds the TypeScript
5
5
  # source code into JavaScript, and prepares the production assets.
6
+ #
7
+ # Pinned to $BUILDPLATFORM — the build host's native architecture — rather than
8
+ # the target. `bun run build` is `tsc` + `tsc-alias`, so its output is
9
+ # platform-independent JavaScript, and the production stage below copies only
10
+ # `dist/`; nothing architecture-specific crosses the stage boundary. Emulating
11
+ # this stage buys nothing and costs correctness: Bun 1.4.0 aborts under QEMU's
12
+ # linux/amd64 emulation (`qemu: uncaught target signal 6`, exit 134), so a
13
+ # multi-arch build from an arm64 host dies here. Cross-compiling sidesteps the
14
+ # emulator entirely and drops a slow emulated TypeScript compile per target.
6
15
  # ==============================================================================
7
- FROM oven/bun:1.3.14 AS build
16
+ FROM --platform=$BUILDPLATFORM oven/bun:1.4.0 AS build
8
17
 
9
18
  WORKDIR /usr/src/app
10
19
 
@@ -30,7 +39,7 @@ RUN bun run build
30
39
  # application. It uses a slim base image and only includes production
31
40
  # dependencies and build artifacts.
32
41
  # ==============================================================================
33
- FROM oven/bun:1.3.14-slim AS production
42
+ FROM oven/bun:1.4.0-slim AS production
34
43
 
35
44
  WORKDIR /usr/src/app
36
45
 
@@ -51,8 +60,13 @@ COPY package.json bun.lock ./
51
60
 
52
61
  # Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
53
62
  # that are not needed in the final production image.
63
+ # `--omit=peer` drops the framework's optional peer tiers (test runner, service
64
+ # SDKs, parsers) that Bun would otherwise auto-install. Anything this server
65
+ # actually imports belongs in its own `dependencies`, so nothing needed at
66
+ # runtime is lost. The OTEL step below carries the same flag — without it, that
67
+ # install re-resolves the graph and pulls every optional peer back in.
54
68
  RUN --mount=type=cache,target=/root/.bun/install/cache \
55
- bun install --production --frozen-lockfile --ignore-scripts
69
+ bun install --production --omit=peer --frozen-lockfile --ignore-scripts
56
70
 
57
71
  # Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
58
72
  # These are not bundled by default to keep the base image lean. Enable at build time
@@ -60,7 +74,7 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
60
74
  ARG OTEL_ENABLED=true
61
75
  RUN --mount=type=cache,target=/root/.bun/install/cache \
62
76
  if [ "$OTEL_ENABLED" = "true" ]; then \
63
- bun add --omit=dev --ignore-scripts @hono/otel \
77
+ bun add --omit=dev --omit=peer --ignore-scripts @hono/otel \
64
78
  @opentelemetry/instrumentation-http \
65
79
  @opentelemetry/exporter-metrics-otlp-http \
66
80
  @opentelemetry/exporter-trace-otlp-http \
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.4.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/usaspending-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/usaspending-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/usaspending-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-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.4.3-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/usaspending-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/usaspending-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/usaspending-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-v1.4.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -27,9 +27,11 @@
27
27
 
28
28
  ---
29
29
 
30
- ## Tools
30
+ ## Overview
31
31
 
32
- 18 tools covering the full USAspending.gov API surface — award discovery and detail, recipient and agency profiles, spending analytics (by geography, category, and time), disaster/emergency spending, and federal account data:
32
+ Federal award, recipient, agency, and spending data from USAspending.gov, the US Treasury's DATA Act transparency platform. Search and trace federal awards, profile recipients and agencies, and aggregate spending by geography, category, and time from any MCP client. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
33
+
34
+ ### Tools
33
35
 
34
36
  | Tool | Description |
35
37
  |:---|:---|
@@ -43,7 +45,7 @@
43
45
  | `usaspending_get_recipient` | Fetch a recipient's profile: address, business types, parent organization, alternate names, and total award amounts by type. |
44
46
  | `usaspending_get_agency` | Fetch an agency's fiscal year overview: mission, budget authority, obligation totals, sub-agency count, and DEF codes. Accepts a 3-digit `toptier_code` or an `agency_slug` from award search results. |
45
47
  | `usaspending_spending_by_geography` | Aggregate federal spending by state, county, or congressional district. Returns per-capita figures when combined with population data. |
46
- | `usaspending_spending_by_category` | Aggregate spending grouped by NAICS code, PSC code, awarding agency, funding agency, CFDA program, or recipient. Returns top items with amounts for trend and breakdown analysis. |
48
+ | `usaspending_spending_by_category` | Aggregate spending grouped by NAICS, PSC, awarding/funding agency (toptier or subtier), CFDA program, or recipient (by DUNS). Returns top items with amounts for trend and breakdown analysis. |
47
49
  | `usaspending_spending_over_time` | Fetch aggregated spending by fiscal year, fiscal quarter, or fiscal month. Filter by award type, agency, recipient, or keyword to trace trends in a specific area. |
48
50
  | `usaspending_disaster_spending` | Fetch disaster and emergency supplemental spending (COVID-19, hurricanes, etc.) broken down by agency, CFDA program, recipient, or geography. Filter by DEF codes to isolate a specific appropriation. |
49
51
  | `usaspending_get_federal_account` | Fetch a federal account's budget data: total obligations, outlays, budgetary resources, and the per-Treasury-Account-Symbol component breakdown. Account codes come from `usaspending_search_federal_accounts`. |
@@ -52,9 +54,9 @@
52
54
  | `usaspending_list_agencies` | List all top-tier federal agencies with toptier codes, budget authority amounts, and obligation totals. Entry point for agency navigation. |
53
55
  | `usaspending_autocomplete_filters` | Look up valid code values for filter fields: NAICS, PSC, CFDA, recipient names, or agency names. Use before filtering to discover the right code from a description. |
54
56
 
55
- ### `usaspending_search_awards`
57
+ ## Capability reference
56
58
 
57
- Search for federal awards across contracts, grants, loans, direct payments, and IDVs.
59
+ ### `usaspending_search_awards` <sub>tool</sub>
58
60
 
59
61
  - Full-text keyword search across award descriptions, recipient names, and locations
60
62
  - Filter by award type codes (`A/B/C/D` = contracts, `02/03/04/05` = grants, `06/10` = direct payments, `07/08` = loans, `IDV_*` = IDVs)
@@ -65,9 +67,7 @@ Search for federal awards across contracts, grants, loans, direct payments, and
65
67
 
66
68
  ---
67
69
 
68
- ### `usaspending_get_award`
69
-
70
- Fetch complete details for a single federal award by its generated ID.
70
+ ### `usaspending_get_award` <sub>tool</sub>
71
71
 
72
72
  - Returns type, description, total obligation, date signed, and subaward count
73
73
  - Exposes `recipient.recipient_hash` for chaining to `usaspending_get_recipient`
@@ -78,9 +78,7 @@ Fetch complete details for a single federal award by its generated ID.
78
78
 
79
79
  ---
80
80
 
81
- ### `usaspending_get_idv_awards`
82
-
83
- List child contracts and orders placed under an IDV (Indefinite Delivery Vehicle) award.
81
+ ### `usaspending_get_idv_awards` <sub>tool</sub>
84
82
 
85
83
  - `award_id` must be the `generated_unique_award_id` of the parent IDV — from `usaspending_search_awards` (`generated_internal_id` field) or from `usaspending_get_award`
86
84
  - `type` selects what to list: `child_awards` (task/delivery orders), `child_idvs` (sub-IDVs), or `grandchild_awards`
@@ -90,18 +88,14 @@ List child contracts and orders placed under an IDV (Indefinite Delivery Vehicle
90
88
 
91
89
  ---
92
90
 
93
- ### `usaspending_get_award_transactions`
94
-
95
- List obligation history and modifications for an award.
91
+ ### `usaspending_get_award_transactions` <sub>tool</sub>
96
92
 
97
93
  - Each row is one transaction: `action_date`, `federal_action_obligation`, `modification_number`, and description
98
94
  - Pagination via `limit` and `page`; configurable sort and order. No `total` count is available from this endpoint
99
95
 
100
96
  ---
101
97
 
102
- ### `usaspending_get_award_subawards`
103
-
104
- List subawards under a prime contract or grant.
98
+ ### `usaspending_get_award_subawards` <sub>tool</sub>
105
99
 
106
100
  - Each row covers: subaward number, description, action date, amount, and recipient name
107
101
  - Reveals the supply chain below the prime — who actually performs the work
@@ -109,9 +103,7 @@ List subawards under a prime contract or grant.
109
103
 
110
104
  ---
111
105
 
112
- ### `usaspending_get_award_federal_accounts`
113
-
114
- List the Treasury federal accounts that funded an award — the award → appropriation link.
106
+ ### `usaspending_get_award_federal_accounts` <sub>tool</sub>
115
107
 
116
108
  - `award_id` must be a `generated_unique_award_id` — from `usaspending_search_awards` (`generated_internal_id` field) or `usaspending_get_award`
117
109
  - Each row returns `federal_account` (AGENCY-MAIN format, e.g. `080-0120`) for chaining into `usaspending_get_federal_account`, plus the amount obligated from that account and the funding agency behind it
@@ -121,9 +113,7 @@ List the Treasury federal accounts that funded an award — the award → approp
121
113
 
122
114
  ---
123
115
 
124
- ### `usaspending_search_recipients`
125
-
126
- Search for organizations receiving federal funds by name, UEI, or DUNS.
116
+ ### `usaspending_search_recipients` <sub>tool</sub>
127
117
 
128
118
  - Returns recipient IDs (UUID hashes with level suffix: `-P` parent, `-C` child, `-R` root), UEI, DUNS, name, recipient level, and total award amount
129
119
  - `results[].id` chains to `usaspending_get_recipient`; `uei` and `duns` chain to SAM.gov or SEC EDGAR
@@ -131,9 +121,7 @@ Search for organizations receiving federal funds by name, UEI, or DUNS.
131
121
 
132
122
  ---
133
123
 
134
- ### `usaspending_get_recipient`
135
-
136
- Fetch a recipient's full profile.
124
+ ### `usaspending_get_recipient` <sub>tool</sub>
137
125
 
138
126
  - Returns address, business type classifications, parent organization, alternate names
139
127
  - Optionally scope to a specific fiscal year and award type
@@ -141,9 +129,7 @@ Fetch a recipient's full profile.
141
129
 
142
130
  ---
143
131
 
144
- ### `usaspending_get_agency`
145
-
146
- Fetch an agency's current fiscal year overview.
132
+ ### `usaspending_get_agency` <sub>tool</sub>
147
133
 
148
134
  - Returns mission, budget authority amount, obligation amount, sub-agency count, and DEF codes
149
135
  - Accepts either a 3-digit `toptier_code` (e.g., `097` for DoD) or an `agency_slug` (e.g., `department-of-defense`) — slugs appear in award search results, eliminating an intermediate lookup
@@ -151,9 +137,7 @@ Fetch an agency's current fiscal year overview.
151
137
 
152
138
  ---
153
139
 
154
- ### `usaspending_spending_by_geography`
155
-
156
- Aggregate federal spending by geographic unit.
140
+ ### `usaspending_spending_by_geography` <sub>tool</sub>
157
141
 
158
142
  - `scope`: `place_of_performance` or `recipient_location`
159
143
  - `geo_layer`: `state`, `county`, or `district`
@@ -164,20 +148,16 @@ Aggregate federal spending by geographic unit.
164
148
 
165
149
  ---
166
150
 
167
- ### `usaspending_spending_by_category`
151
+ ### `usaspending_spending_by_category` <sub>tool</sub>
168
152
 
169
- Aggregate spending broken down by a single dimension.
170
-
171
- - `category` enum maps to the right sub-route: `naics`, `psc`, `awarding_agency`, `funding_agency`, `cfda`, or `recipient`
153
+ - `category` enum maps to the right sub-route: `naics`, `psc`, `awarding_agency`, `awarding_subagency`, `funding_agency`, `funding_subagency`, `cfda`, `recipient_duns`, or `recipient_parent_duns`
172
154
  - Returns top items with amounts and codes for trend analysis
173
155
  - Accepts the standard award filter object for scoping to a specific agency, time period, or keyword
174
156
  - Pagination via `limit` and `page`; no `total` count is available from this endpoint
175
157
 
176
158
  ---
177
159
 
178
- ### `usaspending_spending_over_time`
179
-
180
- Fetch aggregated spending grouped by time period.
160
+ ### `usaspending_spending_over_time` <sub>tool</sub>
181
161
 
182
162
  - `group`: `fiscal_year`, `quarter`, or `month`
183
163
  - Filter by award type, agency, recipient, or keyword to trace trends in a specific area
@@ -185,9 +165,7 @@ Fetch aggregated spending grouped by time period.
185
165
 
186
166
  ---
187
167
 
188
- ### `usaspending_disaster_spending`
189
-
190
- Fetch disaster and emergency supplemental spending consolidated from nine+ API endpoints.
168
+ ### `usaspending_disaster_spending` <sub>tool</sub>
191
169
 
192
170
  - `dimension` enum selects the breakdown axis: `overview`, `agency`, `cfda`, `recipient`, or `geography`
193
171
  - `spending_type` selects between award-level obligations and outlays (`award`) and total spending including direct non-award amounts (`total`, agency and recipient dimensions only)
@@ -196,9 +174,7 @@ Fetch disaster and emergency supplemental spending consolidated from nine+ API e
196
174
 
197
175
  ---
198
176
 
199
- ### `usaspending_get_federal_account`
200
-
201
- Fetch budget data for a federal account identified by its account code.
177
+ ### `usaspending_get_federal_account` <sub>tool</sub>
202
178
 
203
179
  - Returns account title, federal account code, agency identifier, parent agency, and bureau
204
180
  - Includes the fiscal year snapshot: total obligations, gross outlays, and budgetary resources
@@ -208,9 +184,7 @@ Fetch budget data for a federal account identified by its account code.
208
184
 
209
185
  ---
210
186
 
211
- ### `usaspending_get_federal_account_breakdown`
212
-
213
- Break a federal account's obligations down by program activity or object class.
187
+ ### `usaspending_get_federal_account_breakdown` <sub>tool</sub>
214
188
 
215
189
  - `dimension` enum selects the axis: `program_activity` (what the money funds) or `object_class` (what it buys — personnel, supplies, contracts)
216
190
  - Each row returns the code, name, and obligated amount; `program_activity` rows also carry `type` — `PAC/PAN` (legacy program activity code/name) or `PARK` (Program Activity Reporting Key), both of which can appear for the same account
@@ -219,9 +193,7 @@ Break a federal account's obligations down by program activity or object class.
219
193
 
220
194
  ---
221
195
 
222
- ### `usaspending_search_federal_accounts`
223
-
224
- List and keyword-search federal accounts by agency or title keyword.
196
+ ### `usaspending_search_federal_accounts` <sub>tool</sub>
225
197
 
226
198
  - `keyword` filters by account name/title (e.g., `"defense"`, `"transportation"`)
227
199
  - `agency_identifier` filters to a specific agency by 3-digit code (e.g., `"097"` for DoD) — use `usaspending_list_agencies` to look up codes
@@ -231,9 +203,7 @@ List and keyword-search federal accounts by agency or title keyword.
231
203
 
232
204
  ---
233
205
 
234
- ### `usaspending_list_agencies`
235
-
236
- List all top-tier federal agencies.
206
+ ### `usaspending_list_agencies` <sub>tool</sub>
237
207
 
238
208
  - Returns agency name, abbreviation, `toptier_code`, `agency_slug`, obligated amount, and budget authority amount for the current fiscal year
239
209
  - Entry point for agency navigation — `toptier_code` is required by `usaspending_get_agency` and agency filters
@@ -241,9 +211,7 @@ List all top-tier federal agencies.
241
211
 
242
212
  ---
243
213
 
244
- ### `usaspending_autocomplete_filters`
245
-
246
- Discover valid code values for award filter fields.
214
+ ### `usaspending_autocomplete_filters` <sub>tool</sub>
247
215
 
248
216
  - `type` enum selects the lookup: `naics`, `psc`, `cfda`, `awarding_agency`, or `recipient`
249
217
  - Returns matching codes and names — use before filtering to find the right code when you only know a description (e.g., "software" → NAICS codes); `recipient` matches also carry `uei`/`duns`
@@ -253,14 +221,7 @@ Discover valid code values for award filter fields.
253
221
 
254
222
  ## Features
255
223
 
256
- Built on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core):
257
-
258
- - Declarative tool definitions — single file per tool, framework handles registration and validation
259
- - Unified error handling — handlers throw, framework catches, classifies, and formats
260
- - Pluggable auth: `none`, `jwt`, `oauth`
261
- - Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`
262
- - Structured logging with optional OpenTelemetry tracing
263
- - STDIO and Streamable HTTP transports
224
+ Built 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.
264
225
 
265
226
  USAspending-specific:
266
227
 
@@ -400,6 +361,7 @@ All configuration is validated at startup via Zod schemas in `src/config/server-
400
361
  | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
401
362
  | `MCP_HTTP_PORT` | Port for the HTTP server. | `3010` |
402
363
  | `MCP_HTTP_ENDPOINT_PATH` | HTTP endpoint path. | `/mcp` |
364
+ | `MCP_SESSION_MODE` | Session mode: `auto`, `stateful`, or `stateless`; `auto` resolves to `stateful`. Shipped as `stateless` in both `.env.example` and the Dockerfile — this server holds no per-session state. | `auto` |
403
365
  | `MCP_PUBLIC_URL` | Public origin override for TLS-terminating reverse-proxy deployments. | — |
404
366
  | `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |
405
367
  | `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`, etc.). | `info` |
@@ -463,7 +425,7 @@ See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rule
463
425
 
464
426
  ## Contributing
465
427
 
466
- Issues and pull requests are welcome. Run checks and tests before submitting:
428
+ Issues are welcome. Run checks and tests before submitting:
467
429
 
468
430
  ```sh
469
431
  bun run devcheck
@@ -0,0 +1,28 @@
1
+ ---
2
+ summary: "Adopts mcp-ts-core ^0.12.3 (SDK v2): tool inputs are now strict, the advertised outputSchema declares the error envelope, protocol revision 2026-07-28 is served everywhere, and session mode is pinned to stateless on every surface."
3
+ breaking: true
4
+ security: false
5
+ ---
6
+
7
+ # 0.4.2 — 2026-08-24
8
+
9
+ ## Added
10
+
11
+ - **Protocol revision `2026-07-28` is served on every HTTP endpoint**, alongside the existing 2025-era revisions — a 2025 client keeps working unchanged.
12
+ - **`tools/list` carries a cache hint** — the tool surface is 18 compiled-in definitions with no dynamic registration or per-caller filtering, so it changes only on redeploy. `cacheHints: { 'tools/list': { ttlMs: 3_600_000, cacheScope: 'public' } }` lets a 2026-era client cache it for an hour; 2025-era clients are unaffected.
13
+
14
+ ## Changed
15
+
16
+ - **Breaking: tool arguments are strict.** Every tool's advertised `inputSchema` now carries `additionalProperties: false`, and an argument key a tool's schema doesn't declare is rejected by name (`Unrecognized key: "..."`) instead of being silently dropped. A call that previously succeeded with an extra or misspelled key — its filter never applied — now fails instead of returning results the caller misread as filtered.
17
+ - **The advertised `outputSchema` declares the error envelope** — success fields are optional and `error` is a declared member. A client that validates `structuredContent` without checking `isError` no longer rejects error results.
18
+ - **`MCP_SESSION_MODE` is explicit `stateless` on every surface that sets it.** `.env.example` previously left the variable commented out, resolving through `auto` to `stateful`, while the Dockerfile already set `stateless` — a container and a source run served different session modes. `.env.example` now ships uncommented with `stateless` and documents all three accepted values (`auto` / `stateful` / `stateless`) and the real default; the README configuration table gains a row for it.
19
+
20
+ ## Fixed
21
+
22
+ - **The production Docker image no longer pulls the framework's optional peer dependencies** (test runner, service SDKs, parsers) — `bun install --production` now passes `--omit=peer`, so only what this server actually imports lands in the image; the OTel install step carries the same flag so it doesn't re-resolve the graph and pull them back in.
23
+
24
+ ## Dependencies
25
+
26
+ - `@cyanheads/mcp-ts-core` `^0.11.0` → `^0.12.3` — nine releases, including the SDK v2 migration in 0.12.0 (`@modelcontextprotocol/sdk` + `@hono/mcp` replaced by `@modelcontextprotocol/server` + `@modelcontextprotocol/client`, `ctx.elicit` replaced by `ctx.requestInput`/`ctx.inputs`, the experimental tasks surface removed).
27
+ - `bun` `1.3.14` → `1.4.0` (`packageManager`, `Dockerfile` base images).
28
+ - `@biomejs/biome` `^2.5.5` → `^2.5.10`, `@types/node` `^26.0.0` → `^26.2.0`, `ignore` `^7.0.5` → `^7.0.6`, `tsc-alias` `^1.8.17` → `^1.9.2`, `vitest` `^4.1.9` → `^4.1.11`.
@@ -0,0 +1,33 @@
1
+ ---
2
+ summary: "Adopts mcp-ts-core ^0.13.6: the framework skill tree moves to framework-skills/, the stateless session posture is declared in src/, and every error-contract entry the service layer throws is marked thrownBy: 'service' while handler-local throws forward their declared recovery hint."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.4.3 — 2026-09-20
8
+
9
+ ## Added
10
+
11
+ - **`AGENTS.md`** — the agent-protocol twin of `CLAUDE.md`, byte-identical and shipped in the npm package. Agents that read `AGENTS.md` were previously left without a protocol file.
12
+ - **`bun run audit:fix`** (`bun audit fix`) — the first step of transitive-advisory triage, ahead of `bun update <name>`, `bun dedupe`, and `audit:refresh`.
13
+
14
+ ## Changed
15
+
16
+ - **The framework skill tree moved from `skills/` to `framework-skills/`.** Claude Code and Codex auto-load a plugin's root `skills/`, so this server's `.claude-plugin/` and `.codex-plugin/` manifests handed its development skills to every agent that installed it. The `.claude/skills/` mirror keeps its name.
17
+ - **`createApp({ sessionMode: 'stateless' })` declares the session posture in `src/`**, where `.env.example`, the `Dockerfile`, and the README table already set it. `MCP_SESSION_MODE` still wins when it carries a meaningful value.
18
+ - **Every `errors[]` entry the service layer produces carries `thrownBy: 'service'`** — `api_unavailable` and `api_timeout` on all 18 tools, which `usaspending-service.ts` throws as `serviceUnavailable(...)` and `timeout(...)`.
19
+ - **Handler-local `ctx.fail` sites forward `ctx.recoveryFor(<reason>)`** instead of restating the declared `recovery` as a divergent inline hint, so one text reaches both the advertised contract and the wire. `usaspending_autocomplete_filters` keeps an explicit hint, which quotes the caller's own `search_text`.
20
+ - **`usaspending_get_agency`'s `missing_input` recovery names `usaspending_list_agencies`** alongside the two accepted argument shapes.
21
+ - **Tool error responses change on three points a client may branch on.** An argument the schema rejects returns `InvalidParams` (`-32602`) where it returned `ValidationError` (`-32007`), carrying `data.reason: "invalid_arguments"` and a hint naming the offending field. Any error whose data carries a `reason` or a boolean `retryable` closes its text with `(reason <reason> · not retryable)`. A USAspending 500 or 501 is `ServiceUnavailable` and is retried, where a 500 previously failed on the first attempt. Match error text by substring rather than byte-exact; `structuredContent` is otherwise unchanged.
22
+ - **Bun engines floor raised to `>=1.4.0`**, required by the framework since 0.12.9.
23
+ - Shipped skills resynced to the framework's current versions, including `add-tool` 2.20 → 2.29, `api-errors` 1.7 → 1.15, `api-linter` 1.12 → 1.17, `release-and-publish` 1.11 → 2.19, and the new `release-pr-review` 1.4.
24
+
25
+ ## Fixed
26
+
27
+ - **A caller-initiated abort classifies as `RequestCancelled` (`-32011`), not `InternalError`** — the framework stopped hand-building an `InternalError` on `fetchWithTimeout`'s external-abort path in 0.12.4. The service's own budget `Timeout` is unaffected; only a caller that went away changes code.
28
+
29
+ ## Dependencies
30
+
31
+ - `@cyanheads/mcp-ts-core` `^0.12.3` → `^0.13.6` — thirteen releases, including the skill-tree move (0.13.0), `sessionMode`/`teardown` on `createApp()` (0.13.1), argument rejections carrying `InvalidParams` with a synthesized recovery hint (0.12.7, 0.13.2, 0.13.3), and the `error-contract-unthrown` / `error-contract-recovery-unforwarded` lint rules (0.13.5, 0.13.6).
32
+ - `zod` `^4.4.3` → `^4.6.5`.
33
+ - `@biomejs/biome` `^2.5.10` → `^2.5.14`, `@types/node` `^26.2.0` → `^26.6.1`, `ignore` `^7.0.6` → `^7.0.9`, `tsc-alias` `^1.9.2` → `^1.9.5`, `vitest` `^4.1.11` → `^5.0.1`.