quantix-mcp 0.4.9 → 0.5.3
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 +12 -1
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/dist/tools/subscriptions.d.ts.map +1 -1
- package/dist/tools/subscriptions.js +46 -1
- package/dist/tools/subscriptions.js.map +1 -1
- package/dist/tools/transactions.d.ts.map +1 -1
- package/dist/tools/transactions.js +5 -5
- package/dist/tools/transactions.js.map +1 -1
- package/dist/types/schemas.d.ts +17 -0
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +21 -4
- package/dist/types/schemas.js.map +1 -1
- package/package.json +9 -4
- package/.claude/commands/opsx/apply.md +0 -152
- package/.claude/commands/opsx/archive.md +0 -157
- package/.claude/commands/opsx/bulk-archive.md +0 -242
- package/.claude/commands/opsx/continue.md +0 -114
- package/.claude/commands/opsx/explore.md +0 -174
- package/.claude/commands/opsx/ff.md +0 -94
- package/.claude/commands/opsx/new.md +0 -69
- package/.claude/commands/opsx/onboard.md +0 -525
- package/.claude/commands/opsx/sync.md +0 -134
- package/.claude/commands/opsx/verify.md +0 -164
- package/.claude/settings.local.json +0 -9
- package/.claude/skills/openspec-apply-change/SKILL.md +0 -156
- package/.claude/skills/openspec-archive-change/SKILL.md +0 -114
- package/.claude/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.claude/skills/openspec-continue-change/SKILL.md +0 -118
- package/.claude/skills/openspec-explore/SKILL.md +0 -290
- package/.claude/skills/openspec-ff-change/SKILL.md +0 -101
- package/.claude/skills/openspec-new-change/SKILL.md +0 -74
- package/.claude/skills/openspec-onboard/SKILL.md +0 -529
- package/.claude/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.claude/skills/openspec-verify-change/SKILL.md +0 -168
- package/.dockerignore +0 -8
- package/.gemini/commands/opsx/apply.toml +0 -149
- package/.gemini/commands/opsx/archive.toml +0 -154
- package/.gemini/commands/opsx/bulk-archive.toml +0 -239
- package/.gemini/commands/opsx/continue.toml +0 -111
- package/.gemini/commands/opsx/explore.toml +0 -171
- package/.gemini/commands/opsx/ff.toml +0 -91
- package/.gemini/commands/opsx/new.toml +0 -66
- package/.gemini/commands/opsx/onboard.toml +0 -522
- package/.gemini/commands/opsx/sync.toml +0 -131
- package/.gemini/commands/opsx/verify.toml +0 -161
- package/.gemini/skills/openspec-apply-change/SKILL.md +0 -156
- package/.gemini/skills/openspec-archive-change/SKILL.md +0 -114
- package/.gemini/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.gemini/skills/openspec-continue-change/SKILL.md +0 -118
- package/.gemini/skills/openspec-explore/SKILL.md +0 -290
- package/.gemini/skills/openspec-ff-change/SKILL.md +0 -101
- package/.gemini/skills/openspec-new-change/SKILL.md +0 -74
- package/.gemini/skills/openspec-onboard/SKILL.md +0 -529
- package/.gemini/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.gemini/skills/openspec-verify-change/SKILL.md +0 -168
- package/.github/agents/copilot-instructions.md +0 -32
- package/.github/agents/speckit.analyze.agent.md +0 -184
- package/.github/agents/speckit.checklist.agent.md +0 -294
- package/.github/agents/speckit.clarify.agent.md +0 -181
- package/.github/agents/speckit.constitution.agent.md +0 -82
- package/.github/agents/speckit.implement.agent.md +0 -135
- package/.github/agents/speckit.plan.agent.md +0 -89
- package/.github/agents/speckit.specify.agent.md +0 -258
- package/.github/agents/speckit.tasks.agent.md +0 -137
- package/.github/agents/speckit.taskstoissues.agent.md +0 -30
- package/.github/copilot-instructions.md +0 -17
- package/.github/prompts/speckit.analyze.prompt.md +0 -3
- package/.github/prompts/speckit.checklist.prompt.md +0 -3
- package/.github/prompts/speckit.clarify.prompt.md +0 -3
- package/.github/prompts/speckit.constitution.prompt.md +0 -3
- package/.github/prompts/speckit.implement.prompt.md +0 -3
- package/.github/prompts/speckit.plan.prompt.md +0 -3
- package/.github/prompts/speckit.specify.prompt.md +0 -3
- package/.github/prompts/speckit.tasks.prompt.md +0 -3
- package/.github/prompts/speckit.taskstoissues.prompt.md +0 -3
- package/.github/workflows/publish.yaml +0 -29
- package/.opencode/command/speckit.analyze.md +0 -184
- package/.opencode/command/speckit.checklist.md +0 -294
- package/.opencode/command/speckit.clarify.md +0 -181
- package/.opencode/command/speckit.constitution.md +0 -84
- package/.opencode/command/speckit.implement.md +0 -135
- package/.opencode/command/speckit.plan.md +0 -89
- package/.opencode/command/speckit.specify.md +0 -258
- package/.opencode/command/speckit.tasks.md +0 -137
- package/.opencode/command/speckit.taskstoissues.md +0 -30
- package/.qwen/commands/opsx-apply.toml +0 -149
- package/.qwen/commands/opsx-archive.toml +0 -154
- package/.qwen/commands/opsx-bulk-archive.toml +0 -239
- package/.qwen/commands/opsx-continue.toml +0 -111
- package/.qwen/commands/opsx-explore.toml +0 -171
- package/.qwen/commands/opsx-ff.toml +0 -91
- package/.qwen/commands/opsx-new.toml +0 -66
- package/.qwen/commands/opsx-onboard.toml +0 -522
- package/.qwen/commands/opsx-sync.toml +0 -131
- package/.qwen/commands/opsx-verify.toml +0 -161
- package/.qwen/skills/openspec-apply-change/SKILL.md +0 -156
- package/.qwen/skills/openspec-archive-change/SKILL.md +0 -114
- package/.qwen/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.qwen/skills/openspec-continue-change/SKILL.md +0 -118
- package/.qwen/skills/openspec-explore/SKILL.md +0 -290
- package/.qwen/skills/openspec-ff-change/SKILL.md +0 -101
- package/.qwen/skills/openspec-new-change/SKILL.md +0 -74
- package/.qwen/skills/openspec-onboard/SKILL.md +0 -529
- package/.qwen/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.qwen/skills/openspec-verify-change/SKILL.md +0 -168
- package/.specify/memory/constitution.md +0 -58
- package/.specify/scripts/powershell/check-prerequisites.ps1 +0 -148
- package/.specify/scripts/powershell/common.ps1 +0 -137
- package/.specify/scripts/powershell/create-new-feature.ps1 +0 -283
- package/.specify/scripts/powershell/setup-plan.ps1 +0 -61
- package/.specify/scripts/powershell/update-agent-context.ps1 +0 -448
- package/.specify/templates/agent-file-template.md +0 -28
- package/.specify/templates/checklist-template.md +0 -40
- package/.specify/templates/constitution-template.md +0 -50
- package/.specify/templates/plan-template.md +0 -104
- package/.specify/templates/spec-template.md +0 -115
- package/.specify/templates/tasks-template.md +0 -251
- package/.vscode/launch.json +0 -14
- package/.vscode/settings.json +0 -14
- package/.vscode/tasks.json +0 -15
- package/AGENTS.md +0 -117
- package/CLAUDE.md +0 -70
- package/Dockerfile +0 -30
- package/GEMINI.md +0 -117
- package/QWEN.md +0 -117
- package/docker-compose.yml +0 -15
- package/openapi.yaml +0 -3127
- package/openspec/README.md +0 -33
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/design.md +0 -60
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/proposal.md +0 -25
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/credit-card-transactions/spec.md +0 -46
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/transactions/spec.md +0 -42
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/tasks.md +0 -22
- package/openspec/config.yaml +0 -20
- package/openspec/specs/accounts/spec.md +0 -86
- package/openspec/specs/categories/spec.md +0 -78
- package/openspec/specs/credit-card-transactions/spec.md +0 -64
- package/openspec/specs/credit-cards/spec.md +0 -109
- package/openspec/specs/data/spec.md +0 -49
- package/openspec/specs/settings/spec.md +0 -48
- package/openspec/specs/subscriptions/spec.md +0 -85
- package/openspec/specs/summary/spec.md +0 -49
- package/openspec/specs/transactions/spec.md +0 -113
- package/openspec/specs/transfers/spec.md +0 -74
- package/specs/001-mcp-api-integration/checklists/requirements.md +0 -34
- package/specs/001-mcp-api-integration/contracts/openapi.yaml +0 -636
- package/specs/001-mcp-api-integration/data-model.md +0 -106
- package/specs/001-mcp-api-integration/plan.md +0 -73
- package/specs/001-mcp-api-integration/quickstart.md +0 -74
- package/specs/001-mcp-api-integration/research.md +0 -58
- package/specs/001-mcp-api-integration/spec.md +0 -119
- package/specs/001-mcp-api-integration/tasks.md +0 -64
- package/src/config.ts +0 -39
- package/src/index.ts +0 -99
- package/src/services/apiClient.ts +0 -55
- package/src/services/requestContext.ts +0 -11
- package/src/tools/accounts.ts +0 -122
- package/src/tools/categories.ts +0 -102
- package/src/tools/credit-cards.ts +0 -203
- package/src/tools/data.ts +0 -45
- package/src/tools/settings.ts +0 -64
- package/src/tools/subscriptions.ts +0 -159
- package/src/tools/summary.ts +0 -29
- package/src/tools/transactions.ts +0 -200
- package/src/tools/transfers.ts +0 -122
- package/src/types/schemas.ts +0 -333
- package/src/utils/toolHelpers.ts +0 -11
- package/tests/benchmark.test.d.ts +0 -2
- package/tests/benchmark.test.d.ts.map +0 -1
- package/tests/benchmark.test.js +0 -33
- package/tests/benchmark.test.js.map +0 -1
- package/tests/benchmark.test.ts +0 -38
- package/tests/server.test.d.ts +0 -2
- package/tests/server.test.d.ts.map +0 -1
- package/tests/server.test.js +0 -13
- package/tests/server.test.js.map +0 -1
- package/tests/server.test.ts +0 -14
- package/tests/setup.d.ts +0 -4
- package/tests/setup.d.ts.map +0 -1
- package/tests/setup.js +0 -17
- package/tests/setup.js.map +0 -1
- package/tests/setup.ts +0 -20
- package/tests/tools/accounts.test.ts +0 -159
- package/tests/tools/categories.test.d.ts +0 -2
- package/tests/tools/categories.test.d.ts.map +0 -1
- package/tests/tools/categories.test.js +0 -63
- package/tests/tools/categories.test.js.map +0 -1
- package/tests/tools/categories.test.ts +0 -120
- package/tests/tools/credit-cards.test.d.ts +0 -2
- package/tests/tools/credit-cards.test.d.ts.map +0 -1
- package/tests/tools/credit-cards.test.js +0 -71
- package/tests/tools/credit-cards.test.js.map +0 -1
- package/tests/tools/credit-cards.test.ts +0 -131
- package/tests/tools/data.test.ts +0 -100
- package/tests/tools/settings.test.ts +0 -116
- package/tests/tools/subscriptions.test.ts +0 -173
- package/tests/tools/summary.test.d.ts +0 -2
- package/tests/tools/summary.test.d.ts.map +0 -1
- package/tests/tools/summary.test.js +0 -36
- package/tests/tools/summary.test.js.map +0 -1
- package/tests/tools/summary.test.ts +0 -63
- package/tests/tools/transactions.test.d.ts +0 -2
- package/tests/tools/transactions.test.d.ts.map +0 -1
- package/tests/tools/transactions.test.js +0 -67
- package/tests/tools/transactions.test.js.map +0 -1
- package/tests/tools/transactions.test.ts +0 -133
- package/tests/tools/transfers.test.ts +0 -141
- package/tsconfig.json +0 -52
- package/vitest.config.d.ts +0 -3
- package/vitest.config.d.ts.map +0 -1
- package/vitest.config.js +0 -14
- package/vitest.config.js.map +0 -1
- package/vitest.config.ts +0 -14
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
-
|
|
3
|
-
interface RequestContext {
|
|
4
|
-
apiKey: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const requestContext = new AsyncLocalStorage<RequestContext>();
|
|
8
|
-
|
|
9
|
-
export function getRequestApiKey(): string | undefined {
|
|
10
|
-
return requestContext.getStore()?.apiKey;
|
|
11
|
-
}
|
package/src/tools/accounts.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { CreateAccountInput, UpdateAccountInput } from '../types/schemas.js';
|
|
4
|
-
import { apiClient } from '../services/apiClient.js';
|
|
5
|
-
import { handleToolError } from '../utils/toolHelpers.js';
|
|
6
|
-
|
|
7
|
-
export function registerAccountTools(server: McpServer) {
|
|
8
|
-
server.registerTool(
|
|
9
|
-
'create_account',
|
|
10
|
-
{
|
|
11
|
-
title: 'Create Account',
|
|
12
|
-
description: 'Create a new financial account (BANK_ACCOUNT, WALLET, etc.)',
|
|
13
|
-
inputSchema: CreateAccountInput
|
|
14
|
-
},
|
|
15
|
-
async (args) => {
|
|
16
|
-
try {
|
|
17
|
-
const account = await apiClient.post('/accounts', args);
|
|
18
|
-
return {
|
|
19
|
-
content: [{ type: 'text', text: `Account created: ${JSON.stringify(account, null, 2)}` }]
|
|
20
|
-
};
|
|
21
|
-
} catch (error) {
|
|
22
|
-
return handleToolError(error);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
server.registerTool(
|
|
28
|
-
'get_accounts',
|
|
29
|
-
{
|
|
30
|
-
title: 'Get Accounts',
|
|
31
|
-
description: 'List all financial accounts with current balances',
|
|
32
|
-
inputSchema: z.object({})
|
|
33
|
-
},
|
|
34
|
-
async () => {
|
|
35
|
-
try {
|
|
36
|
-
const accounts = await apiClient.get('/accounts');
|
|
37
|
-
return {
|
|
38
|
-
content: [{ type: 'text', text: `Accounts: ${JSON.stringify(accounts, null, 2)}` }]
|
|
39
|
-
};
|
|
40
|
-
} catch (error) {
|
|
41
|
-
return handleToolError(error);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
server.registerTool(
|
|
47
|
-
'get_account',
|
|
48
|
-
{
|
|
49
|
-
title: 'Get Account Details',
|
|
50
|
-
description: 'Get details of a specific account by ID',
|
|
51
|
-
inputSchema: z.object({ id: z.string() })
|
|
52
|
-
},
|
|
53
|
-
async ({ id }) => {
|
|
54
|
-
try {
|
|
55
|
-
const account = await apiClient.get(`/accounts/${id}`);
|
|
56
|
-
return {
|
|
57
|
-
content: [{ type: 'text', text: `Account details: ${JSON.stringify(account, null, 2)}` }]
|
|
58
|
-
};
|
|
59
|
-
} catch (error) {
|
|
60
|
-
return handleToolError(error);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
server.registerTool(
|
|
66
|
-
'update_account',
|
|
67
|
-
{
|
|
68
|
-
title: 'Update Account',
|
|
69
|
-
description: 'Update an existing account',
|
|
70
|
-
inputSchema: UpdateAccountInput
|
|
71
|
-
},
|
|
72
|
-
async ({ id, ...data }) => {
|
|
73
|
-
try {
|
|
74
|
-
const account = await apiClient.patch(`/accounts/${id}`, data);
|
|
75
|
-
return {
|
|
76
|
-
content: [{ type: 'text', text: `Account updated: ${JSON.stringify(account, null, 2)}` }]
|
|
77
|
-
};
|
|
78
|
-
} catch (error) {
|
|
79
|
-
return handleToolError(error);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
server.registerTool(
|
|
85
|
-
'delete_account',
|
|
86
|
-
{
|
|
87
|
-
title: 'Delete Account',
|
|
88
|
-
description: 'Delete an account by ID',
|
|
89
|
-
inputSchema: z.object({ id: z.string() })
|
|
90
|
-
},
|
|
91
|
-
async ({ id }) => {
|
|
92
|
-
try {
|
|
93
|
-
await apiClient.delete(`/accounts/${id}`);
|
|
94
|
-
return {
|
|
95
|
-
content: [{ type: 'text', text: `Account deleted successfully (ID: ${id})` }]
|
|
96
|
-
};
|
|
97
|
-
} catch (error) {
|
|
98
|
-
return handleToolError(error);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
server.registerTool(
|
|
104
|
-
'get_account_balance',
|
|
105
|
-
{
|
|
106
|
-
title: 'Get Account Balance',
|
|
107
|
-
description: 'Get the current balance for a specific account',
|
|
108
|
-
inputSchema: z.object({ id: z.string() })
|
|
109
|
-
},
|
|
110
|
-
async ({ id }) => {
|
|
111
|
-
try {
|
|
112
|
-
const balance = await apiClient.get(`/accounts/${id}/balance`);
|
|
113
|
-
return {
|
|
114
|
-
content: [{ type: 'text', text: `Account balance: ${JSON.stringify(balance, null, 2)}` }]
|
|
115
|
-
};
|
|
116
|
-
} catch (error) {
|
|
117
|
-
return handleToolError(error);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
}
|
package/src/tools/categories.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { CreateCategoryInput, UpdateCategoryInput } from '../types/schemas.js';
|
|
4
|
-
import { apiClient } from '../services/apiClient.js';
|
|
5
|
-
import { handleToolError } from '../utils/toolHelpers.js';
|
|
6
|
-
|
|
7
|
-
export function registerCategoryTools(server: McpServer) {
|
|
8
|
-
server.registerTool(
|
|
9
|
-
'create_category',
|
|
10
|
-
{
|
|
11
|
-
title: 'Create Category',
|
|
12
|
-
description: 'Create a new financial category (INCOME or EXPENSE)',
|
|
13
|
-
inputSchema: CreateCategoryInput
|
|
14
|
-
},
|
|
15
|
-
async (args) => {
|
|
16
|
-
try {
|
|
17
|
-
const category = await apiClient.post('/categories', args);
|
|
18
|
-
return {
|
|
19
|
-
content: [{ type: 'text', text: `Category created: ${JSON.stringify(category, null, 2)}` }]
|
|
20
|
-
};
|
|
21
|
-
} catch (error) {
|
|
22
|
-
return handleToolError(error);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
server.registerTool(
|
|
28
|
-
'get_categories',
|
|
29
|
-
{
|
|
30
|
-
title: 'Get Categories',
|
|
31
|
-
description: 'List all financial categories',
|
|
32
|
-
inputSchema: z.object({})
|
|
33
|
-
},
|
|
34
|
-
async () => {
|
|
35
|
-
try {
|
|
36
|
-
const categories = await apiClient.get('/categories');
|
|
37
|
-
return {
|
|
38
|
-
content: [{ type: 'text', text: `Categories: ${JSON.stringify(categories, null, 2)}` }]
|
|
39
|
-
};
|
|
40
|
-
} catch (error) {
|
|
41
|
-
return handleToolError(error);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
server.registerTool(
|
|
47
|
-
'get_category',
|
|
48
|
-
{
|
|
49
|
-
title: 'Get Category',
|
|
50
|
-
description: 'Get a category by ID',
|
|
51
|
-
inputSchema: z.object({ id: z.string() })
|
|
52
|
-
},
|
|
53
|
-
async ({ id }) => {
|
|
54
|
-
try {
|
|
55
|
-
const category = await apiClient.get(`/categories/${id}`);
|
|
56
|
-
return {
|
|
57
|
-
content: [{ type: 'text', text: `Category: ${JSON.stringify(category, null, 2)}` }]
|
|
58
|
-
};
|
|
59
|
-
} catch (error) {
|
|
60
|
-
return handleToolError(error);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
server.registerTool(
|
|
66
|
-
'update_category',
|
|
67
|
-
{
|
|
68
|
-
title: 'Update Category',
|
|
69
|
-
description: 'Update a category',
|
|
70
|
-
inputSchema: UpdateCategoryInput
|
|
71
|
-
},
|
|
72
|
-
async ({ id, ...data }) => {
|
|
73
|
-
try {
|
|
74
|
-
const category = await apiClient.patch(`/categories/${id}`, data);
|
|
75
|
-
return {
|
|
76
|
-
content: [{ type: 'text', text: `Category updated: ${JSON.stringify(category, null, 2)}` }]
|
|
77
|
-
};
|
|
78
|
-
} catch (error) {
|
|
79
|
-
return handleToolError(error);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
server.registerTool(
|
|
85
|
-
'delete_category',
|
|
86
|
-
{
|
|
87
|
-
title: 'Delete Category',
|
|
88
|
-
description: 'Delete a category by ID',
|
|
89
|
-
inputSchema: z.object({ id: z.string() })
|
|
90
|
-
},
|
|
91
|
-
async ({ id }) => {
|
|
92
|
-
try {
|
|
93
|
-
await apiClient.delete(`/categories/${id}`);
|
|
94
|
-
return {
|
|
95
|
-
content: [{ type: 'text', text: `Category deleted successfully (ID: ${id})` }]
|
|
96
|
-
};
|
|
97
|
-
} catch (error) {
|
|
98
|
-
return handleToolError(error);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
}
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { CreateCreditCardInput, UpdateCreditCardInput, PayStatementInput, ReopenStatementInput, CreateAnticipationInput } from '../types/schemas.js';
|
|
4
|
-
import { apiClient } from '../services/apiClient.js';
|
|
5
|
-
import { handleToolError } from '../utils/toolHelpers.js';
|
|
6
|
-
|
|
7
|
-
export function registerCreditCardTools(server: McpServer) {
|
|
8
|
-
server.registerTool(
|
|
9
|
-
'create_credit_card',
|
|
10
|
-
{
|
|
11
|
-
title: 'Create Credit Card',
|
|
12
|
-
description: 'Create a new credit card account',
|
|
13
|
-
inputSchema: CreateCreditCardInput
|
|
14
|
-
},
|
|
15
|
-
async (args) => {
|
|
16
|
-
try {
|
|
17
|
-
const card = await apiClient.post('/credit-cards', args);
|
|
18
|
-
return {
|
|
19
|
-
content: [{ type: 'text', text: `Credit Card created: ${JSON.stringify(card, null, 2)}` }]
|
|
20
|
-
};
|
|
21
|
-
} catch (error) {
|
|
22
|
-
return handleToolError(error);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
server.registerTool(
|
|
28
|
-
'get_credit_cards',
|
|
29
|
-
{
|
|
30
|
-
title: 'Get Credit Cards',
|
|
31
|
-
description: 'List all credit cards',
|
|
32
|
-
inputSchema: z.object({})
|
|
33
|
-
},
|
|
34
|
-
async () => {
|
|
35
|
-
try {
|
|
36
|
-
const cards = await apiClient.get('/credit-cards');
|
|
37
|
-
return {
|
|
38
|
-
content: [{ type: 'text', text: `Credit Cards: ${JSON.stringify(cards, null, 2)}` }]
|
|
39
|
-
};
|
|
40
|
-
} catch (error) {
|
|
41
|
-
return handleToolError(error);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
server.registerTool(
|
|
47
|
-
'get_credit_card',
|
|
48
|
-
{
|
|
49
|
-
title: 'Get Credit Card',
|
|
50
|
-
description: 'Get a credit card by ID',
|
|
51
|
-
inputSchema: z.object({ id: z.string() })
|
|
52
|
-
},
|
|
53
|
-
async ({ id }) => {
|
|
54
|
-
try {
|
|
55
|
-
const card = await apiClient.get(`/credit-cards/${id}`);
|
|
56
|
-
return {
|
|
57
|
-
content: [{ type: 'text', text: `Credit Card: ${JSON.stringify(card, null, 2)}` }]
|
|
58
|
-
};
|
|
59
|
-
} catch (error) {
|
|
60
|
-
return handleToolError(error);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
server.registerTool(
|
|
66
|
-
'update_credit_card',
|
|
67
|
-
{
|
|
68
|
-
title: 'Update Credit Card',
|
|
69
|
-
description: 'Update a credit card',
|
|
70
|
-
inputSchema: UpdateCreditCardInput
|
|
71
|
-
},
|
|
72
|
-
async ({ id, ...data }) => {
|
|
73
|
-
try {
|
|
74
|
-
const card = await apiClient.patch(`/credit-cards/${id}`, data);
|
|
75
|
-
return {
|
|
76
|
-
content: [{ type: 'text', text: `Credit Card updated: ${JSON.stringify(card, null, 2)}` }]
|
|
77
|
-
};
|
|
78
|
-
} catch (error) {
|
|
79
|
-
return handleToolError(error);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
server.registerTool(
|
|
85
|
-
'delete_credit_card',
|
|
86
|
-
{
|
|
87
|
-
title: 'Delete Credit Card',
|
|
88
|
-
description: 'Delete a credit card by ID',
|
|
89
|
-
inputSchema: z.object({ id: z.string() })
|
|
90
|
-
},
|
|
91
|
-
async ({ id }) => {
|
|
92
|
-
try {
|
|
93
|
-
await apiClient.delete(`/credit-cards/${id}`);
|
|
94
|
-
return {
|
|
95
|
-
content: [{ type: 'text', text: `Credit Card deleted successfully (ID: ${id})` }]
|
|
96
|
-
};
|
|
97
|
-
} catch (error) {
|
|
98
|
-
return handleToolError(error);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
server.registerTool(
|
|
104
|
-
'get_statement',
|
|
105
|
-
{
|
|
106
|
-
title: 'Get Statement',
|
|
107
|
-
description: 'Get credit card statement for a specific month',
|
|
108
|
-
inputSchema: z.object({
|
|
109
|
-
id: z.string().describe('Credit Card ID'),
|
|
110
|
-
month: z.string().describe('Month in YYYY-MM format')
|
|
111
|
-
})
|
|
112
|
-
},
|
|
113
|
-
async ({ id, month }) => {
|
|
114
|
-
try {
|
|
115
|
-
const statement = await apiClient.get(`/credit-cards/${id}/statement?month=${month}`);
|
|
116
|
-
return {
|
|
117
|
-
content: [{ type: 'text', text: `Statement: ${JSON.stringify(statement, null, 2)}` }]
|
|
118
|
-
};
|
|
119
|
-
} catch (error) {
|
|
120
|
-
return handleToolError(error);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
server.registerTool(
|
|
126
|
-
'pay_statement',
|
|
127
|
-
{
|
|
128
|
-
title: 'Pay Statement',
|
|
129
|
-
description: 'Mark all transactions in a credit card statement as paid',
|
|
130
|
-
inputSchema: PayStatementInput
|
|
131
|
-
},
|
|
132
|
-
async ({ cardId, month, paymentAccountId }) => {
|
|
133
|
-
try {
|
|
134
|
-
await apiClient.post(`/credit-cards/${cardId}/pay-statement`, { month, paymentAccountId });
|
|
135
|
-
return {
|
|
136
|
-
content: [{ type: 'text', text: `Statement for ${month} paid successfully.` }]
|
|
137
|
-
};
|
|
138
|
-
} catch (error) {
|
|
139
|
-
return handleToolError(error);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
server.registerTool(
|
|
145
|
-
'reopen_statement',
|
|
146
|
-
{
|
|
147
|
-
title: 'Reopen Statement',
|
|
148
|
-
description: 'Reopen a credit card statement by marking all transactions as unpaid',
|
|
149
|
-
inputSchema: ReopenStatementInput
|
|
150
|
-
},
|
|
151
|
-
async ({ cardId, month }) => {
|
|
152
|
-
try {
|
|
153
|
-
const result = await apiClient.post(`/credit-cards/${cardId}/reopen-statement`, { month });
|
|
154
|
-
return {
|
|
155
|
-
content: [{ type: 'text', text: `Statement reopened: ${JSON.stringify(result, null, 2)}` }]
|
|
156
|
-
};
|
|
157
|
-
} catch (error) {
|
|
158
|
-
return handleToolError(error);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
|
|
163
|
-
server.registerTool(
|
|
164
|
-
'get_statement_status',
|
|
165
|
-
{
|
|
166
|
-
title: 'Get Statement Status',
|
|
167
|
-
description: 'Get credit card statement payment status',
|
|
168
|
-
inputSchema: z.object({
|
|
169
|
-
id: z.string().describe('Credit Card ID'),
|
|
170
|
-
month: z.string().describe('Month in YYYY-MM format')
|
|
171
|
-
})
|
|
172
|
-
},
|
|
173
|
-
async ({ id, month }) => {
|
|
174
|
-
try {
|
|
175
|
-
const status = await apiClient.get(`/credit-cards/${id}/statement-status?month=${month}`);
|
|
176
|
-
return {
|
|
177
|
-
content: [{ type: 'text', text: `Statement Status: ${JSON.stringify(status, null, 2)}` }]
|
|
178
|
-
};
|
|
179
|
-
} catch (error) {
|
|
180
|
-
return handleToolError(error);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
server.registerTool(
|
|
186
|
-
'create_anticipation',
|
|
187
|
-
{
|
|
188
|
-
title: 'Create Credit Card Anticipation',
|
|
189
|
-
description: 'Create a credit card anticipation (advance payment toward a statement). Creates a linked pair: INCOME on the credit card side and EXPENSE on the account side.',
|
|
190
|
-
inputSchema: CreateAnticipationInput
|
|
191
|
-
},
|
|
192
|
-
async ({ cardId, ...body }) => {
|
|
193
|
-
try {
|
|
194
|
-
const result = await apiClient.post(`/credit-cards/${cardId}/anticipations`, body);
|
|
195
|
-
return {
|
|
196
|
-
content: [{ type: 'text', text: `Anticipation created: ${JSON.stringify(result, null, 2)}` }]
|
|
197
|
-
};
|
|
198
|
-
} catch (error) {
|
|
199
|
-
return handleToolError(error);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
);
|
|
203
|
-
}
|
package/src/tools/data.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { ImportDataInput } from '../types/schemas.js';
|
|
4
|
-
import { apiClient } from '../services/apiClient.js';
|
|
5
|
-
import { handleToolError } from '../utils/toolHelpers.js';
|
|
6
|
-
|
|
7
|
-
export function registerDataTools(server: McpServer) {
|
|
8
|
-
server.registerTool(
|
|
9
|
-
'export_data',
|
|
10
|
-
{
|
|
11
|
-
title: 'Export Data',
|
|
12
|
-
description: 'Export all user data (settings, categories, accounts, credit cards, recurrence rules, transactions) as a complete backup',
|
|
13
|
-
inputSchema: z.object({})
|
|
14
|
-
},
|
|
15
|
-
async () => {
|
|
16
|
-
try {
|
|
17
|
-
const data = await apiClient.get('/export');
|
|
18
|
-
return {
|
|
19
|
-
content: [{ type: 'text', text: `Export: ${JSON.stringify(data, null, 2)}` }]
|
|
20
|
-
};
|
|
21
|
-
} catch (error) {
|
|
22
|
-
return handleToolError(error);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
server.registerTool(
|
|
28
|
-
'import_data',
|
|
29
|
-
{
|
|
30
|
-
title: 'Import Data',
|
|
31
|
-
description: 'Import a previously exported backup. Mode "reset" clears all existing data first; mode "increment" adds new records and skips existing IDs.',
|
|
32
|
-
inputSchema: ImportDataInput
|
|
33
|
-
},
|
|
34
|
-
async (args) => {
|
|
35
|
-
try {
|
|
36
|
-
const result = await apiClient.post('/import', args);
|
|
37
|
-
return {
|
|
38
|
-
content: [{ type: 'text', text: `Import result: ${JSON.stringify(result, null, 2)}` }]
|
|
39
|
-
};
|
|
40
|
-
} catch (error) {
|
|
41
|
-
return handleToolError(error);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
}
|
package/src/tools/settings.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { CreateSettingsInput, UpdateSettingsInput } from '../types/schemas.js';
|
|
4
|
-
import { apiClient } from '../services/apiClient.js';
|
|
5
|
-
import { handleToolError } from '../utils/toolHelpers.js';
|
|
6
|
-
|
|
7
|
-
export function registerSettingsTools(server: McpServer) {
|
|
8
|
-
server.registerTool(
|
|
9
|
-
'create_settings',
|
|
10
|
-
{
|
|
11
|
-
title: 'Create Settings',
|
|
12
|
-
description: 'Create global settings (only if not exists)',
|
|
13
|
-
inputSchema: CreateSettingsInput
|
|
14
|
-
},
|
|
15
|
-
async (args) => {
|
|
16
|
-
try {
|
|
17
|
-
const settings = await apiClient.post('/settings', args);
|
|
18
|
-
return {
|
|
19
|
-
content: [{ type: 'text', text: `Settings created: ${JSON.stringify(settings, null, 2)}` }]
|
|
20
|
-
};
|
|
21
|
-
} catch (error) {
|
|
22
|
-
return handleToolError(error);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
server.registerTool(
|
|
28
|
-
'get_settings',
|
|
29
|
-
{
|
|
30
|
-
title: 'Get Settings',
|
|
31
|
-
description: 'Get global settings',
|
|
32
|
-
inputSchema: z.object({})
|
|
33
|
-
},
|
|
34
|
-
async () => {
|
|
35
|
-
try {
|
|
36
|
-
const settings = await apiClient.get('/settings');
|
|
37
|
-
return {
|
|
38
|
-
content: [{ type: 'text', text: `Settings: ${JSON.stringify(settings, null, 2)}` }]
|
|
39
|
-
};
|
|
40
|
-
} catch (error) {
|
|
41
|
-
return handleToolError(error);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
server.registerTool(
|
|
47
|
-
'update_settings',
|
|
48
|
-
{
|
|
49
|
-
title: 'Update Settings',
|
|
50
|
-
description: 'Update global settings',
|
|
51
|
-
inputSchema: UpdateSettingsInput
|
|
52
|
-
},
|
|
53
|
-
async (args) => {
|
|
54
|
-
try {
|
|
55
|
-
const settings = await apiClient.put('/settings', args);
|
|
56
|
-
return {
|
|
57
|
-
content: [{ type: 'text', text: `Settings updated: ${JSON.stringify(settings, null, 2)}` }]
|
|
58
|
-
};
|
|
59
|
-
} catch (error) {
|
|
60
|
-
return handleToolError(error);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { CreateSubscriptionInput, UpdateSubscriptionInput } from '../types/schemas.js';
|
|
4
|
-
import { apiClient } from '../services/apiClient.js';
|
|
5
|
-
import { handleToolError } from '../utils/toolHelpers.js';
|
|
6
|
-
|
|
7
|
-
export function registerSubscriptionTools(server: McpServer) {
|
|
8
|
-
server.registerTool(
|
|
9
|
-
'create_subscription',
|
|
10
|
-
{
|
|
11
|
-
title: 'Create Subscription',
|
|
12
|
-
description: 'Create a new subscription (recurring payment on a credit card)',
|
|
13
|
-
inputSchema: CreateSubscriptionInput
|
|
14
|
-
},
|
|
15
|
-
async (args) => {
|
|
16
|
-
try {
|
|
17
|
-
const subscription = await apiClient.post('/subscriptions', args);
|
|
18
|
-
return {
|
|
19
|
-
content: [{ type: 'text', text: `Subscription created: ${JSON.stringify(subscription, null, 2)}` }]
|
|
20
|
-
};
|
|
21
|
-
} catch (error) {
|
|
22
|
-
return handleToolError(error);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
server.registerTool(
|
|
28
|
-
'get_subscriptions',
|
|
29
|
-
{
|
|
30
|
-
title: 'Get Subscriptions',
|
|
31
|
-
description: 'List all subscriptions',
|
|
32
|
-
inputSchema: z.object({})
|
|
33
|
-
},
|
|
34
|
-
async () => {
|
|
35
|
-
try {
|
|
36
|
-
const subscriptions = await apiClient.get('/subscriptions');
|
|
37
|
-
return {
|
|
38
|
-
content: [{ type: 'text', text: `Subscriptions: ${JSON.stringify(subscriptions, null, 2)}` }]
|
|
39
|
-
};
|
|
40
|
-
} catch (error) {
|
|
41
|
-
return handleToolError(error);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
server.registerTool(
|
|
47
|
-
'get_active_subscriptions',
|
|
48
|
-
{
|
|
49
|
-
title: 'Get Active Subscriptions',
|
|
50
|
-
description: 'List all active subscriptions',
|
|
51
|
-
inputSchema: z.object({})
|
|
52
|
-
},
|
|
53
|
-
async () => {
|
|
54
|
-
try {
|
|
55
|
-
const subscriptions = await apiClient.get('/subscriptions/active');
|
|
56
|
-
return {
|
|
57
|
-
content: [{ type: 'text', text: `Active subscriptions: ${JSON.stringify(subscriptions, null, 2)}` }]
|
|
58
|
-
};
|
|
59
|
-
} catch (error) {
|
|
60
|
-
return handleToolError(error);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
server.registerTool(
|
|
66
|
-
'get_subscription',
|
|
67
|
-
{
|
|
68
|
-
title: 'Get Subscription',
|
|
69
|
-
description: 'Get a subscription by ID',
|
|
70
|
-
inputSchema: z.object({ id: z.string() })
|
|
71
|
-
},
|
|
72
|
-
async ({ id }) => {
|
|
73
|
-
try {
|
|
74
|
-
const subscription = await apiClient.get(`/subscriptions/${id}`);
|
|
75
|
-
return {
|
|
76
|
-
content: [{ type: 'text', text: `Subscription: ${JSON.stringify(subscription, null, 2)}` }]
|
|
77
|
-
};
|
|
78
|
-
} catch (error) {
|
|
79
|
-
return handleToolError(error);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
server.registerTool(
|
|
85
|
-
'update_subscription',
|
|
86
|
-
{
|
|
87
|
-
title: 'Update Subscription',
|
|
88
|
-
description: 'Update a subscription',
|
|
89
|
-
inputSchema: UpdateSubscriptionInput
|
|
90
|
-
},
|
|
91
|
-
async ({ id, ...data }) => {
|
|
92
|
-
try {
|
|
93
|
-
const subscription = await apiClient.patch(`/subscriptions/${id}`, data);
|
|
94
|
-
return {
|
|
95
|
-
content: [{ type: 'text', text: `Subscription updated: ${JSON.stringify(subscription, null, 2)}` }]
|
|
96
|
-
};
|
|
97
|
-
} catch (error) {
|
|
98
|
-
return handleToolError(error);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
server.registerTool(
|
|
104
|
-
'deactivate_subscription',
|
|
105
|
-
{
|
|
106
|
-
title: 'Deactivate Subscription',
|
|
107
|
-
description: 'Deactivate a subscription (soft delete)',
|
|
108
|
-
inputSchema: z.object({ id: z.string() })
|
|
109
|
-
},
|
|
110
|
-
async ({ id }) => {
|
|
111
|
-
try {
|
|
112
|
-
const result = await apiClient.delete(`/subscriptions/${id}`);
|
|
113
|
-
return {
|
|
114
|
-
content: [{ type: 'text', text: `Subscription deactivated: ${JSON.stringify(result, null, 2)}` }]
|
|
115
|
-
};
|
|
116
|
-
} catch (error) {
|
|
117
|
-
return handleToolError(error);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
server.registerTool(
|
|
123
|
-
'delete_subscription_permanent',
|
|
124
|
-
{
|
|
125
|
-
title: 'Delete Subscription Permanently',
|
|
126
|
-
description: 'Permanently delete a subscription',
|
|
127
|
-
inputSchema: z.object({ id: z.string() })
|
|
128
|
-
},
|
|
129
|
-
async ({ id }) => {
|
|
130
|
-
try {
|
|
131
|
-
const result = await apiClient.delete(`/subscriptions/${id}/permanent`);
|
|
132
|
-
return {
|
|
133
|
-
content: [{ type: 'text', text: `Subscription permanently deleted: ${JSON.stringify(result, null, 2)}` }]
|
|
134
|
-
};
|
|
135
|
-
} catch (error) {
|
|
136
|
-
return handleToolError(error);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
|
|
141
|
-
server.registerTool(
|
|
142
|
-
'reactivate_subscription',
|
|
143
|
-
{
|
|
144
|
-
title: 'Reactivate Subscription',
|
|
145
|
-
description: 'Reactivate a deactivated subscription',
|
|
146
|
-
inputSchema: z.object({ id: z.string() })
|
|
147
|
-
},
|
|
148
|
-
async ({ id }) => {
|
|
149
|
-
try {
|
|
150
|
-
const subscription = await apiClient.patch(`/subscriptions/${id}/reactivate`, {});
|
|
151
|
-
return {
|
|
152
|
-
content: [{ type: 'text', text: `Subscription reactivated: ${JSON.stringify(subscription, null, 2)}` }]
|
|
153
|
-
};
|
|
154
|
-
} catch (error) {
|
|
155
|
-
return handleToolError(error);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
);
|
|
159
|
-
}
|