quantix-mcp 0.3.7 → 0.3.9
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/.github/agents/copilot-instructions.md +32 -32
- package/.github/copilot-instructions.md +17 -17
- package/.github/workflows/publish.yaml +28 -28
- package/.opencode/command/speckit.analyze.md +184 -184
- package/.opencode/command/speckit.checklist.md +294 -294
- package/.opencode/command/speckit.clarify.md +181 -181
- package/.opencode/command/speckit.constitution.md +84 -84
- package/.opencode/command/speckit.implement.md +135 -135
- package/.opencode/command/speckit.plan.md +89 -89
- package/.opencode/command/speckit.specify.md +258 -258
- package/.opencode/command/speckit.tasks.md +137 -137
- package/.opencode/command/speckit.taskstoissues.md +30 -30
- package/.specify/memory/constitution.md +58 -58
- package/.specify/templates/constitution-template.md +50 -50
- package/.vscode/launch.json +14 -14
- package/CLAUDE.md +64 -64
- package/README.md +176 -176
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/tools/accounts.d.ts.map +1 -1
- package/dist/tools/accounts.js +64 -28
- package/dist/tools/accounts.js.map +1 -1
- package/dist/tools/categories.d.ts.map +1 -1
- package/dist/tools/categories.js +46 -20
- package/dist/tools/categories.js.map +1 -1
- package/dist/tools/credit-cards.d.ts.map +1 -1
- package/dist/tools/credit-cards.js +89 -33
- package/dist/tools/credit-cards.js.map +1 -1
- package/dist/tools/data.d.ts.map +1 -1
- package/dist/tools/data.js +19 -8
- package/dist/tools/data.js.map +1 -1
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +28 -12
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/summary.d.ts.map +1 -1
- package/dist/tools/summary.js +17 -11
- package/dist/tools/summary.js.map +1 -1
- package/dist/tools/transactions.d.ts.map +1 -1
- package/dist/tools/transactions.js +86 -50
- package/dist/tools/transactions.js.map +1 -1
- package/dist/tools/transfers.d.ts +3 -0
- package/dist/tools/transfers.d.ts.map +1 -0
- package/dist/tools/transfers.js +107 -0
- package/dist/tools/transfers.js.map +1 -0
- package/dist/types/schemas.d.ts +25 -0
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +28 -2
- package/dist/types/schemas.js.map +1 -1
- package/dist/utils/toolHelpers.d.ts +7 -0
- package/dist/utils/toolHelpers.d.ts.map +1 -0
- package/dist/utils/toolHelpers.js +11 -0
- package/dist/utils/toolHelpers.js.map +1 -0
- package/openapi.yaml +2045 -1828
- package/package.json +41 -41
- package/specs/001-mcp-api-integration/checklists/requirements.md +34 -34
- package/specs/001-mcp-api-integration/contracts/openapi.yaml +635 -635
- package/specs/001-mcp-api-integration/data-model.md +106 -106
- package/specs/001-mcp-api-integration/plan.md +73 -73
- package/specs/001-mcp-api-integration/quickstart.md +74 -74
- package/specs/001-mcp-api-integration/research.md +58 -58
- package/specs/001-mcp-api-integration/spec.md +119 -119
- package/specs/001-mcp-api-integration/tasks.md +64 -64
- package/src/config.ts +36 -36
- package/src/index.ts +49 -47
- package/src/services/apiClient.ts +49 -49
- package/src/tools/accounts.ts +140 -111
- package/src/tools/categories.ts +102 -81
- package/src/tools/credit-cards.ts +184 -147
- package/src/tools/data.ts +45 -36
- package/src/tools/settings.ts +64 -51
- package/src/tools/summary.ts +29 -24
- package/src/tools/transactions.ts +157 -128
- package/src/tools/transfers.ts +122 -0
- package/src/types/schemas.ts +260 -235
- package/src/utils/toolHelpers.ts +11 -0
- package/tests/benchmark.test.d.ts +1 -1
- package/tests/benchmark.test.js +32 -32
- package/tests/benchmark.test.ts +38 -38
- package/tests/server.test.d.ts +1 -1
- package/tests/server.test.js +12 -12
- package/tests/server.test.ts +14 -14
- package/tests/setup.d.ts +3 -3
- package/tests/setup.js +16 -16
- package/tests/setup.ts +20 -20
- package/tests/tools/accounts.test.ts +159 -118
- package/tests/tools/categories.test.d.ts +1 -1
- package/tests/tools/categories.test.js +62 -62
- package/tests/tools/categories.test.ts +120 -78
- package/tests/tools/credit-cards.test.d.ts +1 -1
- package/tests/tools/credit-cards.test.js +70 -70
- package/tests/tools/credit-cards.test.ts +131 -89
- package/tests/tools/data.test.ts +100 -0
- package/tests/tools/settings.test.ts +116 -0
- package/tests/tools/summary.test.d.ts +1 -1
- package/tests/tools/summary.test.js +35 -35
- package/tests/tools/summary.test.ts +63 -42
- package/tests/tools/transactions.test.d.ts +1 -1
- package/tests/tools/transactions.test.js +66 -66
- package/tests/tools/transactions.test.ts +133 -82
- package/tests/tools/transfers.test.ts +141 -0
- package/tsconfig.json +52 -52
- package/vitest.config.d.ts +2 -2
- package/vitest.config.js +13 -13
- package/vitest.config.ts +14 -14
package/CLAUDE.md
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Commands
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm run build # Compile TypeScript → dist/
|
|
9
|
-
npm run dev # Run with tsx (no build required)
|
|
10
|
-
npm start # Run compiled dist/index.js
|
|
11
|
-
npm test # Run all tests with vitest
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Run a single test file:
|
|
15
|
-
```bash
|
|
16
|
-
npx vitest run tests/tools/categories.test.ts
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Inspect the MCP server interactively (requires a build first):
|
|
20
|
-
```bash
|
|
21
|
-
npx @modelcontextprotocol/inspector node dist/index.js
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Environment
|
|
25
|
-
|
|
26
|
-
Create `.env` in the project root:
|
|
27
|
-
```
|
|
28
|
-
QUANTIX_API_URL=https://api.quantix.example.com
|
|
29
|
-
QUANTIX_API_KEY=your_api_key_here
|
|
30
|
-
MCPPORT=3001
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
`QUANTIX_API_KEY` is required. `QUANTIX_API_URL` defaults to `https://api.quantix.example.com`.
|
|
34
|
-
|
|
35
|
-
## Architecture
|
|
36
|
-
|
|
37
|
-
This is an MCP server that proxies Quantix Personal Finance API endpoints as MCP tools. It runs in **stdio mode** (for Claude Desktop / `npx quantix-mcp`).
|
|
38
|
-
|
|
39
|
-
**Data flow:** MCP client → `src/index.ts` (McpServer + StdioTransport) → tool handler → `src/services/apiClient.ts` → Quantix REST API
|
|
40
|
-
|
|
41
|
-
### Key files
|
|
42
|
-
|
|
43
|
-
| File | Role |
|
|
44
|
-
|------|------|
|
|
45
|
-
| `src/index.ts` | Creates `McpServer`, registers all tool groups, connects via `StdioServerTransport` |
|
|
46
|
-
| `src/config.ts` | Zod-validated env vars; exports `config` object |
|
|
47
|
-
| `src/services/apiClient.ts` | Thin `fetch` wrapper; injects `x-api-key` header; exports `apiClient.get/post/patch/put/delete` |
|
|
48
|
-
| `src/types/schemas.ts` | All Zod schemas — both domain entity schemas and tool input schemas |
|
|
49
|
-
| `src/tools/*.ts` | Each file exports a `register*Tools(server: McpServer)` function |
|
|
50
|
-
| `tests/setup.ts` | Vitest setup — mocks `global.fetch` and mocks `config` module |
|
|
51
|
-
|
|
52
|
-
### Adding a new tool group
|
|
53
|
-
|
|
54
|
-
1. Create `src/tools/mymodule.ts` exporting `registerMyModuleTools(server: McpServer)`.
|
|
55
|
-
2. Define input schemas in `src/types/schemas.ts`.
|
|
56
|
-
3. Import and call `registerMyModuleTools(mcpServer)` in `src/index.ts`.
|
|
57
|
-
4. Add a test file at `tests/tools/mymodule.test.ts` — mock `apiClient` (not `fetch`), create a mock server to capture registered handlers, then call handlers directly.
|
|
58
|
-
|
|
59
|
-
### Conventions
|
|
60
|
-
|
|
61
|
-
- All imports use `.js` extension (ESM `nodenext` module resolution), even for `.ts` source files.
|
|
62
|
-
- Tool handlers return `{ content: [{ type: 'text', text: '...' }] }`.
|
|
63
|
-
- The `mode` query param (`SINGLE` | `PENDING` | `ALL`) on transaction update/delete controls scope for recurring transactions.
|
|
64
|
-
- `ApiClientError` (from `apiClient.ts`) is thrown on non-2xx responses and includes `status` and `statusText`.
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run build # Compile TypeScript → dist/
|
|
9
|
+
npm run dev # Run with tsx (no build required)
|
|
10
|
+
npm start # Run compiled dist/index.js
|
|
11
|
+
npm test # Run all tests with vitest
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Run a single test file:
|
|
15
|
+
```bash
|
|
16
|
+
npx vitest run tests/tools/categories.test.ts
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Inspect the MCP server interactively (requires a build first):
|
|
20
|
+
```bash
|
|
21
|
+
npx @modelcontextprotocol/inspector node dist/index.js
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Environment
|
|
25
|
+
|
|
26
|
+
Create `.env` in the project root:
|
|
27
|
+
```
|
|
28
|
+
QUANTIX_API_URL=https://api.quantix.example.com
|
|
29
|
+
QUANTIX_API_KEY=your_api_key_here
|
|
30
|
+
MCPPORT=3001
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`QUANTIX_API_KEY` is required. `QUANTIX_API_URL` defaults to `https://api.quantix.example.com`.
|
|
34
|
+
|
|
35
|
+
## Architecture
|
|
36
|
+
|
|
37
|
+
This is an MCP server that proxies Quantix Personal Finance API endpoints as MCP tools. It runs in **stdio mode** (for Claude Desktop / `npx quantix-mcp`).
|
|
38
|
+
|
|
39
|
+
**Data flow:** MCP client → `src/index.ts` (McpServer + StdioTransport) → tool handler → `src/services/apiClient.ts` → Quantix REST API
|
|
40
|
+
|
|
41
|
+
### Key files
|
|
42
|
+
|
|
43
|
+
| File | Role |
|
|
44
|
+
|------|------|
|
|
45
|
+
| `src/index.ts` | Creates `McpServer`, registers all tool groups, connects via `StdioServerTransport` |
|
|
46
|
+
| `src/config.ts` | Zod-validated env vars; exports `config` object |
|
|
47
|
+
| `src/services/apiClient.ts` | Thin `fetch` wrapper; injects `x-api-key` header; exports `apiClient.get/post/patch/put/delete` |
|
|
48
|
+
| `src/types/schemas.ts` | All Zod schemas — both domain entity schemas and tool input schemas |
|
|
49
|
+
| `src/tools/*.ts` | Each file exports a `register*Tools(server: McpServer)` function |
|
|
50
|
+
| `tests/setup.ts` | Vitest setup — mocks `global.fetch` and mocks `config` module |
|
|
51
|
+
|
|
52
|
+
### Adding a new tool group
|
|
53
|
+
|
|
54
|
+
1. Create `src/tools/mymodule.ts` exporting `registerMyModuleTools(server: McpServer)`.
|
|
55
|
+
2. Define input schemas in `src/types/schemas.ts`.
|
|
56
|
+
3. Import and call `registerMyModuleTools(mcpServer)` in `src/index.ts`.
|
|
57
|
+
4. Add a test file at `tests/tools/mymodule.test.ts` — mock `apiClient` (not `fetch`), create a mock server to capture registered handlers, then call handlers directly.
|
|
58
|
+
|
|
59
|
+
### Conventions
|
|
60
|
+
|
|
61
|
+
- All imports use `.js` extension (ESM `nodenext` module resolution), even for `.ts` source files.
|
|
62
|
+
- Tool handlers return `{ content: [{ type: 'text', text: '...' }] }`.
|
|
63
|
+
- The `mode` query param (`SINGLE` | `PENDING` | `ALL`) on transaction update/delete controls scope for recurring transactions.
|
|
64
|
+
- `ApiClientError` (from `apiClient.ts`) is thrown on non-2xx responses and includes `status` and `statusText`.
|
package/README.md
CHANGED
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
|
|
2
|
-
# Quantix Personal Finance MCP Server
|
|
3
|
-
|
|
4
|
-
MCP (Model Context Protocol) server for the Quantix Personal Finance API. Exposes all endpoints as MCP tools with full input validation and modular architecture.
|
|
5
|
-
|
|
6
|
-
## Features
|
|
7
|
-
|
|
8
|
-
- **Accounts**: Manage bank accounts, wallets, savings, and investments.
|
|
9
|
-
- **Categories**: Create, list, update, and delete financial categories (INCOME/EXPENSE).
|
|
10
|
-
- **Credit Cards**: Manage cards, view/pay statements, and track statement status.
|
|
11
|
-
- **Transactions**: Full CRUD with filters (month, date range, account, category, card, type, paid status), recurring payments, and installment handling.
|
|
12
|
-
- **Transactions (paid status)**: Mark transactions as paid or unpaid.
|
|
13
|
-
- **Settings**: Manage global user preferences (name, currency, language).
|
|
14
|
-
- **Summary**: Financial summary by month or custom date range — income, expenses, balance, credit card totals, and category breakdowns.
|
|
15
|
-
- **Data**: Export and import a full backup of all user data.
|
|
16
|
-
|
|
17
|
-
All tool inputs are validated using [Zod](https://zod.dev/) schemas matching the OpenAPI spec.
|
|
18
|
-
|
|
19
|
-
## Prerequisites
|
|
20
|
-
|
|
21
|
-
- Node.js (v18 or higher)
|
|
22
|
-
- npm
|
|
23
|
-
- Access to Quantix API and API Key
|
|
24
|
-
|
|
25
|
-
## Installation
|
|
26
|
-
|
|
27
|
-
1. Clone or navigate to the project repository.
|
|
28
|
-
2. Install dependencies:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm install
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Configuration
|
|
35
|
-
|
|
36
|
-
Create a `.env` file in the project root:
|
|
37
|
-
|
|
38
|
-
```env
|
|
39
|
-
QUANTIX_API_URL=https://api.quantix.example.com
|
|
40
|
-
QUANTIX_API_KEY=your_api_key_here
|
|
41
|
-
MCPPORT=3001
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Building the Project
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npm run build
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
The compiled output will be in the `dist` directory.
|
|
51
|
-
|
|
52
|
-
## Usage
|
|
53
|
-
|
|
54
|
-
### Quick Start (npx)
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
npx quantix-mcp
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Make sure the environment variables (`QUANTIX_API_URL`, `QUANTIX_API_KEY`) are set in your environment.
|
|
61
|
-
|
|
62
|
-
### Development
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
npm run dev
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Production
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
npm start
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### MCP Inspector (Recommended for Testing)
|
|
75
|
-
|
|
76
|
-
1. Build the project:
|
|
77
|
-
```bash
|
|
78
|
-
npm run build
|
|
79
|
-
```
|
|
80
|
-
2. Run the inspector:
|
|
81
|
-
```bash
|
|
82
|
-
npx @modelcontextprotocol/inspector node dist/index.js
|
|
83
|
-
```
|
|
84
|
-
3. Open the provided URL to interact with your server.
|
|
85
|
-
|
|
86
|
-
## Exposed MCP Tools
|
|
87
|
-
|
|
88
|
-
| Category | Tool Name | Description |
|
|
89
|
-
|----------|-----------|-------------|
|
|
90
|
-
| **Accounts** | `create_account` | Create a new financial account |
|
|
91
|
-
| | `get_accounts` | List all accounts with current balances |
|
|
92
|
-
| | `get_account` | Get details of a specific account |
|
|
93
|
-
| | `update_account` | Update account name or type |
|
|
94
|
-
| | `delete_account` | Delete an account |
|
|
95
|
-
| | `get_account_balance` | Get current balance for an account |
|
|
96
|
-
| | `get_account_transactions` | List all transactions linked to an account |
|
|
97
|
-
| **Categories** | `create_category` | Create a new financial category (INCOME/EXPENSE) |
|
|
98
|
-
| | `get_categories` | List all categories |
|
|
99
|
-
| | `get_category` | Get a category by ID |
|
|
100
|
-
| | `update_category` | Update category name or color |
|
|
101
|
-
| | `delete_category` | Delete a category |
|
|
102
|
-
| **Credit Cards** | `create_credit_card` | Create a new credit card |
|
|
103
|
-
| | `get_credit_cards` | List all credit cards |
|
|
104
|
-
| | `get_credit_card` | Get a credit card by ID |
|
|
105
|
-
| | `update_credit_card` | Update credit card details |
|
|
106
|
-
| | `delete_credit_card` | Delete a credit card |
|
|
107
|
-
| | `get_statement` | Get statement for a specific month (`YYYY-MM`) |
|
|
108
|
-
| | `get_statement_status` | Get payment status of a statement |
|
|
109
|
-
| | `pay_statement` | Mark all statement transactions as paid |
|
|
110
|
-
| **Transactions** | `create_transaction` | Record a new income or expense |
|
|
111
|
-
| | `get_transactions` | List transactions — filters: `month`, `startDate`, `endDate`, `accountId`, `categoryId`, `creditCardId`, `type`, `paid` |
|
|
112
|
-
| | `get_transaction` | Get transaction details by ID |
|
|
113
|
-
| | `update_transaction` | Update a transaction (supports `mode`: SINGLE / PENDING / ALL for recurring/installments) |
|
|
114
|
-
| | `pay_transaction` | Mark a transaction as paid/received |
|
|
115
|
-
| | `unpay_transaction` | Mark a transaction as unpaid |
|
|
116
|
-
| | `delete_transaction` | Delete a transaction (supports `mode`: SINGLE / PENDING / ALL) |
|
|
117
|
-
| **Settings** | `create_settings` | Create global user settings (only if not yet created) |
|
|
118
|
-
| | `get_settings` | Get global settings |
|
|
119
|
-
| | `update_settings` | Update global settings |
|
|
120
|
-
| **Summary** | `get_summary` | Financial summary — provide `month` (YYYY-MM) **or** `startDate` + `endDate` (YYYY-MM-DD) |
|
|
121
|
-
| **Data** | `export_data` | Export all user data as a complete backup |
|
|
122
|
-
| | `import_data` | Import a backup (`mode`: `reset` clears all data first, `increment` skips existing IDs) |
|
|
123
|
-
|
|
124
|
-
See `openapi.yaml` at the project root for full endpoint and schema details.
|
|
125
|
-
|
|
126
|
-
## Setup with Claude Desktop
|
|
127
|
-
|
|
128
|
-
1. Locate your Claude Desktop configuration file:
|
|
129
|
-
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
130
|
-
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
131
|
-
|
|
132
|
-
2. Add the server configuration:
|
|
133
|
-
|
|
134
|
-
**Using npx (Recommended):**
|
|
135
|
-
|
|
136
|
-
```json
|
|
137
|
-
{
|
|
138
|
-
"mcpServers": {
|
|
139
|
-
"quantix": {
|
|
140
|
-
"command": "npx",
|
|
141
|
-
"args": ["-y", "quantix-mcp"],
|
|
142
|
-
"env": {
|
|
143
|
-
"QUANTIX_API_URL": "https://api.quantix.example.com",
|
|
144
|
-
"QUANTIX_API_KEY": "your_api_key_here"
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
**Using local build (For developers):**
|
|
152
|
-
|
|
153
|
-
```json
|
|
154
|
-
{
|
|
155
|
-
"mcpServers": {
|
|
156
|
-
"quantix": {
|
|
157
|
-
"command": "node",
|
|
158
|
-
"args": ["/absolute/path/to/dist/index.js"],
|
|
159
|
-
"env": {
|
|
160
|
-
"QUANTIX_API_URL": "https://api.quantix.example.com",
|
|
161
|
-
"QUANTIX_API_KEY": "your_api_key_here"
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Testing
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
npm test
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## License
|
|
175
|
-
|
|
176
|
-
ISC
|
|
1
|
+
|
|
2
|
+
# Quantix Personal Finance MCP Server
|
|
3
|
+
|
|
4
|
+
MCP (Model Context Protocol) server for the Quantix Personal Finance API. Exposes all endpoints as MCP tools with full input validation and modular architecture.
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
|
|
8
|
+
- **Accounts**: Manage bank accounts, wallets, savings, and investments.
|
|
9
|
+
- **Categories**: Create, list, update, and delete financial categories (INCOME/EXPENSE).
|
|
10
|
+
- **Credit Cards**: Manage cards, view/pay statements, and track statement status.
|
|
11
|
+
- **Transactions**: Full CRUD with filters (month, date range, account, category, card, type, paid status), recurring payments, and installment handling.
|
|
12
|
+
- **Transactions (paid status)**: Mark transactions as paid or unpaid.
|
|
13
|
+
- **Settings**: Manage global user preferences (name, currency, language).
|
|
14
|
+
- **Summary**: Financial summary by month or custom date range — income, expenses, balance, credit card totals, and category breakdowns.
|
|
15
|
+
- **Data**: Export and import a full backup of all user data.
|
|
16
|
+
|
|
17
|
+
All tool inputs are validated using [Zod](https://zod.dev/) schemas matching the OpenAPI spec.
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
- Node.js (v18 or higher)
|
|
22
|
+
- npm
|
|
23
|
+
- Access to Quantix API and API Key
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
1. Clone or navigate to the project repository.
|
|
28
|
+
2. Install dependencies:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Configuration
|
|
35
|
+
|
|
36
|
+
Create a `.env` file in the project root:
|
|
37
|
+
|
|
38
|
+
```env
|
|
39
|
+
QUANTIX_API_URL=https://api.quantix.example.com
|
|
40
|
+
QUANTIX_API_KEY=your_api_key_here
|
|
41
|
+
MCPPORT=3001
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Building the Project
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm run build
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The compiled output will be in the `dist` directory.
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
### Quick Start (npx)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx quantix-mcp
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Make sure the environment variables (`QUANTIX_API_URL`, `QUANTIX_API_KEY`) are set in your environment.
|
|
61
|
+
|
|
62
|
+
### Development
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm run dev
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Production
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm start
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### MCP Inspector (Recommended for Testing)
|
|
75
|
+
|
|
76
|
+
1. Build the project:
|
|
77
|
+
```bash
|
|
78
|
+
npm run build
|
|
79
|
+
```
|
|
80
|
+
2. Run the inspector:
|
|
81
|
+
```bash
|
|
82
|
+
npx @modelcontextprotocol/inspector node dist/index.js
|
|
83
|
+
```
|
|
84
|
+
3. Open the provided URL to interact with your server.
|
|
85
|
+
|
|
86
|
+
## Exposed MCP Tools
|
|
87
|
+
|
|
88
|
+
| Category | Tool Name | Description |
|
|
89
|
+
|----------|-----------|-------------|
|
|
90
|
+
| **Accounts** | `create_account` | Create a new financial account |
|
|
91
|
+
| | `get_accounts` | List all accounts with current balances |
|
|
92
|
+
| | `get_account` | Get details of a specific account |
|
|
93
|
+
| | `update_account` | Update account name or type |
|
|
94
|
+
| | `delete_account` | Delete an account |
|
|
95
|
+
| | `get_account_balance` | Get current balance for an account |
|
|
96
|
+
| | `get_account_transactions` | List all transactions linked to an account |
|
|
97
|
+
| **Categories** | `create_category` | Create a new financial category (INCOME/EXPENSE) |
|
|
98
|
+
| | `get_categories` | List all categories |
|
|
99
|
+
| | `get_category` | Get a category by ID |
|
|
100
|
+
| | `update_category` | Update category name or color |
|
|
101
|
+
| | `delete_category` | Delete a category |
|
|
102
|
+
| **Credit Cards** | `create_credit_card` | Create a new credit card |
|
|
103
|
+
| | `get_credit_cards` | List all credit cards |
|
|
104
|
+
| | `get_credit_card` | Get a credit card by ID |
|
|
105
|
+
| | `update_credit_card` | Update credit card details |
|
|
106
|
+
| | `delete_credit_card` | Delete a credit card |
|
|
107
|
+
| | `get_statement` | Get statement for a specific month (`YYYY-MM`) |
|
|
108
|
+
| | `get_statement_status` | Get payment status of a statement |
|
|
109
|
+
| | `pay_statement` | Mark all statement transactions as paid |
|
|
110
|
+
| **Transactions** | `create_transaction` | Record a new income or expense |
|
|
111
|
+
| | `get_transactions` | List transactions — filters: `month`, `startDate`, `endDate`, `accountId`, `categoryId`, `creditCardId`, `type`, `paid` |
|
|
112
|
+
| | `get_transaction` | Get transaction details by ID |
|
|
113
|
+
| | `update_transaction` | Update a transaction (supports `mode`: SINGLE / PENDING / ALL for recurring/installments) |
|
|
114
|
+
| | `pay_transaction` | Mark a transaction as paid/received |
|
|
115
|
+
| | `unpay_transaction` | Mark a transaction as unpaid |
|
|
116
|
+
| | `delete_transaction` | Delete a transaction (supports `mode`: SINGLE / PENDING / ALL) |
|
|
117
|
+
| **Settings** | `create_settings` | Create global user settings (only if not yet created) |
|
|
118
|
+
| | `get_settings` | Get global settings |
|
|
119
|
+
| | `update_settings` | Update global settings |
|
|
120
|
+
| **Summary** | `get_summary` | Financial summary — provide `month` (YYYY-MM) **or** `startDate` + `endDate` (YYYY-MM-DD) |
|
|
121
|
+
| **Data** | `export_data` | Export all user data as a complete backup |
|
|
122
|
+
| | `import_data` | Import a backup (`mode`: `reset` clears all data first, `increment` skips existing IDs) |
|
|
123
|
+
|
|
124
|
+
See `openapi.yaml` at the project root for full endpoint and schema details.
|
|
125
|
+
|
|
126
|
+
## Setup with Claude Desktop
|
|
127
|
+
|
|
128
|
+
1. Locate your Claude Desktop configuration file:
|
|
129
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
130
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
131
|
+
|
|
132
|
+
2. Add the server configuration:
|
|
133
|
+
|
|
134
|
+
**Using npx (Recommended):**
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"mcpServers": {
|
|
139
|
+
"quantix": {
|
|
140
|
+
"command": "npx",
|
|
141
|
+
"args": ["-y", "quantix-mcp"],
|
|
142
|
+
"env": {
|
|
143
|
+
"QUANTIX_API_URL": "https://api.quantix.example.com",
|
|
144
|
+
"QUANTIX_API_KEY": "your_api_key_here"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Using local build (For developers):**
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"mcpServers": {
|
|
156
|
+
"quantix": {
|
|
157
|
+
"command": "node",
|
|
158
|
+
"args": ["/absolute/path/to/dist/index.js"],
|
|
159
|
+
"env": {
|
|
160
|
+
"QUANTIX_API_URL": "https://api.quantix.example.com",
|
|
161
|
+
"QUANTIX_API_KEY": "your_api_key_here"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Testing
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
npm test
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
ISC
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAepE,wBAAgB,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAepE,wBAAgB,SAAS,cAoBxB"}
|
package/dist/index.js
CHANGED
|
@@ -11,13 +11,14 @@ import { registerTransactionTools } from './tools/transactions.js';
|
|
|
11
11
|
import { registerSummaryTools } from './tools/summary.js';
|
|
12
12
|
import { registerAccountTools } from './tools/accounts.js';
|
|
13
13
|
import { registerSettingsTools } from './tools/settings.js';
|
|
14
|
-
import {
|
|
14
|
+
import { registerTransferTools } from './tools/transfers.js';
|
|
15
15
|
export function getServer() {
|
|
16
16
|
const mcpServer = new McpServer({
|
|
17
17
|
name: 'quantix_mcp_server',
|
|
18
|
-
version: '
|
|
18
|
+
version: '0.3.6',
|
|
19
|
+
description: 'MCP server for Quantix personal finance management',
|
|
19
20
|
});
|
|
20
|
-
console.log('
|
|
21
|
+
console.log('Quantix MCP server started');
|
|
21
22
|
// Register Tools here
|
|
22
23
|
registerCategoryTools(mcpServer);
|
|
23
24
|
registerCreditCardTools(mcpServer);
|
|
@@ -25,14 +26,14 @@ export function getServer() {
|
|
|
25
26
|
registerSummaryTools(mcpServer);
|
|
26
27
|
registerAccountTools(mcpServer);
|
|
27
28
|
registerSettingsTools(mcpServer);
|
|
28
|
-
|
|
29
|
+
registerTransferTools(mcpServer);
|
|
29
30
|
return mcpServer;
|
|
30
31
|
}
|
|
31
32
|
async function main() {
|
|
32
33
|
const transport = new StdioServerTransport();
|
|
33
34
|
const mcpServer = getServer();
|
|
34
35
|
await mcpServer.connect(transport);
|
|
35
|
-
console.log('MCP server is running...');
|
|
36
|
+
console.log('Quantix MCP server is running...');
|
|
36
37
|
}
|
|
37
38
|
main().catch(error => {
|
|
38
39
|
console.error('Server error:', error);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,OAAO,EAAE,EAA+B,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,OAAO,EAAE,EAA+B,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,UAAU,SAAS;IACrB,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC;QAC5B,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,oDAAoD;KACpE,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAE1C,sBAAsB;IACtB,qBAAqB,CAAC,SAAS,CAAC,CAAC;IACjC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACnC,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACpC,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAChC,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAChC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAEjC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAEjC,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,KAAK,UAAU,IAAI;IACf,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;IAC9B,MAAM,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;AACpD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QAqIrD"}
|