@promptpartner/bexio-mcp-server 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +161 -0
- package/dist/bexio-client.d.ts +350 -0
- package/dist/bexio-client.js +1045 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +80 -0
- package/dist/logger.d.ts +17 -0
- package/dist/logger.js +28 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.js +81 -0
- package/dist/shared/errors.d.ts +21 -0
- package/dist/shared/errors.js +54 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/response.d.ts +24 -0
- package/dist/shared/response.js +92 -0
- package/dist/tools/accounting/definitions.d.ts +9 -0
- package/dist/tools/accounting/definitions.js +345 -0
- package/dist/tools/accounting/handlers.d.ts +10 -0
- package/dist/tools/accounting/handlers.js +121 -0
- package/dist/tools/accounting/index.d.ts +16 -0
- package/dist/tools/accounting/index.js +16 -0
- package/dist/tools/banking/definitions.d.ts +11 -0
- package/dist/tools/banking/definitions.js +349 -0
- package/dist/tools/banking/handlers.d.ts +9 -0
- package/dist/tools/banking/handlers.js +123 -0
- package/dist/tools/banking/index.d.ts +6 -0
- package/dist/tools/banking/index.js +6 -0
- package/dist/tools/company/definitions.d.ts +7 -0
- package/dist/tools/company/definitions.js +87 -0
- package/dist/tools/company/handlers.d.ts +7 -0
- package/dist/tools/company/handlers.js +31 -0
- package/dist/tools/company/index.d.ts +6 -0
- package/dist/tools/company/index.js +6 -0
- package/dist/tools/contacts/definitions.d.ts +6 -0
- package/dist/tools/contacts/definitions.js +150 -0
- package/dist/tools/contacts/handlers.d.ts +7 -0
- package/dist/tools/contacts/handlers.js +40 -0
- package/dist/tools/contacts/index.d.ts +6 -0
- package/dist/tools/contacts/index.js +5 -0
- package/dist/tools/deliveries/definitions.d.ts +6 -0
- package/dist/tools/deliveries/definitions.js +67 -0
- package/dist/tools/deliveries/handlers.d.ts +7 -0
- package/dist/tools/deliveries/handlers.js +28 -0
- package/dist/tools/deliveries/index.d.ts +6 -0
- package/dist/tools/deliveries/index.js +5 -0
- package/dist/tools/files/definitions.d.ts +6 -0
- package/dist/tools/files/definitions.js +217 -0
- package/dist/tools/files/handlers.d.ts +7 -0
- package/dist/tools/files/handlers.js +63 -0
- package/dist/tools/files/index.d.ts +6 -0
- package/dist/tools/files/index.js +5 -0
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.js +93 -0
- package/dist/tools/invoices/definitions.d.ts +6 -0
- package/dist/tools/invoices/definitions.js +147 -0
- package/dist/tools/invoices/handlers.d.ts +7 -0
- package/dist/tools/invoices/handlers.js +119 -0
- package/dist/tools/invoices/index.d.ts +6 -0
- package/dist/tools/invoices/index.js +5 -0
- package/dist/tools/items/definitions.d.ts +6 -0
- package/dist/tools/items/definitions.js +100 -0
- package/dist/tools/items/handlers.d.ts +7 -0
- package/dist/tools/items/handlers.js +36 -0
- package/dist/tools/items/index.d.ts +6 -0
- package/dist/tools/items/index.js +5 -0
- package/dist/tools/misc/definitions.d.ts +6 -0
- package/dist/tools/misc/definitions.js +126 -0
- package/dist/tools/misc/handlers.d.ts +7 -0
- package/dist/tools/misc/handlers.js +52 -0
- package/dist/tools/misc/index.d.ts +6 -0
- package/dist/tools/misc/index.js +5 -0
- package/dist/tools/orders/definitions.d.ts +6 -0
- package/dist/tools/orders/definitions.js +114 -0
- package/dist/tools/orders/handlers.d.ts +7 -0
- package/dist/tools/orders/handlers.js +62 -0
- package/dist/tools/orders/index.d.ts +6 -0
- package/dist/tools/orders/index.js +5 -0
- package/dist/tools/payments/definitions.d.ts +6 -0
- package/dist/tools/payments/definitions.js +74 -0
- package/dist/tools/payments/handlers.d.ts +7 -0
- package/dist/tools/payments/handlers.js +28 -0
- package/dist/tools/payments/index.d.ts +6 -0
- package/dist/tools/payments/index.js +5 -0
- package/dist/tools/payroll/definitions.d.ts +15 -0
- package/dist/tools/payroll/definitions.js +239 -0
- package/dist/tools/payroll/handlers.d.ts +14 -0
- package/dist/tools/payroll/handlers.js +152 -0
- package/dist/tools/payroll/index.d.ts +16 -0
- package/dist/tools/payroll/index.js +16 -0
- package/dist/tools/projects/definitions.d.ts +7 -0
- package/dist/tools/projects/definitions.js +430 -0
- package/dist/tools/projects/handlers.d.ts +7 -0
- package/dist/tools/projects/handlers.js +127 -0
- package/dist/tools/projects/index.d.ts +6 -0
- package/dist/tools/projects/index.js +6 -0
- package/dist/tools/purchase/definitions.d.ts +6 -0
- package/dist/tools/purchase/definitions.js +381 -0
- package/dist/tools/purchase/handlers.d.ts +7 -0
- package/dist/tools/purchase/handlers.js +120 -0
- package/dist/tools/purchase/index.d.ts +7 -0
- package/dist/tools/purchase/index.js +6 -0
- package/dist/tools/quotes/definitions.d.ts +6 -0
- package/dist/tools/quotes/definitions.js +174 -0
- package/dist/tools/quotes/handlers.d.ts +7 -0
- package/dist/tools/quotes/handlers.js +79 -0
- package/dist/tools/quotes/index.d.ts +6 -0
- package/dist/tools/quotes/index.js +5 -0
- package/dist/tools/reference/definitions.d.ts +7 -0
- package/dist/tools/reference/definitions.js +421 -0
- package/dist/tools/reference/handlers.d.ts +7 -0
- package/dist/tools/reference/handlers.js +161 -0
- package/dist/tools/reference/index.d.ts +6 -0
- package/dist/tools/reference/index.js +6 -0
- package/dist/tools/reminders/definitions.d.ts +6 -0
- package/dist/tools/reminders/definitions.js +132 -0
- package/dist/tools/reminders/handlers.d.ts +7 -0
- package/dist/tools/reminders/handlers.js +43 -0
- package/dist/tools/reminders/index.d.ts +6 -0
- package/dist/tools/reminders/index.js +5 -0
- package/dist/tools/reports/definitions.d.ts +6 -0
- package/dist/tools/reports/definitions.js +133 -0
- package/dist/tools/reports/handlers.d.ts +7 -0
- package/dist/tools/reports/handlers.js +33 -0
- package/dist/tools/reports/index.d.ts +6 -0
- package/dist/tools/reports/index.js +5 -0
- package/dist/tools/timetracking/definitions.d.ts +9 -0
- package/dist/tools/timetracking/definitions.js +226 -0
- package/dist/tools/timetracking/handlers.d.ts +9 -0
- package/dist/tools/timetracking/handlers.js +88 -0
- package/dist/tools/timetracking/index.d.ts +6 -0
- package/dist/tools/timetracking/index.js +6 -0
- package/dist/tools/users/definitions.d.ts +6 -0
- package/dist/tools/users/definitions.js +93 -0
- package/dist/tools/users/handlers.d.ts +7 -0
- package/dist/tools/users/handlers.js +35 -0
- package/dist/tools/users/index.d.ts +6 -0
- package/dist/tools/users/index.js +5 -0
- package/dist/transports/http.d.ts +17 -0
- package/dist/transports/http.js +203 -0
- package/dist/transports/index.d.ts +4 -0
- package/dist/transports/index.js +4 -0
- package/dist/types/common.d.ts +32 -0
- package/dist/types/common.js +11 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.js +11 -0
- package/dist/types/schemas/accounting.d.ts +225 -0
- package/dist/types/schemas/accounting.js +96 -0
- package/dist/types/schemas/banking.d.ts +207 -0
- package/dist/types/schemas/banking.js +86 -0
- package/dist/types/schemas/company.d.ts +44 -0
- package/dist/types/schemas/company.js +23 -0
- package/dist/types/schemas/contacts.d.ts +104 -0
- package/dist/types/schemas/contacts.js +42 -0
- package/dist/types/schemas/deliveries.d.ts +40 -0
- package/dist/types/schemas/deliveries.js +22 -0
- package/dist/types/schemas/files.d.ts +152 -0
- package/dist/types/schemas/files.js +64 -0
- package/dist/types/schemas/index.d.ts +24 -0
- package/dist/types/schemas/index.js +44 -0
- package/dist/types/schemas/invoices.d.ts +594 -0
- package/dist/types/schemas/invoices.js +109 -0
- package/dist/types/schemas/items.d.ts +153 -0
- package/dist/types/schemas/items.js +43 -0
- package/dist/types/schemas/misc.d.ts +64 -0
- package/dist/types/schemas/misc.js +36 -0
- package/dist/types/schemas/orders.d.ts +657 -0
- package/dist/types/schemas/orders.js +101 -0
- package/dist/types/schemas/payments.d.ts +46 -0
- package/dist/types/schemas/payments.js +24 -0
- package/dist/types/schemas/payroll.d.ts +146 -0
- package/dist/types/schemas/payroll.js +65 -0
- package/dist/types/schemas/projects.d.ts +268 -0
- package/dist/types/schemas/projects.js +102 -0
- package/dist/types/schemas/purchase.d.ts +228 -0
- package/dist/types/schemas/purchase.js +114 -0
- package/dist/types/schemas/quotes.d.ts +102 -0
- package/dist/types/schemas/quotes.js +49 -0
- package/dist/types/schemas/reference.d.ts +240 -0
- package/dist/types/schemas/reference.js +99 -0
- package/dist/types/schemas/reminders.d.ts +76 -0
- package/dist/types/schemas/reminders.js +38 -0
- package/dist/types/schemas/reports.d.ts +69 -0
- package/dist/types/schemas/reports.js +36 -0
- package/dist/types/schemas/timetracking.d.ts +150 -0
- package/dist/types/schemas/timetracking.js +68 -0
- package/dist/types/schemas/users.d.ts +51 -0
- package/dist/types/schemas/users.js +27 -0
- package/dist/ui/contact-card/mcp-app.d.ts +1 -0
- package/dist/ui/contact-card/mcp-app.js +108 -0
- package/dist/ui/dashboard/mcp-app.d.ts +1 -0
- package/dist/ui/dashboard/mcp-app.js +81 -0
- package/dist/ui/invoice-preview/mcp-app.d.ts +1 -0
- package/dist/ui/invoice-preview/mcp-app.js +96 -0
- package/dist/ui-resources.d.ts +17 -0
- package/dist/ui-resources.js +124 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vite.config.js +46 -0
- package/package.json +78 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time Tracking tool definitions.
|
|
3
|
+
* Contains MCP tool metadata for time tracking domain.
|
|
4
|
+
* Includes: Timesheets, Timesheet Statuses, Business Activities, Communication Types
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT: Duration format for timesheets is "HH:MM" (e.g., "02:30" for 2.5 hours).
|
|
7
|
+
*/
|
|
8
|
+
export const toolDefinitions = [
|
|
9
|
+
// ===== TIMESHEETS (PROJ-06) =====
|
|
10
|
+
{
|
|
11
|
+
name: "list_timesheets",
|
|
12
|
+
description: "List all timesheet entries with pagination",
|
|
13
|
+
inputSchema: {
|
|
14
|
+
type: "object",
|
|
15
|
+
properties: {
|
|
16
|
+
limit: {
|
|
17
|
+
type: "integer",
|
|
18
|
+
description: "Maximum number of results to return (default: 100)",
|
|
19
|
+
default: 100,
|
|
20
|
+
},
|
|
21
|
+
offset: {
|
|
22
|
+
type: "integer",
|
|
23
|
+
description: "Number of results to skip (default: 0)",
|
|
24
|
+
default: 0,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "get_timesheet",
|
|
31
|
+
description: "Get a specific timesheet entry by ID",
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: "object",
|
|
34
|
+
properties: {
|
|
35
|
+
timesheet_id: {
|
|
36
|
+
type: "integer",
|
|
37
|
+
description: "The ID of the timesheet entry to retrieve",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
required: ["timesheet_id"],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "create_timesheet",
|
|
45
|
+
description: "Create a new timesheet entry. Duration must be in HH:MM format (e.g., '02:30' for 2.5 hours)",
|
|
46
|
+
inputSchema: {
|
|
47
|
+
type: "object",
|
|
48
|
+
properties: {
|
|
49
|
+
user_id: {
|
|
50
|
+
type: "integer",
|
|
51
|
+
description: "The ID of the user who worked (required)",
|
|
52
|
+
},
|
|
53
|
+
date: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Date of the work in YYYY-MM-DD format (required)",
|
|
56
|
+
},
|
|
57
|
+
duration: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Duration of work in HH:MM format, e.g., '02:30' for 2 hours 30 minutes (required)",
|
|
60
|
+
},
|
|
61
|
+
pr_project_id: {
|
|
62
|
+
type: "integer",
|
|
63
|
+
description: "ID of the project to link this timesheet to (optional)",
|
|
64
|
+
},
|
|
65
|
+
pr_package_id: {
|
|
66
|
+
type: "integer",
|
|
67
|
+
description: "ID of the work package to link this timesheet to (optional)",
|
|
68
|
+
},
|
|
69
|
+
pr_milestone_id: {
|
|
70
|
+
type: "integer",
|
|
71
|
+
description: "ID of the milestone to link this timesheet to (optional)",
|
|
72
|
+
},
|
|
73
|
+
client_service_id: {
|
|
74
|
+
type: "integer",
|
|
75
|
+
description: "ID of the business activity/service type (optional)",
|
|
76
|
+
},
|
|
77
|
+
text: {
|
|
78
|
+
type: "string",
|
|
79
|
+
description: "Description of the work performed (optional)",
|
|
80
|
+
},
|
|
81
|
+
allowable_bill: {
|
|
82
|
+
type: "boolean",
|
|
83
|
+
description: "Whether this time is billable (default: true)",
|
|
84
|
+
default: true,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
required: ["user_id", "date", "duration"],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "delete_timesheet",
|
|
92
|
+
description: "Delete a timesheet entry by ID",
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
timesheet_id: {
|
|
97
|
+
type: "integer",
|
|
98
|
+
description: "The ID of the timesheet entry to delete",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
required: ["timesheet_id"],
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "search_timesheets",
|
|
106
|
+
description: "Search timesheets by criteria (field, value, criteria). Common fields: user_id, pr_project_id, date",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: {
|
|
110
|
+
search_criteria: {
|
|
111
|
+
type: "array",
|
|
112
|
+
description: "Array of search criteria objects with field, value, and optional criteria properties",
|
|
113
|
+
items: {
|
|
114
|
+
type: "object",
|
|
115
|
+
properties: {
|
|
116
|
+
field: {
|
|
117
|
+
type: "string",
|
|
118
|
+
description: "Field name to search (e.g., user_id, pr_project_id, date)",
|
|
119
|
+
},
|
|
120
|
+
value: {
|
|
121
|
+
description: "Value to search for",
|
|
122
|
+
},
|
|
123
|
+
criteria: {
|
|
124
|
+
type: "string",
|
|
125
|
+
description: "Comparison operator (e.g., '=', 'like', '>', '<')",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
required: ["field", "value"],
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
required: ["search_criteria"],
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
// ===== TIMESHEET STATUSES (PROJ-07) =====
|
|
136
|
+
{
|
|
137
|
+
name: "list_timesheet_statuses",
|
|
138
|
+
description: "List all timesheet statuses (e.g., open, approved, locked)",
|
|
139
|
+
inputSchema: {
|
|
140
|
+
type: "object",
|
|
141
|
+
properties: {},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
// ===== BUSINESS ACTIVITIES (PROJ-08) =====
|
|
145
|
+
{
|
|
146
|
+
name: "list_business_activities",
|
|
147
|
+
description: "List business activities (service types for time tracking). Used to categorize work.",
|
|
148
|
+
inputSchema: {
|
|
149
|
+
type: "object",
|
|
150
|
+
properties: {
|
|
151
|
+
limit: {
|
|
152
|
+
type: "integer",
|
|
153
|
+
description: "Maximum number of results to return (default: 100)",
|
|
154
|
+
default: 100,
|
|
155
|
+
},
|
|
156
|
+
offset: {
|
|
157
|
+
type: "integer",
|
|
158
|
+
description: "Number of results to skip (default: 0)",
|
|
159
|
+
default: 0,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "get_business_activity",
|
|
166
|
+
description: "Get a specific business activity by ID",
|
|
167
|
+
inputSchema: {
|
|
168
|
+
type: "object",
|
|
169
|
+
properties: {
|
|
170
|
+
activity_id: {
|
|
171
|
+
type: "integer",
|
|
172
|
+
description: "The ID of the business activity to retrieve",
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
required: ["activity_id"],
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "create_business_activity",
|
|
180
|
+
description: "Create a new business activity (service type for time tracking)",
|
|
181
|
+
inputSchema: {
|
|
182
|
+
type: "object",
|
|
183
|
+
properties: {
|
|
184
|
+
name: {
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "The name of the business activity",
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
required: ["name"],
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
// ===== COMMUNICATION TYPES (PROJ-09) =====
|
|
193
|
+
{
|
|
194
|
+
name: "list_communication_types",
|
|
195
|
+
description: "List all communication types (e.g., email, phone, meeting)",
|
|
196
|
+
inputSchema: {
|
|
197
|
+
type: "object",
|
|
198
|
+
properties: {
|
|
199
|
+
limit: {
|
|
200
|
+
type: "integer",
|
|
201
|
+
description: "Maximum number of results to return (default: 100)",
|
|
202
|
+
default: 100,
|
|
203
|
+
},
|
|
204
|
+
offset: {
|
|
205
|
+
type: "integer",
|
|
206
|
+
description: "Number of results to skip (default: 0)",
|
|
207
|
+
default: 0,
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "get_communication_type",
|
|
214
|
+
description: "Get a specific communication type by ID",
|
|
215
|
+
inputSchema: {
|
|
216
|
+
type: "object",
|
|
217
|
+
properties: {
|
|
218
|
+
type_id: {
|
|
219
|
+
type: "integer",
|
|
220
|
+
description: "The ID of the communication type to retrieve",
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
required: ["type_id"],
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time Tracking tool handlers.
|
|
3
|
+
* Implements the logic for each time tracking tool.
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: Duration format for timesheets is "HH:MM" (e.g., "02:30" for 2.5 hours).
|
|
6
|
+
*/
|
|
7
|
+
import { BexioClient } from "../../bexio-client.js";
|
|
8
|
+
export type HandlerFn = (client: BexioClient, args: unknown) => Promise<unknown>;
|
|
9
|
+
export declare const handlers: Record<string, HandlerFn>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time Tracking tool handlers.
|
|
3
|
+
* Implements the logic for each time tracking tool.
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: Duration format for timesheets is "HH:MM" (e.g., "02:30" for 2.5 hours).
|
|
6
|
+
*/
|
|
7
|
+
import { McpError } from "../../shared/errors.js";
|
|
8
|
+
import {
|
|
9
|
+
// Timesheets
|
|
10
|
+
ListTimesheetsParamsSchema, GetTimesheetParamsSchema, CreateTimesheetParamsSchema, DeleteTimesheetParamsSchema, SearchTimesheetsParamsSchema,
|
|
11
|
+
// Timesheet Statuses
|
|
12
|
+
ListTimesheetStatusesParamsSchema,
|
|
13
|
+
// Business Activities
|
|
14
|
+
ListBusinessActivitiesParamsSchema, GetBusinessActivityParamsSchema, CreateBusinessActivityParamsSchema,
|
|
15
|
+
// Communication Types
|
|
16
|
+
ListCommunicationTypesParamsSchema, GetCommunicationTypeParamsSchema, } from "../../types/index.js";
|
|
17
|
+
export const handlers = {
|
|
18
|
+
// ===== TIMESHEETS (PROJ-06) =====
|
|
19
|
+
list_timesheets: async (client, args) => {
|
|
20
|
+
const params = ListTimesheetsParamsSchema.parse(args);
|
|
21
|
+
return client.listTimesheets(params);
|
|
22
|
+
},
|
|
23
|
+
get_timesheet: async (client, args) => {
|
|
24
|
+
const { timesheet_id } = GetTimesheetParamsSchema.parse(args);
|
|
25
|
+
const timesheet = await client.getTimesheet(timesheet_id);
|
|
26
|
+
if (!timesheet) {
|
|
27
|
+
throw McpError.notFound("Timesheet", timesheet_id);
|
|
28
|
+
}
|
|
29
|
+
return timesheet;
|
|
30
|
+
},
|
|
31
|
+
create_timesheet: async (client, args) => {
|
|
32
|
+
const params = CreateTimesheetParamsSchema.parse(args);
|
|
33
|
+
return client.createTimesheet({
|
|
34
|
+
user_id: params.user_id,
|
|
35
|
+
date: params.date,
|
|
36
|
+
duration: params.duration,
|
|
37
|
+
pr_project_id: params.pr_project_id,
|
|
38
|
+
pr_package_id: params.pr_package_id,
|
|
39
|
+
pr_milestone_id: params.pr_milestone_id,
|
|
40
|
+
client_service_id: params.client_service_id,
|
|
41
|
+
text: params.text,
|
|
42
|
+
allowable_bill: params.allowable_bill,
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
delete_timesheet: async (client, args) => {
|
|
46
|
+
const { timesheet_id } = DeleteTimesheetParamsSchema.parse(args);
|
|
47
|
+
return client.deleteTimesheet(timesheet_id);
|
|
48
|
+
},
|
|
49
|
+
search_timesheets: async (client, args) => {
|
|
50
|
+
const { search_criteria } = SearchTimesheetsParamsSchema.parse(args);
|
|
51
|
+
return client.searchTimesheets(search_criteria);
|
|
52
|
+
},
|
|
53
|
+
// ===== TIMESHEET STATUSES (PROJ-07) =====
|
|
54
|
+
list_timesheet_statuses: async (client, args) => {
|
|
55
|
+
ListTimesheetStatusesParamsSchema.parse(args);
|
|
56
|
+
return client.listTimesheetStatuses();
|
|
57
|
+
},
|
|
58
|
+
// ===== BUSINESS ACTIVITIES (PROJ-08) =====
|
|
59
|
+
list_business_activities: async (client, args) => {
|
|
60
|
+
const params = ListBusinessActivitiesParamsSchema.parse(args);
|
|
61
|
+
return client.listBusinessActivities(params);
|
|
62
|
+
},
|
|
63
|
+
get_business_activity: async (client, args) => {
|
|
64
|
+
const { activity_id } = GetBusinessActivityParamsSchema.parse(args);
|
|
65
|
+
const activity = await client.getBusinessActivity(activity_id);
|
|
66
|
+
if (!activity) {
|
|
67
|
+
throw McpError.notFound("Business Activity", activity_id);
|
|
68
|
+
}
|
|
69
|
+
return activity;
|
|
70
|
+
},
|
|
71
|
+
create_business_activity: async (client, args) => {
|
|
72
|
+
const { name } = CreateBusinessActivityParamsSchema.parse(args);
|
|
73
|
+
return client.createBusinessActivity({ name });
|
|
74
|
+
},
|
|
75
|
+
// ===== COMMUNICATION TYPES (PROJ-09) =====
|
|
76
|
+
list_communication_types: async (client, args) => {
|
|
77
|
+
const params = ListCommunicationTypesParamsSchema.parse(args);
|
|
78
|
+
return client.listCommunicationTypes(params);
|
|
79
|
+
},
|
|
80
|
+
get_communication_type: async (client, args) => {
|
|
81
|
+
const { type_id } = GetCommunicationTypeParamsSchema.parse(args);
|
|
82
|
+
const type = await client.getCommunicationType(type_id);
|
|
83
|
+
if (!type) {
|
|
84
|
+
throw McpError.notFound("Communication Type", type_id);
|
|
85
|
+
}
|
|
86
|
+
return type;
|
|
87
|
+
},
|
|
88
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User tool definitions.
|
|
3
|
+
* Contains MCP tool metadata for users domain.
|
|
4
|
+
*/
|
|
5
|
+
export const toolDefinitions = [
|
|
6
|
+
{
|
|
7
|
+
name: "get_current_user",
|
|
8
|
+
description: "Get the currently authenticated user",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "list_fictional_users",
|
|
16
|
+
description: "List fictional users from Bexio with optional pagination",
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
limit: {
|
|
21
|
+
type: "integer",
|
|
22
|
+
description: "Maximum number of users to return (default: 50)",
|
|
23
|
+
default: 50,
|
|
24
|
+
},
|
|
25
|
+
offset: {
|
|
26
|
+
type: "integer",
|
|
27
|
+
description: "Number of users to skip (default: 0)",
|
|
28
|
+
default: 0,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "get_fictional_user",
|
|
35
|
+
description: "Get a specific fictional user by ID",
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: "object",
|
|
38
|
+
properties: {
|
|
39
|
+
user_id: {
|
|
40
|
+
type: "integer",
|
|
41
|
+
description: "The ID of the user to retrieve",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
required: ["user_id"],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "create_fictional_user",
|
|
49
|
+
description: "Create a new fictional user",
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
user_data: {
|
|
54
|
+
type: "object",
|
|
55
|
+
description: "User data to create",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
required: ["user_data"],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "update_fictional_user",
|
|
63
|
+
description: "Update a fictional user",
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: "object",
|
|
66
|
+
properties: {
|
|
67
|
+
user_id: {
|
|
68
|
+
type: "integer",
|
|
69
|
+
description: "The ID of the user to update",
|
|
70
|
+
},
|
|
71
|
+
user_data: {
|
|
72
|
+
type: "object",
|
|
73
|
+
description: "User data to update",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
required: ["user_id", "user_data"],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "delete_fictional_user",
|
|
81
|
+
description: "Delete a fictional user",
|
|
82
|
+
inputSchema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
user_id: {
|
|
86
|
+
type: "integer",
|
|
87
|
+
description: "The ID of the user to delete",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
required: ["user_id"],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User tool handlers.
|
|
3
|
+
* Implements the logic for each user tool.
|
|
4
|
+
*/
|
|
5
|
+
import { BexioClient } from "../../bexio-client.js";
|
|
6
|
+
export type HandlerFn = (client: BexioClient, args: unknown) => Promise<unknown>;
|
|
7
|
+
export declare const handlers: Record<string, HandlerFn>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User tool handlers.
|
|
3
|
+
* Implements the logic for each user tool.
|
|
4
|
+
*/
|
|
5
|
+
import { McpError } from "../../shared/errors.js";
|
|
6
|
+
import { ListFictionalUsersParamsSchema, GetFictionalUserParamsSchema, CreateFictionalUserParamsSchema, UpdateFictionalUserParamsSchema, DeleteFictionalUserParamsSchema, } from "../../types/index.js";
|
|
7
|
+
export const handlers = {
|
|
8
|
+
get_current_user: async (client) => {
|
|
9
|
+
return client.getCurrentUser();
|
|
10
|
+
},
|
|
11
|
+
list_fictional_users: async (client, args) => {
|
|
12
|
+
const params = ListFictionalUsersParamsSchema.parse(args);
|
|
13
|
+
return client.listFictionalUsers(params);
|
|
14
|
+
},
|
|
15
|
+
get_fictional_user: async (client, args) => {
|
|
16
|
+
const { user_id } = GetFictionalUserParamsSchema.parse(args);
|
|
17
|
+
const user = await client.getFictionalUser(user_id);
|
|
18
|
+
if (!user) {
|
|
19
|
+
throw McpError.notFound("Fictional User", user_id);
|
|
20
|
+
}
|
|
21
|
+
return user;
|
|
22
|
+
},
|
|
23
|
+
create_fictional_user: async (client, args) => {
|
|
24
|
+
const { user_data } = CreateFictionalUserParamsSchema.parse(args);
|
|
25
|
+
return client.createFictionalUser(user_data);
|
|
26
|
+
},
|
|
27
|
+
update_fictional_user: async (client, args) => {
|
|
28
|
+
const { user_id, user_data } = UpdateFictionalUserParamsSchema.parse(args);
|
|
29
|
+
return client.updateFictionalUser(user_id, user_data);
|
|
30
|
+
},
|
|
31
|
+
delete_fictional_user: async (client, args) => {
|
|
32
|
+
const { user_id } = DeleteFictionalUserParamsSchema.parse(args);
|
|
33
|
+
return client.deleteFictionalUser(user_id);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP Transport for Bexio MCP Server.
|
|
3
|
+
* Provides HTTP/REST access for n8n and other remote clients.
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: All logging uses logger (stderr), stdout reserved for nothing in HTTP mode.
|
|
6
|
+
*/
|
|
7
|
+
import { FastifyInstance } from "fastify";
|
|
8
|
+
import { BexioClient } from "../bexio-client.js";
|
|
9
|
+
export interface HttpServerOptions {
|
|
10
|
+
host: string;
|
|
11
|
+
port: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates an HTTP server for the MCP server.
|
|
15
|
+
* This enables n8n and other HTTP clients to interact with the Bexio API.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createHttpServer(client: BexioClient, options: HttpServerOptions): Promise<FastifyInstance>;
|