@procurementexpress.com/mcp 1.0.0 → 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.
Files changed (35) hide show
  1. package/.claude/skills/bump-version/SKILL.md +77 -0
  2. package/.claude/skills/commit/SKILL.md +73 -0
  3. package/.claude/skills/npm-publish/SKILL.md +65 -0
  4. package/.claude/skills/pex-approval-flows/SKILL.md +122 -0
  5. package/.claude/skills/pex-approval-flows/references/conditions.md +90 -0
  6. package/.claude/skills/pex-auth/SKILL.md +80 -0
  7. package/.claude/skills/pex-budgets/SKILL.md +73 -0
  8. package/.claude/skills/pex-companies/SKILL.md +113 -0
  9. package/.claude/skills/pex-departments/SKILL.md +61 -0
  10. package/.claude/skills/pex-invoices/SKILL.md +125 -0
  11. package/.claude/skills/pex-invoices/references/line-items.md +55 -0
  12. package/.claude/skills/pex-payments/SKILL.md +79 -0
  13. package/.claude/skills/pex-purchase-orders/SKILL.md +167 -0
  14. package/.claude/skills/pex-purchase-orders/references/line-items.md +53 -0
  15. package/.claude/skills/pex-purchase-orders/references/workflows.md +74 -0
  16. package/.claude/skills/pex-settings/SKILL.md +128 -0
  17. package/.claude/skills/pex-suppliers/SKILL.md +113 -0
  18. package/README.md +118 -25
  19. package/dist/api-client.d.ts +1 -0
  20. package/dist/api-client.js +3 -0
  21. package/dist/tools/approval-flows.js +130 -25
  22. package/dist/tools/budgets.js +30 -20
  23. package/dist/tools/comments.js +4 -4
  24. package/dist/tools/companies.js +57 -7
  25. package/dist/tools/departments.js +6 -6
  26. package/dist/tools/invoices.js +100 -31
  27. package/dist/tools/payments.js +45 -13
  28. package/dist/tools/products.js +10 -5
  29. package/dist/tools/purchase-orders.js +178 -35
  30. package/dist/tools/supplementary.js +57 -14
  31. package/dist/tools/suppliers.js +38 -19
  32. package/dist/tools/tax-rates.js +15 -9
  33. package/dist/tools/users.js +8 -5
  34. package/dist/tools/webhooks.js +59 -9
  35. package/package.json +5 -4
@@ -2,9 +2,9 @@ import { z } from "zod";
2
2
  import { jsonResponse, withErrorHandling } from "../tool-helpers.js";
