bkper 3.7.0 → 3.8.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/README.md +101 -122
- package/lib/commands/apps.d.ts.map +1 -1
- package/lib/commands/apps.js +2 -10
- package/lib/commands/apps.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,52 +8,37 @@ The MCP server enables AI assistants and agents to interact with your Bkper book
|
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### npm
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
npm i bkper
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
or
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
yarn add bkper
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
or
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
bun add bkper
|
|
14
|
+
npm i -g bkper
|
|
27
15
|
```
|
|
28
16
|
|
|
29
|
-
|
|
17
|
+
### yarn
|
|
30
18
|
|
|
31
19
|
```
|
|
32
|
-
|
|
20
|
+
yarn global add bkper
|
|
33
21
|
```
|
|
34
22
|
|
|
35
|
-
|
|
23
|
+
### bun
|
|
36
24
|
|
|
37
25
|
```
|
|
38
|
-
|
|
26
|
+
bun add -g bkper
|
|
39
27
|
```
|
|
40
28
|
|
|
41
29
|
## Commands
|
|
42
30
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
31
|
+
- `login` - Logs the user in, storing local credentials.
|
|
32
|
+
- `logout` - Logs out the user by deleting client credentials.
|
|
33
|
+
- `mcp start` - Start the Bkper MCP (Model Context Protocol) server.
|
|
34
|
+
- `apps list` - List all apps you have access to.
|
|
35
|
+
- `apps create` - Create a new App based on `./bkperapp.yaml` file.
|
|
36
|
+
- `apps update` - Update an existing App based on `./bkperapp.yaml` file.
|
|
48
37
|
|
|
49
38
|
### Examples
|
|
50
39
|
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
yarn bkper login
|
|
40
|
+
```bash
|
|
41
|
+
bkper login
|
|
57
42
|
```
|
|
58
43
|
|
|
59
44
|
### MCP (Model Context Protocol) Server
|
|
@@ -68,18 +53,18 @@ bkper mcp start
|
|
|
68
53
|
|
|
69
54
|
The server runs on stdio and provides the following tools:
|
|
70
55
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
56
|
+
- **list_books** - List all books accessible by the authenticated user
|
|
57
|
+
- **get_book** - Get detailed information about a specific book
|
|
58
|
+
- **get_balances** - Get account balances with query filtering
|
|
59
|
+
- **list_transactions** - List transactions with filtering and pagination
|
|
60
|
+
- **create_transactions** - Create transactions in batch
|
|
61
|
+
- **merge_transactions** - Merge duplicate transactions into one
|
|
75
62
|
|
|
76
63
|
#### Prerequisites
|
|
77
64
|
|
|
78
65
|
Before using the MCP server:
|
|
79
66
|
|
|
80
67
|
1. Login using `bkper login` to set up authentication
|
|
81
|
-
2. Enable the [Bkper REST API]
|
|
82
|
-
3. Ensure the `BKPER_API_KEY` environment variable is set.
|
|
83
68
|
|
|
84
69
|
The MCP server uses the same authentication as the CLI, reading credentials from `~/.config/bkper/.bkper-credentials.json`.
|
|
85
70
|
|
|
@@ -89,20 +74,17 @@ The MCP server uses the same authentication as the CLI, reading credentials from
|
|
|
89
74
|
|
|
90
75
|
Add to your configuration file:
|
|
91
76
|
|
|
92
|
-
-
|
|
93
|
-
-
|
|
77
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
78
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
94
79
|
|
|
95
80
|
```json
|
|
96
81
|
{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"BKPER_API_KEY": "your-api-key-here"
|
|
103
|
-
}
|
|
82
|
+
"mcpServers": {
|
|
83
|
+
"bkper": {
|
|
84
|
+
"command": "bkper",
|
|
85
|
+
"args": ["mcp", "start"]
|
|
86
|
+
}
|
|
104
87
|
}
|
|
105
|
-
}
|
|
106
88
|
}
|
|
107
89
|
```
|
|
108
90
|
|
|
@@ -111,7 +93,7 @@ Add to your configuration file:
|
|
|
111
93
|
For other MCP-compatible clients, configure them to run:
|
|
112
94
|
|
|
113
95
|
```bash
|
|
114
|
-
|
|
96
|
+
bkper mcp start
|
|
115
97
|
```
|
|
116
98
|
|
|
117
99
|
The server communicates via stdio, so any MCP client that supports stdio transport can connect to it.
|
|
@@ -120,10 +102,12 @@ The server communicates via stdio, so any MCP client that supports stdio transpo
|
|
|
120
102
|
|
|
121
103
|
Once connected, the MCP client can:
|
|
122
104
|
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
105
|
+
- List your Bkper books
|
|
106
|
+
- Get detailed book information including group hierarchy
|
|
107
|
+
- Get account balances with flexible query filtering
|
|
108
|
+
- Search and filter transactions with pagination
|
|
109
|
+
- Create transactions in batch
|
|
110
|
+
- Merge duplicate transactions
|
|
127
111
|
|
|
128
112
|
For more information about the Model Context Protocol, visit [modelcontextprotocol.io](https://modelcontextprotocol.io).
|
|
129
113
|
|
|
@@ -131,24 +115,9 @@ For more information about the Model Context Protocol, visit [modelcontextprotoc
|
|
|
131
115
|
|
|
132
116
|
### Environment Variables
|
|
133
117
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
BKPER_API_KEY=XXXX
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
The `app` command also uses the following variables in order to perform App create/update operations:
|
|
118
|
+
`BKPER_API_KEY` is optional. If not set, uses the Bkper API proxy with a managed API key.
|
|
141
119
|
|
|
142
|
-
|
|
143
|
-
BKPER_CLIENT_SECRET=YYYY
|
|
144
|
-
BKPER_USER_EMAILS="someone@gmail.com anotherone@altrostat.com"
|
|
145
|
-
BKPER_DEVELOPER_EMAIL=somedeveloer@mycompany.com
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
You can add a `.env` file at the root of your project with those variables and bkper will automatically load from it.
|
|
149
|
-
Follow [these](https://bkper.com/docs/#rest-api-enabling) steps in order to configure a valid Bkper API key.
|
|
150
|
-
|
|
151
|
-
> WARNING: Never upload variables to the source code repository.
|
|
120
|
+
Set it for direct API access with your own quotas and attribution. Follow [these](https://bkper.com/docs/#rest-api-enabling) steps.
|
|
152
121
|
|
|
153
122
|
### `./bkperapp.yaml` Reference
|
|
154
123
|
|
|
@@ -167,6 +136,16 @@ logoUrl: https://static.thenounproject.com/png/2318500-200.png
|
|
|
167
136
|
# The logo url to be used when in dark mode
|
|
168
137
|
logoUrlDark: https://static.thenounproject.com/png/2318500-200.png
|
|
169
138
|
|
|
139
|
+
# ACCESS CONTROL (safe to version - uses usernames, not emails)
|
|
140
|
+
|
|
141
|
+
# Developers who can update the App. Comma or space separated usernames.
|
|
142
|
+
# Supports domain wildcards for registered custom domains (e.g., *@bkper.com)
|
|
143
|
+
developers: victor, aldo, *@bkper.com
|
|
144
|
+
|
|
145
|
+
# Users who can use the App while not yet published. Comma or space separated usernames.
|
|
146
|
+
# Supports domain wildcards for registered custom domains (e.g., *@acme.com)
|
|
147
|
+
users: maria, *@acme.com
|
|
148
|
+
|
|
170
149
|
# CONTEXT MENU CONFIGURATION
|
|
171
150
|
|
|
172
151
|
# The menu production url to open in the popup window. See accepted expressions bellow.
|
|
@@ -189,69 +168,69 @@ webhookUrl: https://us-central1-bkper-tax-trigger.cloudfunctions.net/events
|
|
|
189
168
|
# The events the Bot is capable of processing by the webhook.
|
|
190
169
|
# This is optional and, if not specified, no events will be processed.
|
|
191
170
|
events:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
171
|
+
- "TRANSACTION_POSTED"
|
|
172
|
+
- "TRANSACTION_CHECKED"
|
|
173
|
+
- "TRANSACTION_UNCHECKED"
|
|
174
|
+
- "TRANSACTION_UPDATED"
|
|
175
|
+
- "TRANSACTION_DELETED"
|
|
176
|
+
- "TRANSACTION_RESTORED"
|
|
177
|
+
- "ACCOUNT_CREATED"
|
|
178
|
+
- "ACCOUNT_UPDATED"
|
|
179
|
+
- "ACCOUNT_DELETED"
|
|
180
|
+
- "GROUP_CREATED"
|
|
181
|
+
- "GROUP_UPDATED"
|
|
182
|
+
- "GROUP_DELETED"
|
|
183
|
+
- "FILE_CREATED"
|
|
184
|
+
- "BOOK_UPDATED"
|
|
206
185
|
|
|
207
186
|
# The file patterns the Bot is capable of processing. It accepts wildcards. E.g.
|
|
208
187
|
filePatterns:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
188
|
+
- "radiusbank*.ofx"
|
|
189
|
+
- "-*.qif"
|
|
190
|
+
- "*.csv"
|
|
212
191
|
|
|
213
192
|
# Schema to provide autocompletion on properties editor.
|
|
214
193
|
propertiesSchema:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
194
|
+
book:
|
|
195
|
+
keys:
|
|
196
|
+
- "key1"
|
|
197
|
+
- "key2"
|
|
198
|
+
values:
|
|
199
|
+
- "value2"
|
|
200
|
+
- "value2"
|
|
201
|
+
group:
|
|
202
|
+
keys:
|
|
203
|
+
- "key1"
|
|
204
|
+
- "key2"
|
|
205
|
+
values:
|
|
206
|
+
- "value2"
|
|
207
|
+
- "value2"
|
|
208
|
+
account:
|
|
209
|
+
keys:
|
|
210
|
+
- "key1"
|
|
211
|
+
- "key2"
|
|
212
|
+
values:
|
|
213
|
+
- "value2"
|
|
214
|
+
- "value2"
|
|
215
|
+
transaction:
|
|
216
|
+
keys:
|
|
217
|
+
- "key1"
|
|
218
|
+
- "key2"
|
|
219
|
+
values:
|
|
220
|
+
- "value2"
|
|
221
|
+
- "value2"
|
|
243
222
|
```
|
|
244
223
|
|
|
245
224
|
#### Accepted expressions in menuUrl property:
|
|
246
225
|
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
-
|
|
226
|
+
- `${book.id}` - the current book id
|
|
227
|
+
- `${book.properties.xxxxx}` - any property value from the current book
|
|
228
|
+
- `${transactions.query}` - the current query being executed on transactions list
|
|
229
|
+
- `${transactions.ids}` - the ids of selected transactions, splitted by comma
|
|
230
|
+
- `${account.id}` - the current account being filterd
|
|
231
|
+
- `${account.properties.xxxxx}` - any property value from the current account being filtered
|
|
232
|
+
- `${group.id}` - the current group being filterd
|
|
233
|
+
- `${group.properties.xxxxx}` - any property value from the current group being filtered
|
|
255
234
|
|
|
256
235
|
#### Example:
|
|
257
236
|
|
|
@@ -270,10 +249,10 @@ import { Bkper } from "bkper-js";
|
|
|
270
249
|
import { getOAuthToken } from "bkper";
|
|
271
250
|
|
|
272
251
|
Bkper.setConfig({
|
|
273
|
-
|
|
252
|
+
oauthTokenProvider: async () => getOAuthToken(),
|
|
274
253
|
});
|
|
275
254
|
```
|
|
276
255
|
|
|
277
256
|
## Documentation
|
|
278
257
|
|
|
279
|
-
-
|
|
258
|
+
- [Developer Docs](https://bkper.com/docs)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/commands/apps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAK/B;;;;GAIG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAIrD;
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/commands/apps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAK/B;;;;GAIG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAIrD;AAgDD;;;;GAIG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,CAI9C;AAED;;;;GAIG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,CAI9C"}
|
package/lib/commands/apps.js
CHANGED
|
@@ -52,8 +52,9 @@ function loadReadme() {
|
|
|
52
52
|
return undefined;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* Creates an App instance configured
|
|
55
|
+
* Creates an App instance configured from bkperapp.yaml and environment variables.
|
|
56
56
|
*
|
|
57
|
+
|
|
57
58
|
* @returns Configured App instance
|
|
58
59
|
*/
|
|
59
60
|
function createConfiguredApp() {
|
|
@@ -63,15 +64,6 @@ function createConfiguredApp() {
|
|
|
63
64
|
if (readme) {
|
|
64
65
|
app.setReadme(readme);
|
|
65
66
|
}
|
|
66
|
-
if (process.env.BKPER_CLIENT_SECRET) {
|
|
67
|
-
app.setClientSecret(process.env.BKPER_CLIENT_SECRET);
|
|
68
|
-
}
|
|
69
|
-
if (process.env.BKPER_DEVELOPER_EMAIL) {
|
|
70
|
-
app.setDeveloperEmail(process.env.BKPER_DEVELOPER_EMAIL);
|
|
71
|
-
}
|
|
72
|
-
if (process.env.BKPER_USER_EMAILS) {
|
|
73
|
-
app.setUserEmails(process.env.BKPER_USER_EMAILS);
|
|
74
|
-
}
|
|
75
67
|
return app;
|
|
76
68
|
}
|
|
77
69
|
/**
|
package/lib/commands/apps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/commands/apps.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,UAAgB,QAAQ;;QAC5B,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;CAAA;AAED;;;;;GAKG;AACH,SAAS,aAAa;IACpB,IAAI,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;SAAM,IAAI,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU;IACjB,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC,YAAY,CA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