fdic-mcp-server 1.0.8 → 1.1.1

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 (4) hide show
  1. package/README.md +154 -185
  2. package/dist/index.js +732 -54
  3. package/dist/server.js +736 -56
  4. package/package.json +5 -2
package/README.md CHANGED
@@ -1,185 +1,163 @@
1
1
  # FDIC BankFind MCP Server
2
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.
3
+ `fdic-mcp-server` is an MCP (Model Context Protocol) server for the [FDIC BankFind Suite API](https://api.fdic.gov/banks/docs/). It gives LLM hosts a clean way to search FDIC-insured institutions, retrieve public banking records, and run common multi-bank analysis workflows without custom FDIC API plumbing.
4
+
5
+ It is useful when you want an MCP-compatible client to answer questions about banks, failures, branches, quarterly financials, deposit data, or peer performance using a stable tool surface and machine-readable responses.
6
+
7
+ ## Table Of Contents
8
+
9
+ - [Project Status](#project-status)
10
+ - [Why This Project Exists](#why-this-project-exists)
11
+ - [Documentation](#documentation)
12
+ - [Installation](#installation)
13
+ - [Usage](#usage)
14
+ - [Available Tools](#available-tools)
15
+ - [Data Notes](#data-notes)
16
+ - [Support](#support)
17
+ - [Contributing](#contributing)
18
+ - [License](#license)
19
+
20
+ ## Project Status
21
+
22
+ Active development. The server is usable today and the tool surface is covered by tests, but the project is still evolving as client support and analysis workflows improve.
23
+
24
+ ## Why This Project Exists
25
+
26
+ The FDIC BankFind Suite API is public and useful, but it is not packaged for MCP clients out of the box. This project solves that by:
27
+
28
+ - exposing BankFind datasets as MCP tools
29
+ - preserving both human-readable and machine-readable responses
30
+ - adding server-side analysis helpers for multi-bank comparison workflows
31
+ - supporting both local stdio hosts and remote HTTP hosts
32
+
33
+ ## Documentation
34
+
35
+ - GitHub Pages docs entry point: <https://jflamb.github.io/fdic-mcp-server/>
36
+ - Hosted MCP endpoint: <https://bankfind.jflamb.com/mcp>
37
+ - Local docs home: [docs/index.md](./docs/index.md)
38
+ - Getting started: [docs/getting-started.md](./docs/getting-started.md)
39
+ - Prompting guide: [docs/prompting-guide.md](./docs/prompting-guide.md)
40
+ - Usage examples: [docs/usage-examples.md](./docs/usage-examples.md)
41
+ - Tool reference: [docs/tool-reference.md](./docs/tool-reference.md)
42
+ - Client setup: [docs/clients.md](./docs/clients.md)
43
+ - Troubleshooting and FAQ: [docs/troubleshooting.md](./docs/troubleshooting.md)
44
+ - Compatibility matrix: [docs/compatibility-matrix.md](./docs/compatibility-matrix.md)
45
+ - Technical specification: [docs/technical/specification.md](./docs/technical/specification.md)
46
+ - Architecture: [docs/technical/architecture.md](./docs/technical/architecture.md)
47
+ - Key decisions: [docs/technical/decisions.md](./docs/technical/decisions.md)
48
+ - Release notes: [docs/release-notes/index.md](./docs/release-notes/index.md)
49
+ - Security policy: [SECURITY.md](./SECURITY.md)
4
50
 
5
- ## Features
6
-
7
- - **No API key required** — The FDIC BankFind API is publicly available
8
- - **11 tools** covering BankFind datasets plus a built-in comparative analysis tool
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
- - **Built-in analytical batching** for multi-bank comparisons
14
- - **Short-lived response caching** for repeated analytical prompts
15
-
16
- ## Available Tools
17
-
18
- | Tool | Description |
19
- |------|-------------|
20
- | `fdic_search_institutions` | Search FDIC-insured banks and savings institutions |
21
- | `fdic_get_institution` | Get details for a specific institution by CERT number |
22
- | `fdic_search_failures` | Search failed bank records |
23
- | `fdic_get_institution_failure` | Get failure details for a specific institution |
24
- | `fdic_search_locations` | Search branch/office locations |
25
- | `fdic_search_history` | Search structural change events (mergers, name changes, etc.) |
26
- | `fdic_search_financials` | Search quarterly Call Report financial data |
27
- | `fdic_search_summary` | Search annual financial summary data |
28
- | `fdic_search_sod` | Search Summary of Deposits (branch-level deposit data) |
29
- | `fdic_search_demographics` | Search quarterly demographics and market-structure data |
30
- | `fdic_compare_bank_snapshots` | Compare two reporting snapshots across banks and rank growth/profitability changes |
31
-
32
- Two tools are convenience lookups rather than separate BankFind datasets:
33
- - `fdic_get_institution` wraps the `institutions` dataset
34
- - `fdic_get_institution_failure` wraps the `failures` dataset
51
+ ## Installation
35
52
 
36
- One tool is a server-side analysis helper:
37
- - `fdic_compare_bank_snapshots` batches roster lookup, financial snapshots, and optional demographics snapshots inside the MCP server so complex trend prompts do not require many separate tool calls
38
- - It supports both `snapshot` comparisons and `timeseries` analysis across a quarterly range
39
- - It computes derived efficiency and balance-sheet metrics and assigns insight tags for notable growth patterns
53
+ Prerequisites:
40
54
 
41
- ## Filter Syntax
55
+ - Node.js 18 or later
56
+ - npm
42
57
 
43
- All tools support ElasticSearch query string syntax for filtering:
58
+ Run directly without a global install:
44
59
 
60
+ ```bash
61
+ npx fdic-mcp-server
45
62
  ```
46
- # Exact match
47
- NAME:"Chase Bank"
48
-
49
- # State filter
50
- STNAME:"California"
51
-
52
- # Numeric range (assets in $thousands)
53
- ASSET:[1000000 TO *]
54
-
55
- # Date range
56
- FAILDATE:[2008-01-01 TO 2010-12-31]
57
63
 
58
- # Combine with AND / OR
59
- STNAME:"Texas" AND ACTIVE:1 AND ASSET:[500000 TO *]
64
+ Install globally:
60
65
 
61
- # Exclude
62
- !(BKCLASS:NM OR BKCLASS:N)
66
+ ```bash
67
+ npm install -g fdic-mcp-server
68
+ fdic-mcp-server
63
69
  ```
64
70
 
65
- Field names vary by dataset. For example:
66
- - `institutions` commonly uses fields like `STNAME`, `ASSET`, `ACTIVE`
67
- - `failures` commonly uses fields like `FAILDATE`, `COST`, `RESTYPE`
68
- - `locations` commonly uses fields like `STALP`, `CITY`, `BRNUM`
69
- - `sod` commonly uses fields like `STALPBR`, `CITYBR`, `DEPSUMBR`
70
-
71
- Use the tool description or `fields` parameter to tailor queries to the dataset you are calling.
72
-
73
- ## Installation
71
+ Install from GitHub Packages:
74
72
 
75
73
  ```bash
76
- npm install
77
- npm run build
74
+ npm install -g @jflamb/fdic-mcp-server --registry=https://npm.pkg.github.com
75
+ fdic-mcp-server
78
76
  ```
79
77
 
80
- ## Development
78
+ Install from source:
81
79
 
82
80
  ```bash
83
- npm run typecheck
84
- npm test
81
+ git clone https://github.com/jflamb/fdic-mcp-server.git
82
+ cd fdic-mcp-server
83
+ npm install
85
84
  npm run build
86
85
  ```
87
86
 
88
- ## CI And Releases
87
+ ## Usage
89
88
 
90
- - Pull requests should target `main`
91
- - Continuous integration runs on pushes to `main` and on pull requests targeting `main`
92
- - Package publish is reserved for semantic version tags like `v1.2.3`
93
- - Release tags must point at a commit already on `main`
89
+ ### Hosted Endpoint
94
90
 
95
- To prepare a release:
91
+ If your MCP host supports remote MCP URLs, use:
96
92
 
97
- ```bash
98
- npm version patch
99
- git push origin main --follow-tags
93
+ ```text
94
+ https://bankfind.jflamb.com/mcp
100
95
  ```
101
96
 
102
- Publishing from GitHub Actions is intended to use npm trusted publishing via GitHub Actions OIDC rather than a long-lived `NPM_TOKEN`.
103
-
104
- ## Usage
97
+ ### Run Locally
105
98
 
106
- ### CLI bundle
99
+ Stdio transport:
107
100
 
108
- The build produces two outputs:
109
- - `dist/index.js`: CLI entrypoint for stdio/HTTP server execution
110
- - `dist/server.js`: import-safe library bundle exporting `createServer`, `createApp`, and `main`
101
+ ```bash
102
+ node dist/index.js
103
+ ```
111
104
 
112
- ### stdio (for Claude Desktop / local MCP clients)
105
+ HTTP transport:
113
106
 
114
107
  ```bash
115
- node dist/index.js
108
+ TRANSPORT=http PORT=3000 node dist/index.js
116
109
  ```
117
110
 
118
- **Claude Desktop config** (`~/Library/Application\ Support/Claude/claude_desktop_config.json`):
111
+ The HTTP MCP endpoint is `http://localhost:3000/mcp`.
112
+
113
+ ### Minimal MCP Configuration
119
114
 
120
115
  ```json
121
116
  {
122
117
  "mcpServers": {
123
118
  "fdic": {
124
- "command": "node",
125
- "args": ["/path/to/fdic-mcp-server/dist/index.js"]
119
+ "command": "npx",
120
+ "args": ["-y", "fdic-mcp-server"]
126
121
  }
127
122
  }
128
123
  }
129
124
  ```
130
125
 
131
- ### HTTP server
126
+ If you are running from a local clone instead of the published package:
132
127
 
133
- ```bash
134
- TRANSPORT=http PORT=3000 node dist/index.js
128
+ ```json
129
+ {
130
+ "mcpServers": {
131
+ "fdic": {
132
+ "command": "node",
133
+ "args": ["/path/to/fdic-mcp-server/dist/index.js"]
134
+ }
135
+ }
136
+ }
135
137
  ```
136
138
 
137
- The MCP endpoint will be available at `http://localhost:3000/mcp`.
138
-
139
- For direct HTTP MCP clients, include:
140
- - `Content-Type: application/json`
141
- - `Accept: application/json, text/event-stream`
139
+ Client-specific setup details are in [docs/clients.md](./docs/clients.md).
142
140
 
143
- The streamable HTTP transport expects both response types to be accepted.
141
+ ### Usage Examples
144
142
 
145
- ## Example Queries
143
+ Find active banks in North Carolina with assets over $1 billion:
146
144
 
147
- **Find all active banks in North Carolina with assets over $1 billion:**
148
- ```
145
+ ```text
149
146
  filters: STNAME:"North Carolina" AND ACTIVE:1 AND ASSET:[1000000 TO *]
150
147
  ```
151
148
 
152
- **Get the 10 costliest bank failures since 2000:**
153
- ```
149
+ Get the 10 costliest bank failures since January 1, 2000:
150
+
151
+ ```text
154
152
  filters: FAILDATE:[2000-01-01 TO *]
155
153
  sort_by: COST
156
154
  sort_order: DESC
157
155
  limit: 10
158
156
  ```
159
157
 
160
- **Get all branches of a specific bank:**
161
- ```
162
- cert: 3511
163
- (fdic_search_locations)
164
- ```
158
+ Compare North Carolina banks between two quarterly report dates:
165
159
 
166
- **Get quarterly financials for Bank of America for 2023:**
167
- ```
168
- cert: 3511
169
- filters: REPDTE:[20230101 TO 20231231]
170
- (fdic_search_financials)
171
- ```
172
-
173
- **Get demographics history for a bank:**
174
- ```
175
- cert: 3511
176
- sort_by: REPDTE
177
- sort_order: DESC
178
- (fdic_search_demographics)
179
- ```
180
-
181
- **Rank banks by growth across two dates without orchestrating many separate queries:**
182
- ```
160
+ ```text
183
161
  state: North Carolina
184
162
  start_repdte: 20211231
185
163
  end_repdte: 20250630
@@ -188,80 +166,71 @@ sort_order: DESC
188
166
  (fdic_compare_bank_snapshots)
189
167
  ```
190
168
 
191
- **Analyze quarterly trends with streaks and derived metrics:**
192
- ```
193
- state: North Carolina
194
- start_repdte: 20211231
195
- end_repdte: 20250630
196
- analysis_mode: timeseries
197
- sort_by: asset_growth_pct
198
- sort_order: DESC
199
- (fdic_compare_bank_snapshots)
169
+ Build a peer group for a specific bank:
170
+
171
+ ```text
172
+ cert: 29846
173
+ repdte: 20241231
174
+ (fdic_peer_group_analysis)
200
175
  ```
201
176
 
202
- ## Complex Prompts
177
+ More examples are in [docs/usage-examples.md](./docs/usage-examples.md).
178
+
179
+ ## Available Tools
180
+
181
+ | Tool | Description |
182
+ |------|-------------|
183
+ | `fdic_search_institutions` | Search FDIC-insured banks and savings institutions |
184
+ | `fdic_get_institution` | Get details for a specific institution by CERT number |
185
+ | `fdic_search_failures` | Search failed bank records |
186
+ | `fdic_get_institution_failure` | Get failure details for a specific institution |
187
+ | `fdic_search_locations` | Search branch and office locations |
188
+ | `fdic_search_history` | Search structural change events such as mergers and name changes |
189
+ | `fdic_search_financials` | Search quarterly Call Report financial data |
190
+ | `fdic_search_summary` | Search annual financial summary data |
191
+ | `fdic_search_sod` | Search Summary of Deposits branch-level deposit data |
192
+ | `fdic_search_demographics` | Search quarterly demographics and market-structure data |
193
+ | `fdic_compare_bank_snapshots` | Compare two reporting snapshots across banks and rank growth and profitability changes |
194
+ | `fdic_peer_group_analysis` | Build a peer group and rank an institution against peers on financial metrics |
203
195
 
204
- The built-in `fdic_compare_bank_snapshots` tool is meant to make analysis-heavy prompts performant by batching FDIC calls inside the MCP server. The server also caches repeated state/date lookups for a short period, which helps iterative analysis. Good examples:
196
+ Two tools are server-side analysis helpers:
205
197
 
206
- - Identify North Carolina banks with the strongest asset growth from 2021 to 2025, then compare whether that growth came with higher deposits, more branches, or better profitability
207
- - Rank a set of banks by deposit growth percentage between two report dates and check which ones also improved ROA or ROE
208
- - Compare current active banks in a state between two snapshots to see which institutions grew while reducing office counts
209
- - Analyze whether rapid asset growth was accompanied by stronger profitability or just balance-sheet expansion
210
- - Analyze quarterly trends from 2021 through 2025 and call out inflection points, sustained asset-growth streaks, or multi-quarter ROA declines
211
- - Identify banks whose deposits-per-office and assets-per-office improved even while total branch counts fell
212
- - Separate banks with branch-supported growth from banks that mainly expanded their balance sheets
198
+ - `fdic_compare_bank_snapshots` batches roster lookup, financial snapshots, and optional demographics snapshots inside the MCP server
199
+ - `fdic_peer_group_analysis` builds a peer group from asset size, charter class, and geography criteria and then ranks an institution against peers
213
200
 
214
- The tool can take either:
215
- - `state` plus optional `institution_filters` to build a roster
216
- - `certs` to compare a specific list of institutions directly
201
+ ## Data Notes
217
202
 
218
- Notable outputs from `fdic_compare_bank_snapshots`:
219
- - point-to-point changes for assets, deposits, net income, ROA, ROE, and office counts
220
- - derived metrics such as `assets_per_office_change`, `deposits_per_office_change`, and `deposits_to_assets_change`
221
- - insight tags such as `growth_with_better_profitability`, `growth_with_branch_expansion`, `balance_sheet_growth_without_profitability`, and `growth_with_branch_consolidation`
222
- - in `timeseries` mode, quarterly series plus streak metrics like sustained asset growth and multi-quarter ROA decline
203
+ - Monetary values are generally reported in thousands of dollars.
204
+ - `CERT` is the stable FDIC institution identifier.
205
+ - Financial and demographics datasets are quarterly and use `REPDTE` in `YYYYMMDD`.
206
+ - Summary data is annual and uses `YEAR`.
207
+ - SOD data is annual branch-level data as of June 30.
208
+ - Do not mix quarterly financial data and annual branch data without stating the date basis.
223
209
 
224
- ## Response Shape
210
+ ## Support
225
211
 
226
- All tools return:
227
- - a human-readable text representation in `content[0].text`
228
- - machine-readable data in `structuredContent`
212
+ Use the GitHub issue tracker for bugs, documentation problems, and feature requests: <https://github.com/jflamb/fdic-mcp-server/issues>
229
213
 
230
- Typical search response shape:
214
+ The main support docs are:
231
215
 
232
- ```json
233
- {
234
- "total": 1,
235
- "offset": 0,
236
- "count": 1,
237
- "has_more": false,
238
- "institutions": [
239
- {
240
- "CERT": 3511,
241
- "NAME": "Wells Fargo Bank, National Association"
242
- }
243
- ]
244
- }
245
- ```
216
+ - [docs/support.md](./docs/support.md)
217
+ - [docs/prompting-guide.md](./docs/prompting-guide.md)
218
+ - [docs/usage-examples.md](./docs/usage-examples.md)
219
+ - [docs/troubleshooting.md](./docs/troubleshooting.md)
220
+ - [SECURITY.md](./SECURITY.md)
246
221
 
247
- Typical lookup miss response shape:
222
+ ## Contributing
248
223
 
249
- ```json
250
- {
251
- "found": false,
252
- "cert": 999999999,
253
- "message": "No institution found with CERT number 999999999."
254
- }
224
+ Contributor guidance lives in [CONTRIBUTING.md](./CONTRIBUTING.md).
225
+
226
+ For local validation, run:
227
+
228
+ ```bash
229
+ npm run typecheck
230
+ npm test
231
+ npm run build
255
232
  ```
256
233
 
257
- ## Data Notes
234
+ ## License
258
235
 
259
- - Monetary values are in **$thousands** unless otherwise noted
260
- - The `CERT` field is the unique FDIC Certificate Number for each institution
261
- - The `ACTIVE` field: `1` = currently active, `0` = inactive/closed
262
- - Report dates (`REPDTE`) are in `YYYYMMDD` format
263
- - The financials endpoint covers **1,100+ Call Report variables** — use `fields` to narrow results
264
- - `fdic_search_financials` defaults to `sort_order: DESC` for most-recent-first results
265
- - Most other search tools default to `sort_order: ASC`
266
- - The demographics endpoint is useful for office counts, metro/micro flags, territory assignments, and related geographic reference attributes
267
- - The demographics dataset is quarterly historical data, not just a current snapshot
236
+ This project is licensed under the MIT License.