@payware/mcp-server 1.3.0 → 1.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.
Files changed (127) hide show
  1. package/.env.example +0 -0
  2. package/LICENSE +21 -0
  3. package/README.md +2 -0
  4. package/check-keys.js +0 -0
  5. package/keys/README.md +0 -0
  6. package/mcp-config.json +0 -0
  7. package/package.json +8 -4
  8. package/payware-mcp-config.json +0 -0
  9. package/src/auth/rsa-keys.js +0 -0
  10. package/src/auth/sandbox-setup.js +0 -0
  11. package/src/config/env.js +0 -0
  12. package/src/config/partner-types.js +0 -0
  13. package/src/core/auth/jwt-factory.js +0 -0
  14. package/src/core/auth/jwt-token.js +0 -0
  15. package/src/core/utils/json-serializer.js +0 -0
  16. package/src/core/utils/key-utils.js +0 -0
  17. package/src/index.js +0 -0
  18. package/src/isv/data/index.js +0 -0
  19. package/src/isv/deep-links/delete-product-link.js +0 -0
  20. package/src/isv/deep-links/delete-transaction-link.js +0 -0
  21. package/src/isv/deep-links/get-product-link.js +0 -0
  22. package/src/isv/deep-links/get-transaction-link.js +0 -0
  23. package/src/isv/deep-links/index.js +0 -0
  24. package/src/isv/index.js +0 -0
  25. package/src/isv/invitations/index.js +0 -0
  26. package/src/isv/oauth2/create-token-simple.js +0 -0
  27. package/src/isv/oauth2/get-token-info.js +0 -0
  28. package/src/isv/oauth2/obtain-token.js +0 -0
  29. package/src/isv/oauth2/token-helper.js +0 -0
  30. package/src/isv/poi/cancel-price.js +0 -0
  31. package/src/isv/poi/create.js +0 -0
  32. package/src/isv/poi/get-poi.js +0 -0
  33. package/src/isv/poi/get-qrcode.js +0 -0
  34. package/src/isv/poi/get-status.js +0 -0
  35. package/src/isv/poi/index.js +0 -0
  36. package/src/isv/poi/list-pois.js +0 -0
  37. package/src/isv/poi/set-price.js +0 -0
  38. package/src/isv/products/audios.js +0 -0
  39. package/src/isv/products/create-product.js +0 -0
  40. package/src/isv/products/delete-product.js +0 -0
  41. package/src/isv/products/get-product-image.js +0 -0
  42. package/src/isv/products/get-product.js +0 -0
  43. package/src/isv/products/index.js +0 -0
  44. package/src/isv/products/list-products.js +0 -0
  45. package/src/isv/products/schedules.js +0 -0
  46. package/src/isv/products/update-product.js +0 -0
  47. package/src/isv/reference/index.js +0 -0
  48. package/src/isv/shops/index.js +0 -0
  49. package/src/isv/transactions/cancel-transaction.js +0 -0
  50. package/src/isv/transactions/create-transaction.js +0 -0
  51. package/src/isv/transactions/get-status.js +0 -0
  52. package/src/isv/transactions/process-transaction.js +0 -0
  53. package/src/isv/transactions/simulate-callback.js +0 -0
  54. package/src/isv/transactions/transaction-history.js +0 -0
  55. package/src/isv/utils/auth.js +0 -0
  56. package/src/mcp-proxy.js +0 -0
  57. package/src/merchant/data/export-report.js +0 -0
  58. package/src/merchant/data/generate-report.js +0 -0
  59. package/src/merchant/data/get-export-list.js +0 -0
  60. package/src/merchant/data/get-report-requests.js +0 -0
  61. package/src/merchant/data/get-report-status.js +0 -0
  62. package/src/merchant/data/index.js +0 -0
  63. package/src/merchant/data/list-reports.js +0 -0
  64. package/src/merchant/deep-links/delete-product-link.js +0 -0
  65. package/src/merchant/deep-links/delete-transaction-link.js +0 -0
  66. package/src/merchant/deep-links/get-product-link.js +0 -0
  67. package/src/merchant/deep-links/get-transaction-link.js +0 -0
  68. package/src/merchant/deep-links/index.js +0 -0
  69. package/src/merchant/index.js +0 -0
  70. package/src/merchant/logs/index.js +0 -0
  71. package/src/merchant/products/audios.js +0 -0
  72. package/src/merchant/products/create-product.js +0 -0
  73. package/src/merchant/products/delete-product.js +0 -0
  74. package/src/merchant/products/get-product-image.js +0 -0
  75. package/src/merchant/products/get-product.js +0 -0
  76. package/src/merchant/products/index.js +0 -0
  77. package/src/merchant/products/list-products.js +0 -0
  78. package/src/merchant/products/schedules.js +0 -0
  79. package/src/merchant/products/update-product.js +0 -0
  80. package/src/merchant/shops/index.js +0 -0
  81. package/src/merchant/transactions/cancel-transaction.js +0 -0
  82. package/src/merchant/transactions/create-transaction.js +0 -0
  83. package/src/merchant/transactions/get-status.js +0 -0
  84. package/src/merchant/transactions/process-transaction.js +0 -0
  85. package/src/merchant/transactions/simulate-callback.js +0 -0
  86. package/src/merchant/transactions/transaction-history.js +0 -0
  87. package/src/payment-institution/data/index.js +0 -0
  88. package/src/payment-institution/deep-links/delete-transaction-link.js +0 -0
  89. package/src/payment-institution/deep-links/get-transaction-link.js +0 -0
  90. package/src/payment-institution/deep-links/index.js +0 -0
  91. package/src/payment-institution/index.js +0 -0
  92. package/src/payment-institution/transactions/create-pi-transaction.js +0 -0
  93. package/src/payment-institution/transactions/finalize-transaction.js +0 -0
  94. package/src/payment-institution/transactions/get-transaction-history.js +0 -0
  95. package/src/payment-institution/transactions/get-transaction-status.js +0 -0
  96. package/src/payment-institution/transactions/process-pi-transaction.js +0 -0
  97. package/src/payment-institution/transactions/simulate-pi-callback.js +0 -0
  98. package/src/payment-institution/transactions/soundbite-transaction.js +0 -0
  99. package/src/proxy-server.js +25 -4
  100. package/src/shared/api-errors.js +0 -0
  101. package/src/shared/auth-headers.js +0 -0
  102. package/src/shared/data/data-api.js +0 -0
  103. package/src/shared/deep-links/api.js +0 -0
  104. package/src/shared/index.js +0 -0
  105. package/src/shared/logs/logs-api.js +0 -0
  106. package/src/shared/poi/poi-create-api.js +0 -0
  107. package/src/shared/products/products-api.js +0 -0
  108. package/src/shared/shops/shops-api.js +0 -0
  109. package/src/tools/advanced-code-generator.js +0 -0
  110. package/src/utils/code-examples/common/auth-examples.js +0 -0
  111. package/src/utils/code-examples/common/helpers.js +0 -0
  112. package/src/utils/code-examples/common/utils-examples.js +0 -0
  113. package/src/utils/code-examples/frameworks/examples.js +0 -0
  114. package/src/utils/code-examples/index.js +0 -0
  115. package/src/utils/code-examples/isv/oauth2.js +0 -0
  116. package/src/utils/code-examples/isv/products.js +0 -0
  117. package/src/utils/code-examples/isv/transactions.js +0 -0
  118. package/src/utils/code-examples/merchant/products.js +0 -0
  119. package/src/utils/code-examples/merchant/transactions.js +0 -0
  120. package/src/utils/code-examples/payment-institution/transactions.js +0 -0
  121. package/src/utils/code-examples/shared/data.js +0 -0
  122. package/src/utils/code-examples/shared/deep-links.js +0 -0
  123. package/src/utils/code-examples/shared/soundbites.js +0 -0
  124. package/src/utils/code-examples.js +0 -0
  125. package/src/utils/format-request.js +0 -0
  126. package/src/utils/json-formatter.js +0 -0
  127. package/src/utils/server-info.js +0 -0
