nocfo-cli 0.1.0__tar.gz
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.
- nocfo_cli-0.1.0/LICENSE +21 -0
- nocfo_cli-0.1.0/PKG-INFO +277 -0
- nocfo_cli-0.1.0/README.md +251 -0
- nocfo_cli-0.1.0/pyproject.toml +38 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/__init__.py +5 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/api_client.py +135 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/__init__.py +1 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/app.py +83 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/__init__.py +1 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/_helpers.py +99 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/accounts.py +103 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/auth.py +54 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/businesses.py +73 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/contacts.py +103 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/documents.py +103 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/files.py +93 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/invoices.py +171 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/products.py +103 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/purchase_invoices.py +84 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/tags.py +103 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/commands/user.py +16 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/context.py +50 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/cli/output.py +73 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/config.py +169 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/mcp/__init__.py +1 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/mcp/server.py +74 -0
- nocfo_cli-0.1.0/src/nocfo_toolkit/openapi.py +74 -0
nocfo_cli-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NoCFO
|
|
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.
|
nocfo_cli-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nocfo-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: NoCFO CLI, MCP server, and Cursor skill toolkit.
|
|
5
|
+
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: nocfo,cli,mcp,fastmcp,accounting,invoicing
|
|
8
|
+
Author: NoCFO
|
|
9
|
+
Requires-Python: >=3.10,<4.0
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Requires-Dist: fastmcp (>=2.0)
|
|
18
|
+
Requires-Dist: httpx (>=0.27)
|
|
19
|
+
Requires-Dist: python-dotenv (>=1.0)
|
|
20
|
+
Requires-Dist: rich (>=13.0)
|
|
21
|
+
Requires-Dist: typer (>=0.12)
|
|
22
|
+
Project-URL: Documentation, https://api-prd.nocfo.io/docs
|
|
23
|
+
Project-URL: Homepage, https://nocfo.io
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
<div align="center">
|
|
27
|
+
|
|
28
|
+
<img src="assets/banner.svg" alt="NoCFO AI Toolkit" width="100%" />
|
|
29
|
+
|
|
30
|
+
<br />
|
|
31
|
+
|
|
32
|
+
### Give AI assistants full access to Finnish bookkeeping, invoicing, and business data.
|
|
33
|
+
|
|
34
|
+
[](https://pypi.org/project/nocfo-cli/)
|
|
35
|
+
[](https://pypi.org/project/nocfo-cli/)
|
|
36
|
+
[](LICENSE)
|
|
37
|
+
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
Open-source Python toolkit that connects [NoCFO](https://nocfo.io) to your terminal and AI workflows — a single package powering a CLI client, an MCP server, and a Cursor AI skill.
|
|
41
|
+
|
|
42
|
+
## Features
|
|
43
|
+
|
|
44
|
+
- **All-in-one package** — CLI, MCP server, and Cursor skill from a single `pip install`
|
|
45
|
+
- **60+ MCP tools** across 11 domains (businesses, accounts, invoices, contacts, documents, and more)
|
|
46
|
+
- **OpenAPI-driven** — tools stay in sync with the live NoCFO API schema
|
|
47
|
+
- **PAT authentication** — simple token-based auth with config file, env var, or CLI flag
|
|
48
|
+
- **Dual output** — human-friendly tables for terminals, JSON for scripts and pipelines
|
|
49
|
+
- **Claude Desktop + Cursor** — works as stdio MCP server or standalone CLI
|
|
50
|
+
- **Zero-config run** — `uvx nocfo-cli --help` with no permanent install
|
|
51
|
+
|
|
52
|
+
## Quick Install
|
|
53
|
+
|
|
54
|
+
**pip** (recommended)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install nocfo-cli
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**pipx** (isolated install)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pipx install nocfo-cli
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**uvx** (no install needed)
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
uvx nocfo-cli --help
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Authentication
|
|
73
|
+
|
|
74
|
+
Create a Personal Access Token at [login.nocfo.io/auth/tokens](https://login.nocfo.io/auth/tokens), then configure once:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
nocfo auth configure --token <your_pat>
|
|
78
|
+
nocfo auth status
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Or pass via environment:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
export NOCFO_API_TOKEN=<your_pat>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
<details>
|
|
88
|
+
<summary>Auth precedence & defaults</summary>
|
|
89
|
+
|
|
90
|
+
| Priority | Source |
|
|
91
|
+
| -------- | --------------------------------- |
|
|
92
|
+
| 1 | `--api-token` CLI flag |
|
|
93
|
+
| 2 | `NOCFO_API_TOKEN` env var |
|
|
94
|
+
| 3 | `~/.config/nocfo-cli/config.json` |
|
|
95
|
+
|
|
96
|
+
Default base URL: `https://api-prd.nocfo.io`
|
|
97
|
+
Default output format: `table`
|
|
98
|
+
|
|
99
|
+
</details>
|
|
100
|
+
|
|
101
|
+
## Quick Start
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
nocfo user me # current user info
|
|
105
|
+
nocfo businesses list # list all businesses
|
|
106
|
+
nocfo invoices list --business slug # sales invoices
|
|
107
|
+
nocfo documents list --business slug --query date_from=2026-01-01
|
|
108
|
+
nocfo contacts create --business slug --field name=Acme
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
JSON output for automation:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
nocfo --output json businesses list | jq '.results[]'
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Set Up with Claude Desktop (step-by-step)
|
|
118
|
+
|
|
119
|
+
Connect NoCFO to Claude so you can ask questions about your bookkeeping in plain language. No coding experience needed.
|
|
120
|
+
|
|
121
|
+
### 1. Install Python
|
|
122
|
+
|
|
123
|
+
NoCFO AI Toolkit needs Python 3.10 or newer.
|
|
124
|
+
|
|
125
|
+
**Mac** — open **Terminal** (search "Terminal" in Spotlight) and run:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
brew install python
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
> Don't have Homebrew? Install it first: https://brew.sh
|
|
132
|
+
|
|
133
|
+
**Windows** — download from https://www.python.org/downloads/ and run the installer. **Check the box** "Add Python to PATH" during install.
|
|
134
|
+
|
|
135
|
+
Verify it works:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
python3 --version
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
You should see `Python 3.10` or higher.
|
|
142
|
+
|
|
143
|
+
### 2. Get your NoCFO token
|
|
144
|
+
|
|
145
|
+
You need a Personal Access Token (PAT) so that Claude can read your NoCFO data on your behalf.
|
|
146
|
+
|
|
147
|
+
1. Open [login.nocfo.io/auth/tokens](https://login.nocfo.io/auth/tokens/) in your browser
|
|
148
|
+
2. **Log in** with your NoCFO account (Apple, Google, Microsoft, or email)
|
|
149
|
+
3. After login, you'll see the **API-avaimet** (API keys) page
|
|
150
|
+
4. Click **Luo uusi avain** ("Create new key")
|
|
151
|
+
5. Give the token a name you'll recognise, e.g. `Claude Desktop`
|
|
152
|
+
6. Click **Luo** ("Create")
|
|
153
|
+
7. The token appears once — **copy it now** and save it somewhere safe (e.g. a password manager). You won't be able to see it again.
|
|
154
|
+
|
|
155
|
+
> **Tip:** If you lose the token, you can always delete the old one and create a new one from the same page.
|
|
156
|
+
|
|
157
|
+
### 3. Configure Claude Desktop
|
|
158
|
+
|
|
159
|
+
1. Open **Claude Desktop**
|
|
160
|
+
2. Go to **Settings → Developer → Edit Config** (or open the file manually — see paths below)
|
|
161
|
+
3. Paste the following into the config file, replacing `your_token_here` with the token from step 2:
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"nocfo": {
|
|
167
|
+
"command": "uvx",
|
|
168
|
+
"args": ["nocfo-cli", "mcp"],
|
|
169
|
+
"env": {
|
|
170
|
+
"NOCFO_API_TOKEN": "your_token_here"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
> If the file already has other servers configured, add the `"nocfo": { ... }` block inside the existing `"mcpServers"` object.
|
|
178
|
+
|
|
179
|
+
<details>
|
|
180
|
+
<summary>Config file locations</summary>
|
|
181
|
+
|
|
182
|
+
| OS | Path |
|
|
183
|
+
| ------- | ----------------------------------------------------------------- |
|
|
184
|
+
| Mac | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
185
|
+
| Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
186
|
+
|
|
187
|
+
</details>
|
|
188
|
+
|
|
189
|
+
4. **Restart Claude Desktop**
|
|
190
|
+
|
|
191
|
+
### 4. Try it out
|
|
192
|
+
|
|
193
|
+
Open a new chat in Claude and ask:
|
|
194
|
+
|
|
195
|
+
- _"Listaa yritykseni"_
|
|
196
|
+
- _"Montako myyntilaskua on tällä kuussa?"_
|
|
197
|
+
- _"Ketkä ovat suurimmat asiakkaani?"_
|
|
198
|
+
|
|
199
|
+
Claude uses NoCFO tools automatically to answer. You'll see a tool icon when it accesses your data.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Set Up with Cursor
|
|
204
|
+
|
|
205
|
+
Add the same config to Cursor's MCP settings (**Settings → MCP → Add Server**) using `nocfo mcp` as the stdio command and pass the token via the `NOCFO_API_TOKEN` env variable.
|
|
206
|
+
|
|
207
|
+
## MCP Server (advanced)
|
|
208
|
+
|
|
209
|
+
Start the MCP server manually from the terminal:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
nocfo mcp
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The server uses stdio transport. Any MCP-compatible client can connect to it.
|
|
216
|
+
|
|
217
|
+
## CLI Command Groups
|
|
218
|
+
|
|
219
|
+
| Group | Description |
|
|
220
|
+
| ------------------- | ---------------------------------------- |
|
|
221
|
+
| `auth` | Configure and verify authentication |
|
|
222
|
+
| `businesses` | List and manage businesses |
|
|
223
|
+
| `accounts` | Chart of accounts |
|
|
224
|
+
| `documents` | Accounting entries and journal documents |
|
|
225
|
+
| `contacts` | Customer and supplier contacts |
|
|
226
|
+
| `invoices` | Sales invoices |
|
|
227
|
+
| `purchase-invoices` | Purchase invoices |
|
|
228
|
+
| `products` | Invoicing products |
|
|
229
|
+
| `files` | File attachments |
|
|
230
|
+
| `tags` | Document tags |
|
|
231
|
+
| `user` | Current user info |
|
|
232
|
+
| `mcp` | Start MCP server |
|
|
233
|
+
|
|
234
|
+
## Development
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
poetry install # install dependencies
|
|
238
|
+
poetry run pytest # run tests
|
|
239
|
+
poetry run nocfo --help # run CLI locally
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Regenerate OpenAPI-based command stubs:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
poetry run python scripts/generate_cli_commands.py
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
<details>
|
|
249
|
+
<summary>Publishing to PyPI</summary>
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
poetry build
|
|
253
|
+
poetry config pypi-token.pypi <pypi_token>
|
|
254
|
+
poetry publish
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
For TestPyPI:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
poetry config repositories.testpypi https://test.pypi.org/legacy/
|
|
261
|
+
poetry config pypi-token.testpypi <testpypi_token>
|
|
262
|
+
poetry publish -r testpypi
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
</details>
|
|
266
|
+
|
|
267
|
+
## Security
|
|
268
|
+
|
|
269
|
+
- Never commit PAT tokens
|
|
270
|
+
- Keep `.env` local only
|
|
271
|
+
- Use separate tokens for test and production
|
|
272
|
+
- Local config contains secrets — do not share
|
|
273
|
+
|
|
274
|
+
## License
|
|
275
|
+
|
|
276
|
+
MIT — see [LICENSE](LICENSE).
|
|
277
|
+
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="assets/banner.svg" alt="NoCFO AI Toolkit" width="100%" />
|
|
4
|
+
|
|
5
|
+
<br />
|
|
6
|
+
|
|
7
|
+
### Give AI assistants full access to Finnish bookkeeping, invoicing, and business data.
|
|
8
|
+
|
|
9
|
+
[](https://pypi.org/project/nocfo-cli/)
|
|
10
|
+
[](https://pypi.org/project/nocfo-cli/)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
Open-source Python toolkit that connects [NoCFO](https://nocfo.io) to your terminal and AI workflows — a single package powering a CLI client, an MCP server, and a Cursor AI skill.
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- **All-in-one package** — CLI, MCP server, and Cursor skill from a single `pip install`
|
|
20
|
+
- **60+ MCP tools** across 11 domains (businesses, accounts, invoices, contacts, documents, and more)
|
|
21
|
+
- **OpenAPI-driven** — tools stay in sync with the live NoCFO API schema
|
|
22
|
+
- **PAT authentication** — simple token-based auth with config file, env var, or CLI flag
|
|
23
|
+
- **Dual output** — human-friendly tables for terminals, JSON for scripts and pipelines
|
|
24
|
+
- **Claude Desktop + Cursor** — works as stdio MCP server or standalone CLI
|
|
25
|
+
- **Zero-config run** — `uvx nocfo-cli --help` with no permanent install
|
|
26
|
+
|
|
27
|
+
## Quick Install
|
|
28
|
+
|
|
29
|
+
**pip** (recommended)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install nocfo-cli
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**pipx** (isolated install)
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pipx install nocfo-cli
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**uvx** (no install needed)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
uvx nocfo-cli --help
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Authentication
|
|
48
|
+
|
|
49
|
+
Create a Personal Access Token at [login.nocfo.io/auth/tokens](https://login.nocfo.io/auth/tokens), then configure once:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
nocfo auth configure --token <your_pat>
|
|
53
|
+
nocfo auth status
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or pass via environment:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
export NOCFO_API_TOKEN=<your_pat>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
<details>
|
|
63
|
+
<summary>Auth precedence & defaults</summary>
|
|
64
|
+
|
|
65
|
+
| Priority | Source |
|
|
66
|
+
| -------- | --------------------------------- |
|
|
67
|
+
| 1 | `--api-token` CLI flag |
|
|
68
|
+
| 2 | `NOCFO_API_TOKEN` env var |
|
|
69
|
+
| 3 | `~/.config/nocfo-cli/config.json` |
|
|
70
|
+
|
|
71
|
+
Default base URL: `https://api-prd.nocfo.io`
|
|
72
|
+
Default output format: `table`
|
|
73
|
+
|
|
74
|
+
</details>
|
|
75
|
+
|
|
76
|
+
## Quick Start
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
nocfo user me # current user info
|
|
80
|
+
nocfo businesses list # list all businesses
|
|
81
|
+
nocfo invoices list --business slug # sales invoices
|
|
82
|
+
nocfo documents list --business slug --query date_from=2026-01-01
|
|
83
|
+
nocfo contacts create --business slug --field name=Acme
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
JSON output for automation:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
nocfo --output json businesses list | jq '.results[]'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Set Up with Claude Desktop (step-by-step)
|
|
93
|
+
|
|
94
|
+
Connect NoCFO to Claude so you can ask questions about your bookkeeping in plain language. No coding experience needed.
|
|
95
|
+
|
|
96
|
+
### 1. Install Python
|
|
97
|
+
|
|
98
|
+
NoCFO AI Toolkit needs Python 3.10 or newer.
|
|
99
|
+
|
|
100
|
+
**Mac** — open **Terminal** (search "Terminal" in Spotlight) and run:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
brew install python
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
> Don't have Homebrew? Install it first: https://brew.sh
|
|
107
|
+
|
|
108
|
+
**Windows** — download from https://www.python.org/downloads/ and run the installer. **Check the box** "Add Python to PATH" during install.
|
|
109
|
+
|
|
110
|
+
Verify it works:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
python3 --version
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
You should see `Python 3.10` or higher.
|
|
117
|
+
|
|
118
|
+
### 2. Get your NoCFO token
|
|
119
|
+
|
|
120
|
+
You need a Personal Access Token (PAT) so that Claude can read your NoCFO data on your behalf.
|
|
121
|
+
|
|
122
|
+
1. Open [login.nocfo.io/auth/tokens](https://login.nocfo.io/auth/tokens/) in your browser
|
|
123
|
+
2. **Log in** with your NoCFO account (Apple, Google, Microsoft, or email)
|
|
124
|
+
3. After login, you'll see the **API-avaimet** (API keys) page
|
|
125
|
+
4. Click **Luo uusi avain** ("Create new key")
|
|
126
|
+
5. Give the token a name you'll recognise, e.g. `Claude Desktop`
|
|
127
|
+
6. Click **Luo** ("Create")
|
|
128
|
+
7. The token appears once — **copy it now** and save it somewhere safe (e.g. a password manager). You won't be able to see it again.
|
|
129
|
+
|
|
130
|
+
> **Tip:** If you lose the token, you can always delete the old one and create a new one from the same page.
|
|
131
|
+
|
|
132
|
+
### 3. Configure Claude Desktop
|
|
133
|
+
|
|
134
|
+
1. Open **Claude Desktop**
|
|
135
|
+
2. Go to **Settings → Developer → Edit Config** (or open the file manually — see paths below)
|
|
136
|
+
3. Paste the following into the config file, replacing `your_token_here` with the token from step 2:
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"mcpServers": {
|
|
141
|
+
"nocfo": {
|
|
142
|
+
"command": "uvx",
|
|
143
|
+
"args": ["nocfo-cli", "mcp"],
|
|
144
|
+
"env": {
|
|
145
|
+
"NOCFO_API_TOKEN": "your_token_here"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
> If the file already has other servers configured, add the `"nocfo": { ... }` block inside the existing `"mcpServers"` object.
|
|
153
|
+
|
|
154
|
+
<details>
|
|
155
|
+
<summary>Config file locations</summary>
|
|
156
|
+
|
|
157
|
+
| OS | Path |
|
|
158
|
+
| ------- | ----------------------------------------------------------------- |
|
|
159
|
+
| Mac | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
160
|
+
| Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
161
|
+
|
|
162
|
+
</details>
|
|
163
|
+
|
|
164
|
+
4. **Restart Claude Desktop**
|
|
165
|
+
|
|
166
|
+
### 4. Try it out
|
|
167
|
+
|
|
168
|
+
Open a new chat in Claude and ask:
|
|
169
|
+
|
|
170
|
+
- _"Listaa yritykseni"_
|
|
171
|
+
- _"Montako myyntilaskua on tällä kuussa?"_
|
|
172
|
+
- _"Ketkä ovat suurimmat asiakkaani?"_
|
|
173
|
+
|
|
174
|
+
Claude uses NoCFO tools automatically to answer. You'll see a tool icon when it accesses your data.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Set Up with Cursor
|
|
179
|
+
|
|
180
|
+
Add the same config to Cursor's MCP settings (**Settings → MCP → Add Server**) using `nocfo mcp` as the stdio command and pass the token via the `NOCFO_API_TOKEN` env variable.
|
|
181
|
+
|
|
182
|
+
## MCP Server (advanced)
|
|
183
|
+
|
|
184
|
+
Start the MCP server manually from the terminal:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
nocfo mcp
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The server uses stdio transport. Any MCP-compatible client can connect to it.
|
|
191
|
+
|
|
192
|
+
## CLI Command Groups
|
|
193
|
+
|
|
194
|
+
| Group | Description |
|
|
195
|
+
| ------------------- | ---------------------------------------- |
|
|
196
|
+
| `auth` | Configure and verify authentication |
|
|
197
|
+
| `businesses` | List and manage businesses |
|
|
198
|
+
| `accounts` | Chart of accounts |
|
|
199
|
+
| `documents` | Accounting entries and journal documents |
|
|
200
|
+
| `contacts` | Customer and supplier contacts |
|
|
201
|
+
| `invoices` | Sales invoices |
|
|
202
|
+
| `purchase-invoices` | Purchase invoices |
|
|
203
|
+
| `products` | Invoicing products |
|
|
204
|
+
| `files` | File attachments |
|
|
205
|
+
| `tags` | Document tags |
|
|
206
|
+
| `user` | Current user info |
|
|
207
|
+
| `mcp` | Start MCP server |
|
|
208
|
+
|
|
209
|
+
## Development
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
poetry install # install dependencies
|
|
213
|
+
poetry run pytest # run tests
|
|
214
|
+
poetry run nocfo --help # run CLI locally
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Regenerate OpenAPI-based command stubs:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
poetry run python scripts/generate_cli_commands.py
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
<details>
|
|
224
|
+
<summary>Publishing to PyPI</summary>
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
poetry build
|
|
228
|
+
poetry config pypi-token.pypi <pypi_token>
|
|
229
|
+
poetry publish
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
For TestPyPI:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
poetry config repositories.testpypi https://test.pypi.org/legacy/
|
|
236
|
+
poetry config pypi-token.testpypi <testpypi_token>
|
|
237
|
+
poetry publish -r testpypi
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
</details>
|
|
241
|
+
|
|
242
|
+
## Security
|
|
243
|
+
|
|
244
|
+
- Never commit PAT tokens
|
|
245
|
+
- Keep `.env` local only
|
|
246
|
+
- Use separate tokens for test and production
|
|
247
|
+
- Local config contains secrets — do not share
|
|
248
|
+
|
|
249
|
+
## License
|
|
250
|
+
|
|
251
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["poetry-core>=1.9.0"]
|
|
3
|
+
build-backend = "poetry.core.masonry.api"
|
|
4
|
+
|
|
5
|
+
[tool.poetry]
|
|
6
|
+
name = "nocfo-cli"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "NoCFO CLI, MCP server, and Cursor skill toolkit."
|
|
9
|
+
authors = ["NoCFO"]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
packages = [
|
|
13
|
+
{ include = "nocfo_toolkit", from = "src" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["nocfo", "cli", "mcp", "fastmcp", "accounting", "invoicing"]
|
|
16
|
+
|
|
17
|
+
[tool.poetry.urls]
|
|
18
|
+
Homepage = "https://nocfo.io"
|
|
19
|
+
Documentation = "https://api-prd.nocfo.io/docs"
|
|
20
|
+
|
|
21
|
+
[tool.poetry.dependencies]
|
|
22
|
+
python = ">=3.10,<4.0"
|
|
23
|
+
fastmcp = ">=2.0"
|
|
24
|
+
httpx = ">=0.27"
|
|
25
|
+
typer = ">=0.12"
|
|
26
|
+
rich = ">=13.0"
|
|
27
|
+
python-dotenv = ">=1.0"
|
|
28
|
+
|
|
29
|
+
[tool.poetry.group.dev.dependencies]
|
|
30
|
+
pytest = ">=8.0"
|
|
31
|
+
pre-commit = ">=4.0"
|
|
32
|
+
ruff = ">=0.1.7"
|
|
33
|
+
|
|
34
|
+
[tool.poetry.scripts]
|
|
35
|
+
nocfo = "nocfo_toolkit.cli.app:main"
|
|
36
|
+
|
|
37
|
+
[tool.pytest.ini_options]
|
|
38
|
+
pythonpath = ["src"]
|