@pipeworx/mcp-nyfed-markets 0.1.0
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/LICENSE +21 -0
- package/README.md +139 -0
- package/bin/cli.js +17 -0
- package/package.json +32 -0
- package/server.json +18 -0
- package/src/index.ts +1270 -0
- package/src/server.ts +45 -0
- package/tsconfig.json +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mojibake Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# @pipeworx/nyfed-markets
|
|
2
|
+
|
|
3
|
+
The New York Fed's Markets Data APIs — operation-level repo/reverse repo (ON RRP) auction results, securities lending operations, SOMA portfolio holdings, the Desk's reference rates (SOFR, EFFR, OBFR, TGCR, BGCR), and primary dealer survey statistics. This is the operation- and security-level data underneath FRED's daily rate aggregates, not a duplicate of them.
|
|
4
|
+
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1679+ live data sources.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
- `nyfed_repo_operations(operation_type, start_date, end_date, term, limit)` — repo/reverse repo (ON RRP) auction results: totals, counterparty counts, award rates, by-security-type breakdown.
|
|
10
|
+
- `nyfed_seclending_operations(operation, start_date, end_date, cusips, limit)` — securities lending operation results (daily program + extended-term).
|
|
11
|
+
- `nyfed_soma_holdings(view, holding_type, as_of_date, cusip, limit)` — SOMA portfolio: summary by asset bucket over time, or full CUSIP-level Treasury/Agency snapshots by date, or one CUSIP's full holdings history.
|
|
12
|
+
- `nyfed_reference_rates(rate_type, number)` — SOFR/SOFRAI/TGCR/BGCR (secured) and EFFR/OBFR (unsecured), latest or recent history with percentile bands and volume.
|
|
13
|
+
- `nyfed_primary_dealer_stats(mode, keyid_filter, seriesbreak, limit)` — FR 2004 weekly primary dealer positioning/transaction survey; `mode=list_series` browses the keyid catalog, `mode=latest` returns current values.
|
|
14
|
+
|
|
15
|
+
## Auth
|
|
16
|
+
|
|
17
|
+
Keyless. No registration, no API key, no rate-limit headers observed.
|
|
18
|
+
|
|
19
|
+
## Data sources
|
|
20
|
+
|
|
21
|
+
- `https://markets.newyorkfed.org/api/rp/...` — repo/reverse repo operations.
|
|
22
|
+
- `https://markets.newyorkfed.org/api/seclending/...` — securities lending operations.
|
|
23
|
+
- `https://markets.newyorkfed.org/api/soma/...` — SOMA holdings (summary, Treasury, Agency).
|
|
24
|
+
- `https://markets.newyorkfed.org/api/rates/...` — reference rates.
|
|
25
|
+
- `https://markets.newyorkfed.org/api/pd/...` — primary dealer statistics.
|
|
26
|
+
- Swagger spec: `https://markets.newyorkfed.org/static/docs/markets-api.yml` (the `.html` doc page is a JS SPA that renders this file — fetch the `.yml` directly, the `.html` is useless to scrape).
|
|
27
|
+
|
|
28
|
+
### Traps
|
|
29
|
+
|
|
30
|
+
- **`/api/rp/results/search.json`'s `operationTypes` query parameter is a confirmed SILENT NO-OP.** Querying with `operationTypes=Reverse Repo` still returns `Repo` rows mixed in (verified live: 21 rows for a 9-day window that should have been ~7 RRP-only rows). `method` and `term` on that endpoint are unverified and not trusted either. This pack always filters `operationType`/`term` client-side after fetching. The path-based filter on the `latest` endpoint (`/api/rp/{reverserepo|repo|all}/all/results/latest.json`) DOES work correctly and is used for same-day queries instead.
|
|
31
|
+
- **SOMA holdings publish on a ~1 week lag.** `/api/soma/asofdates/latest.json` returned `2026-09-16` when probed on `2026-09-23` — normal, not a bug. `as_of_date` defaults to this latest published date.
|
|
32
|
+
- **The agency holding-type path segment `agency debts` contains a literal space** (`/api/soma/agency/get/agency debts/asof/{date}.json`). The tool accepts the friendly `agency_debts` and URL-encodes the space for you.
|
|
33
|
+
- **`holding_type=all` on the treasury/agency SOMA endpoints returns EVERY CUSIP at that date** — hundreds of rows. This pack truncates to `limit` (default 20) and always reports `total_holdings` so the truncation is visible rather than silent.
|
|
34
|
+
- **Primary dealer keyids are opaque codes** (e.g. `PDPOSMBS-TOT`) grouped into "series break" windows whose definitions can change over time (`/api/pd/list/seriesbreaks.json` is authoritative). This pack resolves "current" as the window whose `enddate` is `9999-12-31` rather than hardcoding a window id, so it keeps working across the next series break without a code change.
|
|
35
|
+
- **Reference rates for a given `effectiveDate` are published the NEXT business day** — EFFR/OBFR/TGCR/BGCR "today" have not been observed yet; only SOFR/SOFRAI sometimes show same-day. Not a lag bug.
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"mcpServers": {
|
|
44
|
+
"nyfed-markets": {
|
|
45
|
+
"url": "https://gateway.pipeworx.io/nyfed-markets/mcp"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### What this endpoint actually serves
|
|
52
|
+
|
|
53
|
+
`tools/list` at `https://gateway.pipeworx.io/nyfed-markets/mcp` returns the tools in the table
|
|
54
|
+
above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
|
|
55
|
+
`discover_tools`, `search_within`, `remember`/`recall` and the rest of the
|
|
56
|
+
gateway-wide set. So the tool count you see is larger than this table: a
|
|
57
|
+
single-pack endpoint currently lists roughly 30 shared tools alongside the
|
|
58
|
+
pack's own. The connection's `initialize` response states its exact scope, and
|
|
59
|
+
is the authoritative answer for a given day.
|
|
60
|
+
|
|
61
|
+
This is deliberate, not multiplexing by accident. The meta-tools are what let a
|
|
62
|
+
scoped connection answer a question this pack does not cover — via
|
|
63
|
+
`ask_pipeworx`, which routes across the whole catalog — without you adding a
|
|
64
|
+
second MCP server. There is currently no way to mount a pack endpoint without
|
|
65
|
+
them; if the extra schemas cost you more context than the routing is worth,
|
|
66
|
+
connect to the full gateway once rather than to several pack endpoints.
|
|
67
|
+
|
|
68
|
+
Or connect to the full Pipeworx gateway to get every pack's tools listed
|
|
69
|
+
directly, instead of just this one's:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"mcpServers": {
|
|
74
|
+
"pipeworx": {
|
|
75
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Both URLs reach the same gateway and the same 1679+ data sources. The
|
|
82
|
+
only difference is which pack's tools are listed **directly**; `ask_pipeworx`
|
|
83
|
+
reaches all of them from either one.
|
|
84
|
+
|
|
85
|
+
## No MCP client? Call it over HTTP
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
curl -X POST https://gateway.pipeworx.io/v1/tools/nyfed_repo_operations \
|
|
89
|
+
-H 'Content-Type: application/json' \
|
|
90
|
+
-d '{"operation_type":"reverserepo"}'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/nyfed_repo_operations`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
|
|
94
|
+
|
|
95
|
+
## Standalone (no gateway account)
|
|
96
|
+
|
|
97
|
+
This package also runs as a local stdio MCP server — no Pipeworx account, no
|
|
98
|
+
gateway round-trip:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"mcpServers": {
|
|
103
|
+
"nyfed-markets": {
|
|
104
|
+
"command": "npx",
|
|
105
|
+
"args": ["-y", "@pipeworx/mcp-nyfed-markets"]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Or run it directly to confirm it starts:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npx -y @pipeworx/mcp-nyfed-markets
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
|
|
118
|
+
for **only** this pack's tools — none of the shared meta-tools the gateway
|
|
119
|
+
connection above adds. Same source, same tools, no ask_pipeworx routing.
|
|
120
|
+
|
|
121
|
+
## Using with ask_pipeworx
|
|
122
|
+
|
|
123
|
+
Instead of calling tools directly, you can ask questions in plain English —
|
|
124
|
+
this works on the pack endpoint above as well as on the full gateway:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
ask_pipeworx({ question: "your question about Nyfed Markets data" })
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
131
|
+
|
|
132
|
+
## More
|
|
133
|
+
|
|
134
|
+
- [Docs and guides](https://pipeworx.io/docs)
|
|
135
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
//
|
|
3
|
+
// Entry point for `npx @pipeworx/mcp-<slug>`.
|
|
4
|
+
//
|
|
5
|
+
// Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
|
|
6
|
+
// tsx sidesteps every extensionless-import / bare-JSON-import edge case a
|
|
7
|
+
// per-pack tsc build would have to solve one pack at a time). This file
|
|
8
|
+
// registers tsx's ESM loader programmatically, then hands off to src/server.ts,
|
|
9
|
+
// which wraps the pack's {tools, callTool} export in a stdio MCP server.
|
|
10
|
+
//
|
|
11
|
+
// Copied verbatim into every published pack repo by scripts/publish-pack.sh —
|
|
12
|
+
// edit this file, not a per-pack copy.
|
|
13
|
+
import { register } from 'tsx/esm/api';
|
|
14
|
+
|
|
15
|
+
register();
|
|
16
|
+
|
|
17
|
+
await import('../src/server.ts');
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-nyfed-markets",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "New York Fed Markets Data APIs — markets.newyorkfed.org, keyless JSON, no",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"mcp-nyfed-markets": "bin/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "nyfed-markets"],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/pipeworx-io/mcp-nyfed-markets.git"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"typecheck": "tsc --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
22
|
+
"tsx": "^4.19.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"@cloudflare/workers-types": "^4.20260405.1"
|
|
27
|
+
},
|
|
28
|
+
"pipeworx": {
|
|
29
|
+
"sourceHash": "v1-6658488c50937aa75ce65d954b9bf05cc8677cbfbc01f5754f6e0b27680ca220",
|
|
30
|
+
"sourceCommit": "b0fb3c31386cf0256dcf1e2f1b3440435a87ec35"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/nyfed-markets",
|
|
4
|
+
"title": "Nyfed Markets",
|
|
5
|
+
"description": "New York Fed Markets Data APIs — markets.newyorkfed.org, keyless JSON, no",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/nyfed-markets",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-nyfed-markets",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/nyfed-markets/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|