package/.env.example CHANGED
File without changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 payware LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  Official MCP (Model Context Protocol) server for payware payment API integration. This server enables AI assistants to interact with payware APIs, automating integration workflows for all partner types.
6
6
 
7
+ Releases are published to npm as `@payware/mcp-server` and to the official [MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.payware/mcp-server`. MIT licensed, see [LICENSE](LICENSE).
8
+
7
9
  ## Who Is This For?
8
10
 
9
11
  - **Merchants** - Accept payments, manage products, generate transaction reports
package/check-keys.js CHANGED
File without changes
package/keys/README.md CHANGED
File without changes
package/mcp-config.json CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@payware/mcp-server",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
+ "mcpName": "io.github.payware/mcp-server",
4
5
  "description": "Official MCP server for payware payment API integration",
5
6
  "main": "src/index.js",
6
7
  "type": "module",
@@ -36,15 +37,18 @@
36
37
  "model-context-protocol",
37
38
  "payware",
38
39
  "payments",
39
- "payment-gateway",
40
- "payment-processing",
41
40
  "api",
42
41
  "fintech",
43
42
  "pos",
44
43
  "terminal",
45
44
  "merchant",
46
45
  "isv",
47
- "oauth2"
46
+ "oauth2",
47
+ "a2a-payments",
48
+ "account-to-account",
49
+ "instant-payments",
50
+ "transaction-resolution",
51
+ "qr-code-payments"
48
52
  ],
49
53
  "author": "payware <support@payware.com>",
50
54
  "license": "MIT",
File without changes
File without changes
File without changes
package/src/config/env.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/isv/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/mcp-proxy.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -25,9 +25,16 @@ class PaywareMCPProxy {
25
25
  }
26
26
 
27
27
  setupMiddleware() {
28
- // Enable CORS for all routes
28
+ // SEC-018: CORS was `origin: true` with credentials - it reflected ANY requesting origin, so any
29
+ // web page the operator visited could drive these routes from their browser. The routes below
30
+ // mint JWTs with the configured partner's private key and call the payware API as that partner,
31
+ // so this is not a cosmetic default. Restricted to explicit local origins; set
32
+ // PAYWARE_MCP_PROXY_ORIGINS (comma-separated) to widen it deliberately.
33
+ const allowedOrigins = (process.env.PAYWARE_MCP_PROXY_ORIGINS
34
+ || `http://localhost:${this.port},http://127.0.0.1:${this.port}`)
35
+ .split(',').map((o) => o.trim()).filter(Boolean);
29
36
  this.app.use(cors({
30
- origin: true,
37
+ origin: allowedOrigins,
31
38
  credentials: true
32
39
  }));
33
40
 
@@ -168,8 +175,22 @@ class PaywareMCPProxy {
168
175
  }
169
176
 
170
177
  async start() {
171
- this.app.listen(this.port, '0.0.0.0', () => {
172
- console.log(`🚀 payware MCP Proxy Server running on http://0.0.0.0:${this.port}`);
178
+ // SEC-018: loopback by default. This bound 0.0.0.0 - every interface - with no authentication on
179
+ // /tools, /tools/:toolName or /mcp, each of which spawns the MCP server with the process env
180
+ // (PAYWARE_PARTNER_ID and the sandbox/production private key paths) and can therefore sign as
181
+ // that partner. On a shared dev host or an office LAN that is partner impersonation over plain
182
+ // HTTP, and with a production key it is total. The stdio transport (mcp-proxy.js) is the normal
183
+ // path and opens no socket at all.
184
+ //
185
+ // A wider bind is now an explicit opt-in via PAYWARE_MCP_PROXY_HOST, so exposing it is a
186
+ // decision someone made rather than the default they inherited.
187
+ const host = process.env.PAYWARE_MCP_PROXY_HOST || '127.0.0.1';
188
+ if (host !== '127.0.0.1' && host !== 'localhost') {
189
+ console.warn(`⚠️ MCP proxy binding ${host} - these routes are UNAUTHENTICATED and can sign as `
190
+ + `the configured partner. Only do this on a network you control.`);
191
+ }
192
+ this.app.listen(this.port, host, () => {
193
+ console.log(`🚀 payware MCP Proxy Server running on http://${host}:${this.port}`);
173
194
  console.log(`📚 API Documentation: http://localhost:${this.port}`);
174
195
  console.log(`🔧 Health Check: http://localhost:${this.port}/health`);
175
196
  console.log(`🛠️ Tools List: http://localhost:${this.port}/tools`);
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes