fdic-mcp-server 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jlamb
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,234 @@
1
+ # FDIC BankFind MCP Server
2
+
3
+ An MCP (Model Context Protocol) server that provides access to the [FDIC BankFind Suite API](https://api.fdic.gov/banks/docs/), giving LLMs programmatic access to public data on FDIC-insured financial institutions.
4
+
5
+ ## Features
6
+
7
+ - **No API key required** — The FDIC BankFind API is publicly available
8
+ - **10 tools** covering all BankFind dataset endpoints
9
+ - **Flexible ElasticSearch-style filtering** on all endpoints
10
+ - **Pagination support** for large result sets
11
+ - **Dual transport**: stdio (local) or HTTP (remote)
12
+ - **Structured tool output** via `structuredContent` for MCP clients
13
+
14
+ ## Available Tools
15
+
16
+ | Tool | Description |
17
+ |------|-------------|
18
+ | `fdic_search_institutions` | Search FDIC-insured banks and savings institutions |
19
+ | `fdic_get_institution` | Get details for a specific institution by CERT number |
20
+ | `fdic_search_failures` | Search failed bank records |
21
+ | `fdic_get_institution_failure` | Get failure details for a specific institution |
22
+ | `fdic_search_locations` | Search branch/office locations |
23
+ | `fdic_search_history` | Search structural change events (mergers, name changes, etc.) |
24
+ | `fdic_search_financials` | Search quarterly Call Report financial data |
25
+ | `fdic_search_summary` | Search annual financial summary data |
26
+ | `fdic_search_sod` | Search Summary of Deposits (branch-level deposit data) |
27
+ | `fdic_search_demographics` | Search quarterly demographics and market-structure data |
28
+
29
+ Two tools are convenience lookups rather than separate BankFind datasets:
30
+ - `fdic_get_institution` wraps the `institutions` dataset
31
+ - `fdic_get_institution_failure` wraps the `failures` dataset
32
+
33
+ ## Filter Syntax
34
+
35
+ All tools support ElasticSearch query string syntax for filtering:
36
+
37
+ ```
38
+ # Exact match
39
+ NAME:"Chase Bank"
40
+
41
+ # State filter
42
+ STNAME:"California"
43
+
44
+ # Numeric range (assets in $thousands)
45
+ ASSET:[1000000 TO *]
46
+
47
+ # Date range
48
+ FAILDATE:[2008-01-01 TO 2010-12-31]
49
+
50
+ # Combine with AND / OR
51
+ STNAME:"Texas" AND ACTIVE:1 AND ASSET:[500000 TO *]
52
+
53
+ # Exclude
54
+ !(BKCLASS:NM OR BKCLASS:N)
55
+ ```
56
+
57
+ Field names vary by dataset. For example:
58
+ - `institutions` commonly uses fields like `STNAME`, `ASSET`, `ACTIVE`
59
+ - `failures` commonly uses fields like `FAILDATE`, `COST`, `RESTYPE`
60
+ - `locations` commonly uses fields like `STALP`, `CITY`, `BRNUM`
61
+ - `sod` commonly uses fields like `STALPBR`, `CITYBR`, `DEPSUMBR`
62
+
63
+ Use the tool description or `fields` parameter to tailor queries to the dataset you are calling.
64
+
65
+ ## Installation
66
+
67
+ ```bash
68
+ npm install
69
+ npm run build
70
+ ```
71
+
72
+ ## Development
73
+
74
+ ```bash
75
+ npm run typecheck
76
+ npm test
77
+ npm run build
78
+ ```
79
+
80
+ ## CI And Releases
81
+
82
+ - Pull requests should target `main`
83
+ - Continuous integration runs on pushes to `main` and on pull requests targeting `main`
84
+ - Package publish is reserved for semantic version tags like `v1.2.3`
85
+ - Release tags must point at a commit already on `main`
86
+
87
+ To prepare a release:
88
+
89
+ ```bash
90
+ npm version patch
91
+ git push origin main --follow-tags
92
+ ```
93
+
94
+ Publishing from GitHub Actions is intended to use npm trusted publishing via GitHub Actions OIDC rather than a long-lived `NPM_TOKEN`.
95
+
96
+ ### Local Secrets With direnv
97
+
98
+ To keep tokens local to this repo without committing them:
99
+
100
+ ```bash
101
+ cp .envrc.example .envrc
102
+ $EDITOR .envrc
103
+ direnv allow
104
+ ```
105
+
106
+ Example `.envrc` entry:
107
+
108
+ ```bash
109
+ export GITHUB_TOKEN="your_pat_here"
110
+ ```
111
+
112
+ The repo ignores `.envrc`, `.envrc.local`, and `.env` so local secrets stay untracked.
113
+
114
+ ## Usage
115
+
116
+ ### CLI bundle
117
+
118
+ The build produces two outputs:
119
+ - `dist/index.js`: CLI entrypoint for stdio/HTTP server execution
120
+ - `dist/server.js`: import-safe library bundle exporting `createServer`, `createApp`, and `main`
121
+
122
+ ### stdio (for Claude Desktop / local MCP clients)
123
+
124
+ ```bash
125
+ node dist/index.js
126
+ ```
127
+
128
+ **Claude Desktop config** (`~/Library/Application\ Support/Claude/claude_desktop_config.json`):
129
+
130
+ ```json
131
+ {
132
+ "mcpServers": {
133
+ "fdic": {
134
+ "command": "node",
135
+ "args": ["/path/to/fdic-mcp-server/dist/index.js"]
136
+ }
137
+ }
138
+ }
139
+ ```
140
+
141
+ ### HTTP server
142
+
143
+ ```bash
144
+ TRANSPORT=http PORT=3000 node dist/index.js
145
+ ```
146
+
147
+ The MCP endpoint will be available at `http://localhost:3000/mcp`.
148
+
149
+ For direct HTTP MCP clients, include:
150
+ - `Content-Type: application/json`
151
+ - `Accept: application/json, text/event-stream`
152
+
153
+ The streamable HTTP transport expects both response types to be accepted.
154
+
155
+ ## Example Queries
156
+
157
+ **Find all active banks in North Carolina with assets over $1 billion:**
158
+ ```
159
+ filters: STNAME:"North Carolina" AND ACTIVE:1 AND ASSET:[1000000 TO *]
160
+ ```
161
+
162
+ **Get the 10 costliest bank failures since 2000:**
163
+ ```
164
+ filters: FAILDATE:[2000-01-01 TO *]
165
+ sort_by: COST
166
+ sort_order: DESC
167
+ limit: 10
168
+ ```
169
+
170
+ **Get all branches of a specific bank:**
171
+ ```
172
+ cert: 3511
173
+ (fdic_search_locations)
174
+ ```
175
+
176
+ **Get quarterly financials for Bank of America for 2023:**
177
+ ```
178
+ cert: 3511
179
+ filters: REPDTE:[20230101 TO 20231231]
180
+ (fdic_search_financials)
181
+ ```
182
+
183
+ **Get demographics history for a bank:**
184
+ ```
185
+ cert: 3511
186
+ sort_by: REPDTE
187
+ sort_order: DESC
188
+ (fdic_search_demographics)
189
+ ```
190
+
191
+ ## Response Shape
192
+
193
+ All tools return:
194
+ - human-readable JSON in `content[0].text`
195
+ - machine-readable data in `structuredContent`
196
+
197
+ Typical search response shape:
198
+
199
+ ```json
200
+ {
201
+ "total": 1,
202
+ "offset": 0,
203
+ "count": 1,
204
+ "has_more": false,
205
+ "institutions": [
206
+ {
207
+ "CERT": 3511,
208
+ "NAME": "Wells Fargo Bank, National Association"
209
+ }
210
+ ]
211
+ }
212
+ ```
213
+
214
+ Typical lookup miss response shape:
215
+
216
+ ```json
217
+ {
218
+ "found": false,
219
+ "cert": 999999999,
220
+ "message": "No institution found with CERT number 999999999."
221
+ }
222
+ ```
223
+
224
+ ## Data Notes
225
+
226
+ - Monetary values are in **$thousands** unless otherwise noted
227
+ - The `CERT` field is the unique FDIC Certificate Number for each institution
228
+ - The `ACTIVE` field: `1` = currently active, `0` = inactive/closed
229
+ - Report dates (`REPDTE`) are in `YYYYMMDD` format
230
+ - The financials endpoint covers **1,100+ Call Report variables** — use `fields` to narrow results
231
+ - `fdic_search_financials` defaults to `sort_order: DESC` for most-recent-first results
232
+ - Most other search tools default to `sort_order: ASC`
233
+ - The demographics endpoint is useful for office counts, metro/micro flags, territory assignments, and related geographic reference attributes
234
+ - The demographics dataset is quarterly historical data, not just a current snapshot