3
3
  export function registerWebhookTools(server, apiClient) {
4
4
  server.registerTool("list_webhooks", {
5
- description: "List webhooks with optional archived filter",
5
+ description: "List webhooks for the current company, ordered by creation date",
6
6
  inputSchema: {
7
- archived: z.boolean().optional().describe("Filter by archived status"),
7
+ archived: z.boolean().optional().describe("Filter by archived status (default: false)"),
8
8
  },
9
9
  }, withErrorHandling(async (args) => {
10
10
  const params = new URLSearchParams();
@@ -16,7 +16,7 @@ export function registerWebhookTools(server, apiClient) {
16
16
  return jsonResponse(webhooks);
17
17
  }));
18
18
  server.registerTool("get_webhook", {
19
- description: "Get a specific webhook by ID",
19
+ description: "Get a specific webhook by ID including its custom attributes",
20
20
  inputSchema: {
21
21
  id: z.number().int().positive().describe("Webhook ID"),
22
22
  },
@@ -28,17 +28,35 @@ export function registerWebhookTools(server, apiClient) {
28
28
  description: "Create a webhook. Events: new_po, po_approved, po_delivered, po_paid, po_cancelled, po_update",
29
29
  inputSchema: {
30
30
  name: z.string().describe("Webhook name"),
31
- url: z.string().url().describe("Handler URL"),
31
+ url: z.string().describe("Handler URL"),
32
32
  event_type: z
33
33
  .array(z.enum(["new_po", "po_approved", "po_delivered", "po_paid", "po_cancelled", "po_update"]))
34
34
  .describe("Events to subscribe to"),
35
- json_wrapper: z.string().optional().describe("Root key for JSON data"),
35
+ authentication_header: z.string().optional().describe("Custom authentication header value"),
36
+ json_wrapper: z.string().optional().describe("Root key for JSON payload wrapping"),
36
37
  send_as_text: z.boolean().optional().describe("Send payload as text instead of JSON"),
37
38
  basic_auth_uname: z.string().optional().describe("Basic auth username"),
38
39
  basic_auth_pword: z.string().optional().describe("Basic auth password"),
40
+ webhook_attributes: z
41
+ .array(z.object({
42
+ attrib_type: z.string().describe("Attribute type"),
43
+ key: z.string().describe("Attribute key"),
44
+ value: z.string().describe("Attribute value"),
45
+ }))
46
+ .optional()
47
+ .describe("Custom webhook attributes (key-value pairs sent with each webhook)"),
39
48
  },
40
49
  }, withErrorHandling(async (args) => {
41
- const webhook = await apiClient.post(apiClient.buildPath("/webhooks"), { webhook: args });
50
+ const { webhook_attributes, ...webhookData } = args;
51
+ const body = {
52
+ webhook: {
53
+ ...webhookData,
54
+ ...(webhook_attributes
55
+ ? { webhook_attributes_attributes: webhook_attributes }
56
+ : {}),
57
+ },
58
+ };
59
+ const webhook = await apiClient.post(apiClient.buildPath("/webhooks"), body);
42
60
  return jsonResponse(webhook);
43
61
  }));
44
62
  server.registerTool("update_webhook", {
@@ -46,16 +64,48 @@ export function registerWebhookTools(server, apiClient) {
46
64
  inputSchema: {
47
65
  id: z.number().int().positive().describe("Webhook ID"),
48
66
  name: z.string().optional().describe("Webhook name"),
49
- url: z.string().url().optional().describe("Handler URL"),
67
+ url: z.string().optional().describe("Handler URL"),
50
68
  event_type: z
51
69
  .array(z.enum(["new_po", "po_approved", "po_delivered", "po_paid", "po_cancelled", "po_update"]))
52
70
  .optional()
53
71
  .describe("Events to subscribe to"),
72
+ authentication_header: z.string().optional().describe("Custom authentication header value"),
73
+ json_wrapper: z.string().optional().describe("Root key for JSON payload wrapping"),
74
+ send_as_text: z.boolean().optional().describe("Send payload as text instead of JSON"),
75
+ basic_auth_uname: z.string().optional().describe("Basic auth username"),
76
+ basic_auth_pword: z.string().optional().describe("Basic auth password"),
54
77
  archived: z.boolean().optional().describe("Archive status"),
78
+ webhook_attributes: z
79
+ .array(z.object({
80
+ id: z.number().int().optional().describe("Attribute ID (for updates)"),
81
+ attrib_type: z.string().optional().describe("Attribute type"),
82
+ key: z.string().optional().describe("Attribute key"),
83
+ value: z.string().optional().describe("Attribute value"),
84
+ _destroy: z.boolean().optional().describe("Set true to remove"),
85
+ }))
86
+ .optional()
87
+ .describe("Custom webhook attributes"),
55
88
  },
56
89
  }, withErrorHandling(async (args) => {
57
- const { id, ...data } = args;
58
- const webhook = await apiClient.put(apiClient.buildPath(`/webhooks/${id}`), { webhook: data });
90
+ const { id, webhook_attributes, ...data } = args;
91
+ const body = {
92
+ webhook: {
93
+ ...data,
94
+ ...(webhook_attributes
95
+ ? { webhook_attributes_attributes: webhook_attributes }
96
+ : {}),
97
+ },
98
+ };
99
+ const webhook = await apiClient.put(apiClient.buildPath(`/webhooks/${id}`), body);
59
100
  return jsonResponse(webhook);
60
101
  }));
102
+ server.registerTool("delete_webhook", {
103
+ description: "Delete a webhook",
104
+ inputSchema: {
105
+ id: z.number().int().positive().describe("Webhook ID"),
106
+ },
107
+ }, withErrorHandling(async (args) => {
108
+ const result = await apiClient.delete(apiClient.buildPath(`/webhooks/${args.id}`));
109
+ return jsonResponse(result);
110
+ }));
61
111
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@procurementexpress.com/mcp",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "MCP server for ProcurementExpress API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
- "procurementexpress-mcp": "./dist/index.js"
8
+ "procurementexpress-mcp": "dist/index.js"
9
9
  },
10
10
  "scripts": {
11
11
  "build": "tsc",
@@ -25,14 +25,15 @@
25
25
  "author": "",
26
26
  "license": "ISC",
27
27
  "files": [
28
- "dist"
28
+ "dist",
29
+ ".claude/skills"
29
30
  ],
30
31
  "publishConfig": {
31
32
  "access": "public"
32
33
  },
33
34
  "repository": {
34
35
  "type": "git",
35
- "url": "https://github.com/procurementexpress/mcp.git"
36
+ "url": "git+https://github.com/procurementexpress/mcp.git"
36
37
  },
37
38
  "homepage": "https://github.com/procurementexpress/mcp#readme",
38
39
  "bugs": {