mcp-connectwise-psa 0.3.0 → 0.3.1

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 CHANGED
@@ -1,12 +1,15 @@
1
1
  # mcp-connectwise-psa
2
2
 
3
- An MCP ([Model Context Protocol](https://modelcontextprotocol.io)) server for [ConnectWise PSA](https://www.connectwise.com/platform/psa) (Manage), focused on what technicians do all day:
3
+ An MCP ([Model Context Protocol](https://modelcontextprotocol.io)) server for [ConnectWise PSA](https://www.connectwise.com/platform/psa) (Manage) **36 tools across 6 toolsets** covering technicians, dispatchers, and billing, so an AI assistant works PSA the way each role does:
4
4
 
5
- - **Tickets** — my tickets, search, full detail with notes, create, update status/priority/owner, add discussion/internal notes
6
- - **Time entries** — log time against tickets, review your own time
7
- - **Companies & contacts** — fast lookup (read-only)
5
+ - **Tickets** — search / my tickets / full detail with notes, create, update status/priority/owner, add discussion/internal notes, plus board·status·priority discovery and per-ticket time & tasks
6
+ - **Time** — log time against tickets, review your own time, work-role lookup, and **list & submit your timesheets**
7
+ - **Companies & contacts** — fast lookup, contact detail (phones/emails), company sites
8
8
  - **Configurations** — devices/assets with serials, IPs, OS, warranty (read-only)
9
- - **Per-tech API keys (BYOK)**each tech supplies their own ConnectWise member keys; ConnectWise enforces that member's security role, and notes and time entries are attributed to the *actual person*
9
+ - **Dispatch** *(schedule)*schedule entries (list/mine/create/reschedule/cancel), and **members with their timezone, working hours, and free-vs-booked availability**
10
+ - **Invoicing** *(finance, read-only)* — invoices, agreements, and **unbilled billable time** ready to bill
11
+ - **Toolsets & personas** — enable only what a session needs via the `x-cw-toolsets` header (or `CW_TOOLSETS`); presets `tech` / `dispatch` / `invoicing` / `all`. Default `tech` keeps the surface small
12
+ - **Per-member API keys (BYOK)** — each user supplies their own ConnectWise member keys; ConnectWise enforces that member's security role, and every write is attributed to the *actual person*
10
13
  - **Transports** — stdio for local use, streamable HTTP for shared deployments; Docker image included
11
14
 
12
15
  ## Quick start (local, stdio)
@@ -85,7 +88,7 @@ Tools are grouped into **toolsets** so a session only sees the capabilities it n
85
88
  | Toolset key | Tools |
86
89
  |---|---|
87
90
  | `tickets` | `cw_search_tickets`, `cw_my_tickets`, `cw_get_ticket`, `cw_create_ticket`, `cw_update_ticket`, `cw_add_ticket_note`, `cw_list_boards`, `cw_get_board`, `cw_list_priorities`, `cw_list_ticket_time`, `cw_list_ticket_tasks` |
88
- | `time` | `cw_create_time_entry`, `cw_list_my_time`, `cw_list_work_roles`, `cw_list_my_timesheets`, `cw_submit_timesheet` |
91
+ | `time` | `cw_create_time_entry`, `cw_update_time_entry`, `cw_list_my_time`, `cw_list_work_roles`, `cw_list_my_timesheets`, `cw_submit_timesheet` |
89
92
  | `companies` | `cw_search_companies`, `cw_get_company`, `cw_search_contacts`, `cw_get_contact`, `cw_list_company_sites` |
90
93
  | `configurations` | `cw_list_configurations`, `cw_get_configuration` |
91
94
  | `schedule` | `cw_list_schedule_entries`, `cw_my_schedule`, `cw_schedule_ticket`, `cw_update_schedule_entry`, `cw_delete_schedule_entry`, `cw_member_availability`, `cw_list_members`, `cw_get_member` |
@@ -57,6 +57,60 @@ export function registerTimeTools(reg, client) {
57
57
  return failure(error);
58
58
  }
59
59
  });
60
+ reg.register({
61
+ name: "cw_update_time_entry",
62
+ title: "Update ConnectWise Time Entry",
63
+ description: "Edit an existing time entry — its notes, start/end, billable flag, or work role. Only provided " +
64
+ "fields change. Duration is set by time_start/time_end (hours are derived, not edited directly). " +
65
+ "Governed by your ConnectWise security role (typically your own entries).",
66
+ inputSchema: {
67
+ entry_id: z.number().int().positive().describe("The time entry ID (from cw_list_my_time)"),
68
+ notes: z.string().min(1).optional().describe("New work-performed notes"),
69
+ time_start: z.string().optional().describe("New start time, ISO 8601"),
70
+ time_end: z.string().optional().describe("New end time, ISO 8601 (changes the billed hours)"),
71
+ billable: z.boolean().optional().describe("Billable (true) or do-not-bill (false)"),
72
+ work_role: z.string().optional().describe("Work role name"),
73
+ response_format: responseFormatField,
74
+ },
75
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
76
+ }, async (args) => {
77
+ try {
78
+ let start;
79
+ let end;
80
+ if (args.time_start !== undefined) {
81
+ start = new Date(args.time_start);
82
+ if (Number.isNaN(start.getTime()))
83
+ return { ...text("Error: time_start is not a valid ISO timestamp."), isError: true };
84
+ }
85
+ if (args.time_end !== undefined) {
86
+ end = new Date(args.time_end);
87
+ if (Number.isNaN(end.getTime()))
88
+ return { ...text("Error: time_end is not a valid ISO timestamp."), isError: true };
89
+ }
90
+ if (start && end && end <= start)
91
+ return { ...text("Error: time_end must be after time_start."), isError: true };
92
+ const ops = [];
93
+ if (args.notes !== undefined)
94
+ ops.push({ op: "replace", path: "notes", value: args.notes });
95
+ if (start)
96
+ ops.push({ op: "replace", path: "timeStart", value: cwTimestamp(start) });
97
+ if (end)
98
+ ops.push({ op: "replace", path: "timeEnd", value: cwTimestamp(end) });
99
+ if (args.billable !== undefined)
100
+ ops.push({ op: "replace", path: "billableOption", value: args.billable ? "Billable" : "DoNotBill" });
101
+ if (args.work_role !== undefined)
102
+ ops.push({ op: "replace", path: "workType", value: { name: args.work_role } });
103
+ if (ops.length === 0)
104
+ return text("Nothing to update — provide at least one field to change.");
105
+ const entry = await client.patch(`/time/entries/${args.entry_id}`, ops);
106
+ if (args.response_format === "json")
107
+ return text(json(entry));
108
+ return text(`Time entry ${entry.id} updated — ${entry.actualHours ?? "?"}h | ${entry.billableOption ?? "?"} | ${entry.timeStart ?? "?"}${entry.notes ? ` — ${entry.notes.slice(0, 80)}` : ""}.`);
109
+ }
110
+ catch (error) {
111
+ return failure(error);
112
+ }
113
+ });
60
114
  reg.register({
61
115
  name: "cw_list_my_time",
62
116
  title: "My ConnectWise Time Entries",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-connectwise-psa",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "MCP server for ConnectWise PSA (Manage) — tickets, time entries, companies, and configurations for technicians, with per-tech API keys (BYOK) so writes are attributed to the real member",
5
5
  "mcpName": "io.github.selic/mcp-connectwise-psa",
6
6
  "type": "module",