storno-cli 1.0.5
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 +53 -0
- package/README.md +257 -0
- package/TOOLS.md +3309 -0
- package/dist/client.d.ts +42 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +162 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +22 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +30 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +172 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/accounting-export.d.ts +14 -0
- package/dist/tools/accounting-export.d.ts.map +1 -0
- package/dist/tools/accounting-export.js +97 -0
- package/dist/tools/accounting-export.js.map +1 -0
- package/dist/tools/admin.d.ts +8 -0
- package/dist/tools/admin.d.ts.map +1 -0
- package/dist/tools/admin.js +98 -0
- package/dist/tools/admin.js.map +1 -0
- package/dist/tools/anaf.d.ts +8 -0
- package/dist/tools/anaf.d.ts.map +1 -0
- package/dist/tools/anaf.js +115 -0
- package/dist/tools/anaf.js.map +1 -0
- package/dist/tools/api-keys.d.ts +8 -0
- package/dist/tools/api-keys.d.ts.map +1 -0
- package/dist/tools/api-keys.js +29 -0
- package/dist/tools/api-keys.js.map +1 -0
- package/dist/tools/auth.d.ts +8 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +187 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/backup.d.ts +62 -0
- package/dist/tools/backup.d.ts.map +1 -0
- package/dist/tools/backup.js +167 -0
- package/dist/tools/backup.js.map +1 -0
- package/dist/tools/bank-accounts.d.ts +14 -0
- package/dist/tools/bank-accounts.d.ts.map +1 -0
- package/dist/tools/bank-accounts.js +140 -0
- package/dist/tools/bank-accounts.js.map +1 -0
- package/dist/tools/borderou.d.ts +14 -0
- package/dist/tools/borderou.d.ts.map +1 -0
- package/dist/tools/borderou.js +233 -0
- package/dist/tools/borderou.js.map +1 -0
- package/dist/tools/clients.d.ts +14 -0
- package/dist/tools/clients.d.ts.map +1 -0
- package/dist/tools/clients.js +353 -0
- package/dist/tools/clients.js.map +1 -0
- package/dist/tools/companies.d.ts +8 -0
- package/dist/tools/companies.d.ts.map +1 -0
- package/dist/tools/companies.js +211 -0
- package/dist/tools/companies.js.map +1 -0
- package/dist/tools/company-registry.d.ts +31 -0
- package/dist/tools/company-registry.d.ts.map +1 -0
- package/dist/tools/company-registry.js +51 -0
- package/dist/tools/company-registry.js.map +1 -0
- package/dist/tools/cpv-codes.d.ts +17 -0
- package/dist/tools/cpv-codes.d.ts.map +1 -0
- package/dist/tools/cpv-codes.js +28 -0
- package/dist/tools/cpv-codes.js.map +1 -0
- package/dist/tools/dashboard.d.ts +23 -0
- package/dist/tools/dashboard.d.ts.map +1 -0
- package/dist/tools/dashboard.js +37 -0
- package/dist/tools/dashboard.js.map +1 -0
- package/dist/tools/defaults.d.ts +14 -0
- package/dist/tools/defaults.d.ts.map +1 -0
- package/dist/tools/defaults.js +29 -0
- package/dist/tools/defaults.js.map +1 -0
- package/dist/tools/delivery-notes.d.ts +185 -0
- package/dist/tools/delivery-notes.d.ts.map +1 -0
- package/dist/tools/delivery-notes.js +525 -0
- package/dist/tools/delivery-notes.js.map +1 -0
- package/dist/tools/document-series.d.ts +54 -0
- package/dist/tools/document-series.d.ts.map +1 -0
- package/dist/tools/document-series.js +171 -0
- package/dist/tools/document-series.js.map +1 -0
- package/dist/tools/efactura-messages.d.ts +34 -0
- package/dist/tools/efactura-messages.d.ts.map +1 -0
- package/dist/tools/efactura-messages.js +51 -0
- package/dist/tools/efactura-messages.js.map +1 -0
- package/dist/tools/einvoice.d.ts +8 -0
- package/dist/tools/einvoice.d.ts.map +1 -0
- package/dist/tools/einvoice.js +170 -0
- package/dist/tools/einvoice.js.map +1 -0
- package/dist/tools/email-templates.d.ts +14 -0
- package/dist/tools/email-templates.d.ts.map +1 -0
- package/dist/tools/email-templates.js +104 -0
- package/dist/tools/email-templates.js.map +1 -0
- package/dist/tools/exchange-rates.d.ts +14 -0
- package/dist/tools/exchange-rates.d.ts.map +1 -0
- package/dist/tools/exchange-rates.js +55 -0
- package/dist/tools/exchange-rates.js.map +1 -0
- package/dist/tools/exports.d.ts +14 -0
- package/dist/tools/exports.d.ts.map +1 -0
- package/dist/tools/exports.js +25 -0
- package/dist/tools/exports.js.map +1 -0
- package/dist/tools/import.d.ts +14 -0
- package/dist/tools/import.d.ts.map +1 -0
- package/dist/tools/import.js +221 -0
- package/dist/tools/import.js.map +1 -0
- package/dist/tools/invitations.d.ts +8 -0
- package/dist/tools/invitations.d.ts.map +1 -0
- package/dist/tools/invitations.js +70 -0
- package/dist/tools/invitations.js.map +1 -0
- package/dist/tools/invoices.d.ts +14 -0
- package/dist/tools/invoices.d.ts.map +1 -0
- package/dist/tools/invoices.js +1191 -0
- package/dist/tools/invoices.js.map +1 -0
- package/dist/tools/licensing.d.ts +8 -0
- package/dist/tools/licensing.d.ts.map +1 -0
- package/dist/tools/licensing.js +90 -0
- package/dist/tools/licensing.js.map +1 -0
- package/dist/tools/members.d.ts +8 -0
- package/dist/tools/members.d.ts.map +1 -0
- package/dist/tools/members.js +79 -0
- package/dist/tools/members.js.map +1 -0
- package/dist/tools/nc-codes.d.ts +17 -0
- package/dist/tools/nc-codes.d.ts.map +1 -0
- package/dist/tools/nc-codes.js +28 -0
- package/dist/tools/nc-codes.js.map +1 -0
- package/dist/tools/notifications.d.ts +8 -0
- package/dist/tools/notifications.d.ts.map +1 -0
- package/dist/tools/notifications.js +111 -0
- package/dist/tools/notifications.js.map +1 -0
- package/dist/tools/oauth2-clients.d.ts +8 -0
- package/dist/tools/oauth2-clients.d.ts.map +1 -0
- package/dist/tools/oauth2-clients.js +147 -0
- package/dist/tools/oauth2-clients.js.map +1 -0
- package/dist/tools/payments.d.ts +17 -0
- package/dist/tools/payments.d.ts.map +1 -0
- package/dist/tools/payments.js +109 -0
- package/dist/tools/payments.js.map +1 -0
- package/dist/tools/pdf-template-config.d.ts +14 -0
- package/dist/tools/pdf-template-config.d.ts.map +1 -0
- package/dist/tools/pdf-template-config.js +131 -0
- package/dist/tools/pdf-template-config.js.map +1 -0
- package/dist/tools/products.d.ts +40 -0
- package/dist/tools/products.d.ts.map +1 -0
- package/dist/tools/products.js +73 -0
- package/dist/tools/products.js.map +1 -0
- package/dist/tools/proforma-invoices.d.ts +198 -0
- package/dist/tools/proforma-invoices.d.ts.map +1 -0
- package/dist/tools/proforma-invoices.js +378 -0
- package/dist/tools/proforma-invoices.js.map +1 -0
- package/dist/tools/receipts.d.ts +166 -0
- package/dist/tools/receipts.d.ts.map +1 -0
- package/dist/tools/receipts.js +397 -0
- package/dist/tools/receipts.js.map +1 -0
- package/dist/tools/recurring-invoices.d.ts +187 -0
- package/dist/tools/recurring-invoices.d.ts.map +1 -0
- package/dist/tools/recurring-invoices.js +305 -0
- package/dist/tools/recurring-invoices.js.map +1 -0
- package/dist/tools/reports.d.ts +48 -0
- package/dist/tools/reports.d.ts.map +1 -0
- package/dist/tools/reports.js +200 -0
- package/dist/tools/reports.js.map +1 -0
- package/dist/tools/storage-config.d.ts +8 -0
- package/dist/tools/storage-config.d.ts.map +1 -0
- package/dist/tools/storage-config.js +117 -0
- package/dist/tools/storage-config.js.map +1 -0
- package/dist/tools/suppliers.d.ts +14 -0
- package/dist/tools/suppliers.d.ts.map +1 -0
- package/dist/tools/suppliers.js +205 -0
- package/dist/tools/suppliers.js.map +1 -0
- package/dist/tools/system.d.ts +8 -0
- package/dist/tools/system.d.ts.map +1 -0
- package/dist/tools/system.js +24 -0
- package/dist/tools/system.js.map +1 -0
- package/dist/tools/vat-rates.d.ts +14 -0
- package/dist/tools/vat-rates.d.ts.map +1 -0
- package/dist/tools/vat-rates.js +145 -0
- package/dist/tools/vat-rates.js.map +1 -0
- package/dist/tools/webhooks.d.ts +8 -0
- package/dist/tools/webhooks.d.ts.map +1 -0
- package/dist/tools/webhooks.js +305 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/utils/errors.d.ts +18 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +45 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/pagination.d.ts +9 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/pagination.js +10 -0
- package/dist/utils/pagination.js.map +1 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
## Elastic License 2.0
|
|
2
|
+
|
|
3
|
+
### Acceptance
|
|
4
|
+
|
|
5
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
6
|
+
|
|
7
|
+
### Copyright License
|
|
8
|
+
|
|
9
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below.
|
|
10
|
+
|
|
11
|
+
### Limitations
|
|
12
|
+
|
|
13
|
+
You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
|
|
14
|
+
|
|
15
|
+
You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
|
|
16
|
+
|
|
17
|
+
You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor's trademarks is subject to applicable law.
|
|
18
|
+
|
|
19
|
+
### Patents
|
|
20
|
+
|
|
21
|
+
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
22
|
+
|
|
23
|
+
### Notices
|
|
24
|
+
|
|
25
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
|
|
26
|
+
|
|
27
|
+
If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
|
|
28
|
+
|
|
29
|
+
### No Other Rights
|
|
30
|
+
|
|
31
|
+
These terms do not imply any licenses other than those expressly granted in these terms.
|
|
32
|
+
|
|
33
|
+
### Termination
|
|
34
|
+
|
|
35
|
+
If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
|
|
36
|
+
|
|
37
|
+
### No Liability
|
|
38
|
+
|
|
39
|
+
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
|
|
40
|
+
|
|
41
|
+
### Definitions
|
|
42
|
+
|
|
43
|
+
The **licensor** is the entity offering these terms, and the **software** is the software the licensor makes available under these terms, including any portion of it.
|
|
44
|
+
|
|
45
|
+
**you** refers to the individual or entity agreeing to these terms.
|
|
46
|
+
|
|
47
|
+
**your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
48
|
+
|
|
49
|
+
**your licenses** are all the licenses granted to you for the software under these terms.
|
|
50
|
+
|
|
51
|
+
**use** means anything you do with the software requiring one of your licenses.
|
|
52
|
+
|
|
53
|
+
**trademark** means trademarks, service marks, and similar rights.
|
package/README.md
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# Storno CLI — MCP Server
|
|
2
|
+
|
|
3
|
+
A **Model Context Protocol (MCP) server** that exposes the entire [Storno.ro](https://storno.ro) e-invoicing API as AI-callable tools. Enables Claude Code, Cursor, Windsurf, and any MCP-compatible AI assistant to manage invoices, clients, companies, ANAF e-Factura, and more.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **237 tools** covering all Storno.ro API endpoints
|
|
8
|
+
- Full invoice lifecycle: create, issue, submit to ANAF, email, download PDF/XML
|
|
9
|
+
- Proforma invoices, recurring invoices, delivery notes, credit notes
|
|
10
|
+
- Client & product catalog, payment tracking, VAT rates
|
|
11
|
+
- ANAF e-Factura integration (sync, token management, message retrieval)
|
|
12
|
+
- Multi-company support with company switching
|
|
13
|
+
- Automatic JWT token refresh
|
|
14
|
+
- Webhooks, API keys, team member management
|
|
15
|
+
- Exchange rates (BNR), reports, exports
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### 1. Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g storno-cli
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or use directly with `npx` — no install needed.
|
|
26
|
+
|
|
27
|
+
### 2. Configure for Claude Code
|
|
28
|
+
|
|
29
|
+
Add to your project's `.claude/settings.json` or global `~/.claude/settings.json`:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"storno": {
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["-y", "storno-cli"],
|
|
37
|
+
"env": {
|
|
38
|
+
"STORNO_TOKEN": "your-jwt-token",
|
|
39
|
+
"STORNO_COMPANY_ID": "your-company-uuid"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 3. Configure for Cursor
|
|
47
|
+
|
|
48
|
+
Add to `.cursor/mcp.json`:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"storno": {
|
|
54
|
+
"command": "npx",
|
|
55
|
+
"args": ["-y", "storno-cli"],
|
|
56
|
+
"env": {
|
|
57
|
+
"STORNO_TOKEN": "your-jwt-token",
|
|
58
|
+
"STORNO_COMPANY_ID": "your-company-uuid"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 4. Configure for Claude Desktop
|
|
66
|
+
|
|
67
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"mcpServers": {
|
|
72
|
+
"storno": {
|
|
73
|
+
"command": "npx",
|
|
74
|
+
"args": ["-y", "storno-cli"],
|
|
75
|
+
"env": {
|
|
76
|
+
"STORNO_TOKEN": "your-jwt-token",
|
|
77
|
+
"STORNO_COMPANY_ID": "your-company-uuid"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Environment Variables
|
|
85
|
+
|
|
86
|
+
| Variable | Required | Default | Description |
|
|
87
|
+
|----------|----------|---------|-------------|
|
|
88
|
+
| `STORNO_BASE_URL` | No | `https://api.storno.ro` | API base URL |
|
|
89
|
+
| `STORNO_TOKEN` | No* | — | JWT access token |
|
|
90
|
+
| `STORNO_REFRESH_TOKEN` | No | — | JWT refresh token (for auto-renewal) |
|
|
91
|
+
| `STORNO_COMPANY_ID` | No* | — | Default company UUID |
|
|
92
|
+
| `STORNO_EMAIL` | No | — | Email for auto-login (if no token) |
|
|
93
|
+
| `STORNO_PASSWORD` | No | — | Password for auto-login (if no token) |
|
|
94
|
+
|
|
95
|
+
\* You can authenticate at runtime using the `auth_login` tool instead.
|
|
96
|
+
|
|
97
|
+
## Authentication
|
|
98
|
+
|
|
99
|
+
Three ways to authenticate:
|
|
100
|
+
|
|
101
|
+
### Option A: Pre-configured token (recommended for production)
|
|
102
|
+
|
|
103
|
+
Set `STORNO_TOKEN` in your MCP server environment config.
|
|
104
|
+
|
|
105
|
+
### Option B: Auto-login on startup
|
|
106
|
+
|
|
107
|
+
Set `STORNO_EMAIL` and `STORNO_PASSWORD`. The server will automatically log in when it starts and keep the token refreshed.
|
|
108
|
+
|
|
109
|
+
### Option C: Interactive login via AI
|
|
110
|
+
|
|
111
|
+
Ask the AI: *"Log me in to Storno with email user@example.com and password mypassword"*
|
|
112
|
+
|
|
113
|
+
The AI will call the `auth_login` tool, which stores the token in memory for the session.
|
|
114
|
+
|
|
115
|
+
## Multi-Company Support
|
|
116
|
+
|
|
117
|
+
All company-scoped tools require a company context. Three ways to provide it:
|
|
118
|
+
|
|
119
|
+
1. **Environment variable**: Set `STORNO_COMPANY_ID` in your MCP config
|
|
120
|
+
2. **Select command**: Ask the AI to call `companies_select` with a company UUID
|
|
121
|
+
3. **Per-request override**: Every company-scoped tool accepts an optional `companyId` parameter
|
|
122
|
+
|
|
123
|
+
Example AI conversation:
|
|
124
|
+
```
|
|
125
|
+
You: List my companies
|
|
126
|
+
AI: [calls companies_list] You have 2 companies:
|
|
127
|
+
- ABC SRL (uuid: 550e8400...)
|
|
128
|
+
- XYZ SRL (uuid: 661f9500...)
|
|
129
|
+
|
|
130
|
+
You: Switch to XYZ SRL
|
|
131
|
+
AI: [calls companies_select with uuid] Done, now using XYZ SRL
|
|
132
|
+
|
|
133
|
+
You: Show me recent invoices
|
|
134
|
+
AI: [calls invoices_list — automatically uses XYZ SRL context]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Tool Reference
|
|
138
|
+
|
|
139
|
+
See [TOOLS.md](./TOOLS.md) for the complete reference of all 237 tools with descriptions and parameters.
|
|
140
|
+
|
|
141
|
+
### Tool Categories
|
|
142
|
+
|
|
143
|
+
| Category | Tools | Description |
|
|
144
|
+
|----------|-------|-------------|
|
|
145
|
+
| `auth_*` | 7 | Login, register, refresh tokens, profile management |
|
|
146
|
+
| `companies_*` | 8 | Company CRUD + context switching + ANAF settings |
|
|
147
|
+
| `invoices_*` | 32 | Full invoice lifecycle (create → issue → submit → email → PDF/XML) |
|
|
148
|
+
| `clients_*` | 10 | Client management (synced from e-Factura) |
|
|
149
|
+
| `products_*` | 2 | Product catalog |
|
|
150
|
+
| `payments_*` | 3 | Payment recording and tracking |
|
|
151
|
+
| `proforma_invoices_*` | 12 | Proforma lifecycle (create → send → accept/reject → convert) |
|
|
152
|
+
| `recurring_invoices_*` | 10 | Recurring invoice schedules |
|
|
153
|
+
| `delivery_notes_*` | 18 | Delivery note lifecycle + status management |
|
|
154
|
+
| `receipts_*` | 13 | Fiscal receipts (bonuri fiscale) + conversion to invoices |
|
|
155
|
+
| `vat_rates_*` | 4 | VAT rate CRUD |
|
|
156
|
+
| `bank_accounts_*` | 4 | Bank account CRUD |
|
|
157
|
+
| `document_series_*` | 5 | Invoice number series management |
|
|
158
|
+
| `suppliers_*` | 8 | Supplier management |
|
|
159
|
+
| `exchange_rates_*` | 2 | BNR exchange rates + currency conversion |
|
|
160
|
+
| `email_templates_*` | 4 | Email template CRUD |
|
|
161
|
+
| `anaf_*` | 8 | ANAF token management + e-Factura sync + validation |
|
|
162
|
+
| `efactura_messages_*` | 2 | e-Factura message retrieval |
|
|
163
|
+
| `einvoice_*` | 6 | Multi-country e-invoicing (EU-wide) |
|
|
164
|
+
| `dashboard_*` | 1 | Dashboard statistics |
|
|
165
|
+
| `defaults_*` | 1 | Invoice defaults (currencies, units, VAT rates) |
|
|
166
|
+
| `members_*` | 3 | Organization team members |
|
|
167
|
+
| `invitations_*` | 4 | Team invitations |
|
|
168
|
+
| `notifications_*` | 6 | Notification management + preferences |
|
|
169
|
+
| `webhooks_*` | 10 | Webhook CRUD + testing + delivery logs |
|
|
170
|
+
| `api_keys_*` | 5 | API token management |
|
|
171
|
+
| `reports_*` | 7 | VAT reports + financial reports |
|
|
172
|
+
| `exports_*` | 1 | Export file downloads |
|
|
173
|
+
| `import_*` | 8 | CSV/XLSX/XML import for clients, products, invoices |
|
|
174
|
+
| `borderou_*` | 8 | Bank reconciliation (borderou) |
|
|
175
|
+
| `backup_*` | 6 | Backup creation + restore |
|
|
176
|
+
| `admin_*` | 3 | System administration (requires admin role) |
|
|
177
|
+
| `licensing_*` | 4 | License key management |
|
|
178
|
+
| `pdf_template_*` | 4 | PDF invoice template customization |
|
|
179
|
+
| `storage_config_*` | 5 | File storage configuration |
|
|
180
|
+
| `accounting_export_*` | 3 | Export to accounting formats |
|
|
181
|
+
| `company_registry_*` | 2 | Company registry lookups |
|
|
182
|
+
| `cpv_codes_*` | 1 | CPV code lookup |
|
|
183
|
+
| `nc_codes_*` | 1 | NC code lookup |
|
|
184
|
+
| `system_*` | 2 | System health + version info |
|
|
185
|
+
|
|
186
|
+
## Common AI Workflows
|
|
187
|
+
|
|
188
|
+
### Create and send an invoice
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
You: Create an invoice for client Acme SRL, 10 hours web development at 100 RON/hour, due in 30 days
|
|
192
|
+
|
|
193
|
+
AI: [calls clients_list to find Acme SRL]
|
|
194
|
+
[calls invoices_create with clientId, lines, dates]
|
|
195
|
+
[calls invoices_issue to mark as issued]
|
|
196
|
+
[calls invoices_email to send to client]
|
|
197
|
+
Invoice FAC-2024-042 created, issued, and emailed to contact@acme.ro
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Check ANAF sync status
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
You: What's the ANAF sync status for my company?
|
|
204
|
+
|
|
205
|
+
AI: [calls anaf_status]
|
|
206
|
+
Last sync: 2 hours ago, 156 invoices synced, token valid until March 16
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Generate a monthly report
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
You: Show me all invoices from January 2024
|
|
213
|
+
|
|
214
|
+
AI: [calls invoices_list with from=2024-01-01, to=2024-01-31]
|
|
215
|
+
Found 23 invoices, total: 45,230 RON
|
|
216
|
+
- 18 issued, 3 paid, 2 overdue
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Development
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
npm run dev # Watch mode (recompile on changes)
|
|
223
|
+
npm run build # Production build
|
|
224
|
+
npm run start # Start MCP server
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Architecture
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
storno-cli/
|
|
231
|
+
├── src/
|
|
232
|
+
│ ├── index.ts # MCP server entry point (stdio transport)
|
|
233
|
+
│ ├── config.ts # Environment configuration
|
|
234
|
+
│ ├── client.ts # HTTP client with JWT auth + auto-refresh
|
|
235
|
+
│ ├── tools/ # 40 tool domain files (237 tools total)
|
|
236
|
+
│ │ ├── auth.ts
|
|
237
|
+
│ │ ├── invoices.ts # Largest: 32 tools for full invoice lifecycle
|
|
238
|
+
│ │ ├── companies.ts
|
|
239
|
+
│ │ └── ... # 37 more domain files
|
|
240
|
+
│ └── utils/
|
|
241
|
+
│ ├── errors.ts # AI-readable error formatting
|
|
242
|
+
│ └── pagination.ts # Pagination helpers
|
|
243
|
+
├── dist/ # Compiled JavaScript output
|
|
244
|
+
├── package.json
|
|
245
|
+
├── tsconfig.json
|
|
246
|
+
├── README.md # This file
|
|
247
|
+
└── TOOLS.md # Complete tool reference
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Requirements
|
|
251
|
+
|
|
252
|
+
- Node.js >= 20.0.0
|
|
253
|
+
- npm
|
|
254
|
+
|
|
255
|
+
## License
|
|
256
|
+
|
|
257
|
+
[Elastic License 2.0 (ELv2)](LICENSE)
|