@ktmcp-cli/nordigen 1.0.0 → 1.0.2

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/README.md CHANGED
@@ -1,424 +1,236 @@
1
- # Nordigen CLI
1
+ > "Six months ago, everyone was talking about MCPs. And I was like, screw MCPs. Every MCP would be better as a CLI."
2
+ >
3
+ > — [Peter Steinberger](https://twitter.com/steipete), Founder of OpenClaw
4
+ > [Watch on YouTube (~2:39:00)](https://www.youtube.com/@lexfridman) | [Lex Fridman Podcast #491](https://lexfridman.com/peter-steinberger/)
2
5
 
3
- <p align="center">
4
- <img src="banner.png" alt="KTMCP Banner" width="100%">
5
- </p>
6
+ # Nordigen CLI
6
7
 
8
+ A production-ready command-line interface for the [Nordigen](https://nordigen.com) Account Information Services API. Access bank account data, transactions, balances, and manage open banking connections directly from your terminal.
7
9
 
8
- Production-ready command-line interface for the Nordigen Account Information Services API (Open Banking).
10
+ > **Disclaimer**: This is an unofficial CLI tool and is not affiliated with, endorsed by, or supported by Nordigen or GoCardless.
9
11
 
10
12
  ## Features
11
13
 
12
- - Complete coverage of Nordigen API v2
13
- - JWT authentication with automatic token refresh
14
- - Secure credential storage
15
- - Rich terminal output with colors and formatting
16
- - JSON output for scripting and automation
17
- - Comprehensive error handling
18
- - Support for all major operations:
19
- - Account information (balances, details, transactions)
20
- - Institution browsing and search
21
- - End User Agreements (EUA) management
22
- - Requisition creation and management
23
- - Payment operations
14
+ - **Institutions** Browse and search banks across 31 European countries
15
+ - **Agreements** Create and manage end user agreements for account access
16
+ - **Requisitions** Initiate bank connections and retrieve authorization links
17
+ - **Accounts** Access account metadata, balances, details, and transactions
18
+ - **JWT Authentication** Secure authentication with automatic token refresh
19
+ - **JSON output** — All commands support `--json` for scripting and piping
20
+ - **Colorized output** Clean, readable terminal output with chalk
24
21
 
25
- ## Installation
22
+ ## Why CLI > MCP
26
23
 
27
- ### From Source
24
+ MCP servers are complex, stateful, and require a running server process. A CLI is:
28
25
 
29
- ```bash
30
- cd /workspace/group/ktmcp/workspace/nordigen
31
- npm install
32
- chmod +x bin/nordigen.js
33
- npm link # or add to PATH
34
- ```
26
+ - **Simpler** — Just a binary you call directly
27
+ - **Composable** — Pipe output to `jq`, `grep`, `awk`, and other tools
28
+ - **Scriptable** — Use in shell scripts, CI/CD pipelines, cron jobs
29
+ - **Debuggable** — See exactly what's happening with `--json` flag
30
+ - **AI-friendly** AI agents can call CLIs just as easily as MCPs, with less overhead
35
31
 
36
- ### From NPM (when published)
32
+ ## Installation
37
33
 
38
34
  ```bash
39
- npm install -g @ktmcp-cli/nordigen
35
+ npm install -g @ktmcp-cli/nordigencom
40
36
  ```
41
37
 
42
- ## Quick Start
38
+ ## Authentication Setup
43
39
 
44
- ### 1. Authentication
40
+ Nordigen uses JWT authentication. You'll need to create a Nordigen account and obtain API credentials.
45
41
 
46
- First, obtain your API credentials from the Nordigen dashboard at https://nordigen.com
42
+ ### 1. Create a Nordigen Account
47
43
 
48
- ```bash
49
- # Login with your credentials
50
- nordigen auth login --secret-id YOUR_SECRET_ID --secret-key YOUR_SECRET_KEY
51
-
52
- # Check authentication status
53
- nordigen auth status
54
- ```
44
+ 1. Go to [nordigen.com](https://nordigen.com) or [ob.nordigen.com/account/login/](https://ob.nordigen.com/account/login/)
45
+ 2. Sign up for a free or paid account
46
+ 3. Navigate to **User Secrets** in the dashboard
47
+ 4. Copy your **Secret ID** and **Secret Key**
55
48
 
56
- ### 2. Browse Institutions
49
+ ### 2. Configure the CLI
57
50
 
58
51
  ```bash
59
- # List banks in Great Britain
60
- nordigen institutions list --country GB
61
-
62
- # Search for a specific bank
63
- nordigen institutions search "Barclays" --country GB
64
-
65
- # Get details for a specific institution
66
- nordigen institutions get BARCLAYS_BARCGB22
52
+ nordigencom config set --secret-id YOUR_SECRET_ID --secret-key YOUR_SECRET_KEY
67
53
  ```
68
54
 
69
- ### 3. Create End User Agreement
55
+ ### 3. Login
70
56
 
71
57
  ```bash
72
- # Create an agreement for accessing account data
73
- nordigen agreements create \
74
- --institution-id BARCLAYS_BARCGB22 \
75
- --max-days 90 \
76
- --valid-days 90
58
+ nordigencom auth login
77
59
  ```
78
60
 
79
- ### 4. Create Requisition
61
+ This will obtain a JWT access token that's valid for 24 hours and automatically refresh it when needed.
80
62
 
81
- ```bash
82
- # Create a requisition to connect a bank account
83
- nordigen requisitions create \
84
- --institution-id BARCLAYS_BARCGB22 \
85
- --redirect https://yourapp.com/callback \
86
- --agreement <AGREEMENT_ID>
63
+ ### 4. Verify
87
64
 
88
- # The command will return an authentication link
89
- # Send this link to the end user to authorize access
65
+ ```bash
66
+ nordigencom auth status
90
67
  ```
91
68
 
92
- ### 5. Access Account Data
93
-
94
- ```bash
95
- # Get account metadata
96
- nordigen accounts get <ACCOUNT_ID>
69
+ ## Commands
97
70
 
98
- # Get account balances
99
- nordigen accounts balances <ACCOUNT_ID>
71
+ ### Configuration
100
72
 
101
- # Get account transactions
102
- nordigen accounts transactions <ACCOUNT_ID>
73
+ ```bash
74
+ # Set credentials
75
+ nordigencom config set --secret-id <id> --secret-key <key>
103
76
 
104
- # Get transactions for a date range
105
- nordigen accounts transactions <ACCOUNT_ID> \
106
- --from 2024-01-01 \
107
- --to 2024-12-31
77
+ # Show current config
78
+ nordigencom config show
108
79
  ```
109
80
 
110
- ## Command Reference
111
-
112
81
  ### Authentication
113
82
 
114
83
  ```bash
115
- # Login
116
- nordigen auth login --secret-id <id> --secret-key <key>
117
-
118
- # Check status
119
- nordigen auth status
84
+ # Login and obtain JWT token
85
+ nordigencom auth login
120
86
 
121
- # Logout
122
- nordigen auth logout
87
+ # Check auth status
88
+ nordigencom auth status
123
89
  ```
124
90
 
125
91
  ### Institutions
126
92
 
127
93
  ```bash
128
- # List institutions
129
- nordigen institutions list --country <CODE>
130
- nordigen institutions list --country GB --payments
94
+ # List all institutions
95
+ nordigencom institutions list
131
96
 
132
- # Search institutions
133
- nordigen institutions search <query> --country <CODE>
97
+ # Filter by country
98
+ nordigencom institutions list --country GB
99
+ nordigencom institutions list --country DE
134
100
 
135
101
  # Get institution details
136
- nordigen institutions get <INSTITUTION_ID>
102
+ nordigencom institutions get <institution-id>
137
103
  ```
138
104
 
139
- ### End User Agreements
105
+ ### Agreements
106
+
107
+ End user agreements define what data you can access and for how long.
140
108
 
141
109
  ```bash
142
- # List agreements
143
- nordigen agreements list
110
+ # List all agreements
111
+ nordigencom agreements list
144
112
 
145
- # Create agreement
146
- nordigen agreements create \
147
- --institution-id <ID> \
148
- --max-days 90 \
149
- --valid-days 90 \
150
- --scope balances details transactions
113
+ # Get specific agreement
114
+ nordigencom agreements get <agreement-id>
151
115
 
152
- # Get agreement
153
- nordigen agreements get <AGREEMENT_ID>
116
+ # Create new agreement
117
+ nordigencom agreements create \
118
+ --institution-id <institution-id> \
119
+ --max-historical-days 90 \
120
+ --access-valid-for-days 90
154
121
 
155
- # Delete agreement
156
- nordigen agreements delete <AGREEMENT_ID> --yes
122
+ # Create agreement with limited scope
123
+ nordigencom agreements create \
124
+ --institution-id <institution-id> \
125
+ --access-scope balances,transactions
157
126
 
158
- # Accept agreement (programmatically)
159
- nordigen agreements accept <AGREEMENT_ID> \
160
- --user-agent "Mozilla/5.0..." \
161
- --ip "192.168.1.1"
127
+ # Delete agreement
128
+ nordigencom agreements delete <agreement-id>
162
129
  ```
163
130
 
164
131
  ### Requisitions
165
132
 
133
+ Requisitions are bank connection requests that users authorize.
134
+
166
135
  ```bash
167
- # List requisitions
168
- nordigen requisitions list
136
+ # List all requisitions
137
+ nordigencom requisitions list
169
138
 
170
- # Create requisition
171
- nordigen requisitions create \
172
- --institution-id <ID> \
173
- --redirect <URL> \
174
- --reference "my-ref" \
175
- --agreement <AGREEMENT_ID>
139
+ # Get specific requisition
140
+ nordigencom requisitions get <requisition-id>
176
141
 
177
- # Get requisition
178
- nordigen requisitions get <REQUISITION_ID>
142
+ # Create new requisition
143
+ nordigencom requisitions create \
144
+ --institution-id <institution-id> \
145
+ --redirect https://yourapp.com/callback \
146
+ --reference user-123 \
147
+ --agreement-id <agreement-id>
179
148
 
180
149
  # Delete requisition
181
- nordigen requisitions delete <REQUISITION_ID> --yes
150
+ nordigencom requisitions delete <requisition-id>
182
151
  ```
183
152
 
184
153
  ### Accounts
185
154
 
155
+ Access account data after a requisition is authorized.
156
+
186
157
  ```bash
187
158
  # Get account metadata
188
- nordigen accounts get <ACCOUNT_ID>
159
+ nordigencom accounts get <account-id>
189
160
 
190
- # Get balances
191
- nordigen accounts balances <ACCOUNT_ID>
161
+ # Get account balances
162
+ nordigencom accounts balances <account-id>
192
163
 
193
164
  # Get account details
194
- nordigen accounts details <ACCOUNT_ID>
195
-
196
- # Get transactions
197
- nordigen accounts transactions <ACCOUNT_ID>
198
- nordigen accounts transactions <ACCOUNT_ID> --from 2024-01-01 --to 2024-12-31
199
-
200
- # Premium transactions (with country-specific data)
201
- nordigen accounts transactions <ACCOUNT_ID> --premium --country GB
202
- ```
203
-
204
- ### Payments
205
-
206
- ```bash
207
- # List payments
208
- nordigen payments list
209
-
210
- # Get payment details
211
- nordigen payments get <PAYMENT_ID>
212
-
213
- # Delete payment
214
- nordigen payments delete <PAYMENT_ID> --yes
215
-
216
- # List creditors
217
- nordigen payments creditors
218
-
219
- # Get required payment fields for institution
220
- nordigen payments fields <INSTITUTION_ID>
221
- ```
222
-
223
- ### Configuration
224
-
225
- ```bash
226
- # Show configuration
227
- nordigen config show
228
- nordigen config show --show-secrets # WARNING: displays sensitive data
229
-
230
- # Get specific value
231
- nordigen config get auth.secret_id
165
+ nordigencom accounts details <account-id>
232
166
 
233
- # Set value
234
- nordigen config set defaults.country GB
235
-
236
- # Set default country
237
- nordigen config set-country GB
238
-
239
- # Clear all configuration
240
- nordigen config clear --yes
167
+ # Get account transactions
168
+ nordigencom accounts transactions <account-id>
241
169
  ```
242
170
 
243
171
  ## JSON Output
244
172
 
245
- All commands support `--json` or `-j` flag for machine-readable output:
173
+ All commands support `--json` for machine-readable output:
246
174
 
247
175
  ```bash
248
- # Get account as JSON
249
- nordigen accounts get <ACCOUNT_ID> --json
250
-
251
- # Pipe to jq for processing
252
- nordigen institutions list --country GB --json | jq '.[].name'
253
- ```
254
-
255
- ## Environment Variables
256
-
257
- - `DEBUG=1` - Enable debug output with stack traces
258
- - `NORDIGEN_SECRET_ID` - Alternative to storing secret ID in config
259
- - `NORDIGEN_SECRET_KEY` - Alternative to storing secret key in config
260
-
261
- ## Configuration Storage
262
-
263
- Configuration is stored securely in:
264
-
265
- - **Linux/macOS**: `~/.config/nordigen-cli/config.json`
266
- - **Windows**: `%APPDATA%\nordigen-cli\config.json`
267
-
268
- The config file has permissions set to `0600` (read/write for owner only).
269
-
270
- ## Error Handling
176
+ # Get all institutions as JSON
177
+ nordigencom institutions list --json
271
178
 
272
- The CLI provides detailed error messages with exit codes:
179
+ # Pipe to jq for filtering
180
+ nordigencom institutions list --country GB --json | jq '.[] | {id, name, bic}'
273
181
 
274
- - `0` - Success
275
- - `1` - General error
276
- - `400` - Bad request / validation error
277
- - `401` - Authentication error
278
- - `403` - Permission denied
279
- - `404` - Resource not found
280
- - `429` - Rate limit exceeded
281
- - `500` - Server error
282
-
283
- Enable debug output for detailed stack traces:
284
-
285
- ```bash
286
- DEBUG=1 nordigen accounts get <ACCOUNT_ID>
182
+ # Get transactions as JSON
183
+ nordigencom accounts transactions <account-id> --json
287
184
  ```
288
185
 
289
- ## Common Workflows
186
+ ## Examples
290
187
 
291
- ### Complete Bank Connection Flow
188
+ ### Connect a bank account (full workflow)
292
189
 
293
190
  ```bash
294
- # 1. Find the institution
295
- nordigen institutions search "Your Bank" --country GB
191
+ # Step 1: Find the bank institution
192
+ nordigencom institutions list --country GB
193
+ # Note the institution_id
296
194
 
297
- # 2. Create end user agreement
298
- nordigen agreements create --institution-id <INST_ID> --max-days 90
195
+ # Step 2: Create an agreement
196
+ nordigencom agreements create \
197
+ --institution-id SANDBOXFINANCE_SFIN0000 \
198
+ --max-historical-days 90 \
199
+ --access-valid-for-days 90
200
+ # Note the agreement_id
299
201
 
300
- # 3. Create requisition
301
- nordigen requisitions create \
302
- --institution-id <INST_ID> \
303
- --redirect https://yourapp.com/callback \
304
- --agreement <AGREEMENT_ID>
305
-
306
- # 4. Send the returned link to your user for authentication
202
+ # Step 3: Create a requisition
203
+ nordigencom requisitions create \
204
+ --institution-id SANDBOXFINANCE_SFIN0000 \
205
+ --redirect https://myapp.com/callback \
206
+ --reference user-123 \
207
+ --agreement-id <agreement-id>
208
+ # Note the link URL and send it to the user
307
209
 
308
- # 5. After user authenticates, retrieve accounts
309
- nordigen requisitions get <REQUISITION_ID>
210
+ # Step 4: After user authorizes, get the requisition
211
+ nordigencom requisitions get <requisition-id>
212
+ # Note the account IDs in the response
310
213
 
311
- # 6. Access account data
312
- nordigen accounts balances <ACCOUNT_ID>
313
- nordigen accounts transactions <ACCOUNT_ID>
214
+ # Step 5: Access account data
215
+ nordigencom accounts balances <account-id>
216
+ nordigencom accounts transactions <account-id>
314
217
  ```
315
218
 
316
- ### Batch Processing Accounts
219
+ ### Monitor account transactions
317
220
 
318
221
  ```bash
319
- # Get all requisitions as JSON
320
- nordigen requisitions list --json > requisitions.json
321
-
322
- # Extract account IDs and fetch transactions
323
- cat requisitions.json | jq -r '.results[].accounts[]' | while read account; do
324
- echo "Fetching transactions for $account"
325
- nordigen accounts transactions $account --json > "transactions_${account}.json"
326
- done
222
+ # Get all transactions for an account
223
+ nordigencom accounts transactions <account-id> --json | jq '.transactions.booked[] | {date: .bookingDate, amount: .transactionAmount.amount, description: .remittanceInformationUnstructured}'
327
224
  ```
328
225
 
329
- ## Why CLI > MCP?
330
-
331
- ### Performance
332
- - **CLI**: Direct execution, no protocol overhead, instant responses
333
- - **MCP**: Additional network/IPC layer, serialization overhead, slower responses
334
-
335
- ### Simplicity
336
- - **CLI**: Simple command invocation, standard UNIX patterns, easy to compose
337
- - **MCP**: Requires server setup, protocol understanding, more moving parts
338
-
339
- ### Debugging
340
- - **CLI**: Standard stdout/stderr, easy to debug with DEBUG flag
341
- - **MCP**: Protocol messages, requires MCP-specific debugging tools
342
-
343
- ### Integration
344
- - **CLI**: Works with any language via subprocess, easy shell scripting
345
- - **MCP**: Requires MCP client library, limited language support
346
-
347
- ### Portability
348
- - **CLI**: Single binary/script, runs anywhere with Node.js
349
- - **MCP**: Requires MCP server runtime, more dependencies
350
-
351
- ### Use Cases
226
+ ## Contributing
352
227
 
353
- **Use CLI when:**
354
- - Building scripts and automation
355
- - One-off data retrieval tasks
356
- - Integrating with existing shell workflows
357
- - Debugging API responses
358
- - Human interaction needed
359
-
360
- **Use MCP when:**
361
- - Building persistent AI agent applications
362
- - Need stateful server connections
363
- - Multiple AI tools need shared context
364
- - Protocol-level features required
365
-
366
- ## Troubleshooting
367
-
368
- ### Token Expired
369
-
370
- ```bash
371
- # Check authentication status
372
- nordigen auth status
373
-
374
- # Re-login if needed
375
- nordigen auth login --secret-id <id> --secret-key <key>
376
- ```
377
-
378
- ### Rate Limiting
379
-
380
- If you hit rate limits, the API will return a 429 error. Wait and retry, or implement exponential backoff in your scripts.
381
-
382
- ### Account Access Errors
383
-
384
- Ensure:
385
- 1. Valid End User Agreement exists
386
- 2. Agreement has correct access scope
387
- 3. User has completed authentication flow
388
- 4. Access period hasn't expired
389
-
390
- ## API Documentation
391
-
392
- For complete API reference, see:
393
- - Official Nordigen Docs: https://nordigen.com/en/docs/
394
- - OpenAPI Spec: https://ob.nordigen.com/api/swagger/
395
-
396
- ## Development
397
-
398
- ```bash
399
- # Install dependencies
400
- npm install
401
-
402
- # Run tests
403
- npm test
404
-
405
- # Lint code
406
- npm run lint
407
-
408
- # Make executable
409
- chmod +x bin/nordigen.js
410
- ```
228
+ Issues and pull requests are welcome at [github.com/ktmcp-cli/nordigencom](https://github.com/ktmcp-cli/nordigencom).
411
229
 
412
230
  ## License
413
231
 
414
- MIT
415
-
416
- ## Support
417
-
418
- - GitHub Issues: https://github.com/ktmcp/nordigen-cli/issues
419
- - Email: support@ktmcp.com
232
+ MIT — see [LICENSE](LICENSE) for details.
420
233
 
421
- ## Related Documentation
234
+ ---
422
235
 
423
- - [AGENT.md](./AGENT.md) - AI agent integration patterns
424
- - [OPENCLAW.md](./OPENCLAW.md) - OpenClaw integration guide
236
+ Part of the [KTMCP CLI](https://killthemcp.com) project replacing MCPs with simple, composable CLIs.
package/bin/nordigen.js CHANGED
@@ -1,84 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- /**
4
- * Nordigen CLI - Production-ready command-line interface for Nordigen API
5
- *
6
- * @fileoverview Main entry point for the Nordigen CLI application
7
- * @module nordigen-cli
8
- */
9
-
10
- import { Command } from 'commander';
11
- import chalk from 'chalk';
12
- import { readFileSync } from 'fs';
13
3
  import { fileURLToPath } from 'url';
14
4
  import { dirname, join } from 'path';
15
5
 
16
- // Import commands
17
- import { authCommand } from '../src/commands/auth.js';
18
- import { accountsCommand } from '../src/commands/accounts.js';
19
- import { institutionsCommand } from '../src/commands/institutions.js';
20
- import { agreementsCommand } from '../src/commands/agreements.js';
21
- import { requisitionsCommand } from '../src/commands/requisitions.js';
22
- import { paymentsCommand } from '../src/commands/payments.js';
23
- import { configCommand } from '../src/commands/config.js';
24
-
25
6
  const __filename = fileURLToPath(import.meta.url);
26
7
  const __dirname = dirname(__filename);
27
- const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
28
-
29
- const program = new Command();
30
-
31
- program
32
- .name('nordigen')
33
- .description('Production-ready CLI for Nordigen Open Banking API')
34
- .version(packageJson.version)
35
- .addHelpText('after', `
36
- ${chalk.bold('Examples:')}
37
- ${chalk.cyan('$ nordigen auth login --secret-id <id> --secret-key <key>')}
38
- ${chalk.cyan('$ nordigen institutions list --country GB')}
39
- ${chalk.cyan('$ nordigen accounts list')}
40
- ${chalk.cyan('$ nordigen accounts transactions <account-id>')}
41
-
42
- ${chalk.bold('Documentation:')}
43
- README.md - Complete usage guide
44
- AGENT.md - AI agent integration patterns
45
- OPENCLAW.md - OpenClaw integration guide
46
-
47
- ${chalk.bold('Support:')}
48
- GitHub: https://github.com/ktmcp/nordigen-cli
49
- API Docs: https://nordigen.com/en/docs/
50
- `);
51
-
52
- // Register all commands
53
- program.addCommand(authCommand);
54
- program.addCommand(accountsCommand);
55
- program.addCommand(institutionsCommand);
56
- program.addCommand(agreementsCommand);
57
- program.addCommand(requisitionsCommand);
58
- program.addCommand(paymentsCommand);
59
- program.addCommand(configCommand);
60
-
61
- // Global error handling
62
- process.on('unhandledRejection', (error) => {
63
- console.error(chalk.red('Error:'), error.message);
64
- if (process.env.DEBUG) {
65
- console.error(error.stack);
66
- }
67
- process.exit(1);
68
- });
69
-
70
- process.on('uncaughtException', (error) => {
71
- console.error(chalk.red('Fatal Error:'), error.message);
72
- if (process.env.DEBUG) {
73
- console.error(error.stack);
74
- }
75
- process.exit(1);
76
- });
77
-
78
- // Parse arguments
79
- program.parse(process.argv);
80
8
 
81
- // Show help if no arguments provided
82
- if (!process.argv.slice(2).length) {
83
- program.outputHelp();
84
- }
9
+ // Import and run the main CLI
10
+ import(join(__dirname, '..', 'src', 'index.js'));