@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.
- package/.env.example +0 -0
- package/LICENSE +21 -0
- package/README.md +2 -0
- package/check-keys.js +0 -0
- package/keys/README.md +0 -0
- package/mcp-config.json +0 -0
- package/package.json +8 -4
- package/payware-mcp-config.json +0 -0
- package/src/auth/rsa-keys.js +0 -0
- package/src/auth/sandbox-setup.js +0 -0
- package/src/config/env.js +0 -0
- package/src/config/partner-types.js +0 -0
- package/src/core/auth/jwt-factory.js +0 -0
- package/src/core/auth/jwt-token.js +0 -0
- package/src/core/utils/json-serializer.js +0 -0
- package/src/core/utils/key-utils.js +0 -0
- package/src/index.js +0 -0
- package/src/isv/data/index.js +0 -0
- package/src/isv/deep-links/delete-product-link.js +0 -0
- package/src/isv/deep-links/delete-transaction-link.js +0 -0
- package/src/isv/deep-links/get-product-link.js +0 -0
- package/src/isv/deep-links/get-transaction-link.js +0 -0
- package/src/isv/deep-links/index.js +0 -0
- package/src/isv/index.js +0 -0
- package/src/isv/invitations/index.js +0 -0
- package/src/isv/oauth2/create-token-simple.js +0 -0
- package/src/isv/oauth2/get-token-info.js +0 -0
- package/src/isv/oauth2/obtain-token.js +0 -0
- package/src/isv/oauth2/token-helper.js +0 -0
- package/src/isv/poi/cancel-price.js +0 -0
- package/src/isv/poi/create.js +0 -0
- package/src/isv/poi/get-poi.js +0 -0
- package/src/isv/poi/get-qrcode.js +0 -0
- package/src/isv/poi/get-status.js +0 -0
- package/src/isv/poi/index.js +0 -0
- package/src/isv/poi/list-pois.js +0 -0
- package/src/isv/poi/set-price.js +0 -0
- package/src/isv/products/audios.js +0 -0
- package/src/isv/products/create-product.js +0 -0
- package/src/isv/products/delete-product.js +0 -0
- package/src/isv/products/get-product-image.js +0 -0
- package/src/isv/products/get-product.js +0 -0
- package/src/isv/products/index.js +0 -0
- package/src/isv/products/list-products.js +0 -0
- package/src/isv/products/schedules.js +0 -0
- package/src/isv/products/update-product.js +0 -0
- package/src/isv/reference/index.js +0 -0
- package/src/isv/shops/index.js +0 -0
- package/src/isv/transactions/cancel-transaction.js +0 -0
- package/src/isv/transactions/create-transaction.js +0 -0
- package/src/isv/transactions/get-status.js +0 -0
- package/src/isv/transactions/process-transaction.js +0 -0
- package/src/isv/transactions/simulate-callback.js +0 -0
- package/src/isv/transactions/transaction-history.js +0 -0
- package/src/isv/utils/auth.js +0 -0
- package/src/mcp-proxy.js +0 -0
- package/src/merchant/data/export-report.js +0 -0
- package/src/merchant/data/generate-report.js +0 -0
- package/src/merchant/data/get-export-list.js +0 -0
- package/src/merchant/data/get-report-requests.js +0 -0
- package/src/merchant/data/get-report-status.js +0 -0
- package/src/merchant/data/index.js +0 -0
- package/src/merchant/data/list-reports.js +0 -0
- package/src/merchant/deep-links/delete-product-link.js +0 -0
- package/src/merchant/deep-links/delete-transaction-link.js +0 -0
- package/src/merchant/deep-links/get-product-link.js +0 -0
- package/src/merchant/deep-links/get-transaction-link.js +0 -0
- package/src/merchant/deep-links/index.js +0 -0
- package/src/merchant/index.js +0 -0
- package/src/merchant/logs/index.js +0 -0
- package/src/merchant/products/audios.js +0 -0
- package/src/merchant/products/create-product.js +0 -0
- package/src/merchant/products/delete-product.js +0 -0
- package/src/merchant/products/get-product-image.js +0 -0
- package/src/merchant/products/get-product.js +0 -0
- package/src/merchant/products/index.js +0 -0
- package/src/merchant/products/list-products.js +0 -0
- package/src/merchant/products/schedules.js +0 -0
- package/src/merchant/products/update-product.js +0 -0
- package/src/merchant/shops/index.js +0 -0
- package/src/merchant/transactions/cancel-transaction.js +0 -0
- package/src/merchant/transactions/create-transaction.js +0 -0
- package/src/merchant/transactions/get-status.js +0 -0
- package/src/merchant/transactions/process-transaction.js +0 -0
- package/src/merchant/transactions/simulate-callback.js +0 -0
- package/src/merchant/transactions/transaction-history.js +0 -0
- package/src/payment-institution/data/index.js +0 -0
- package/src/payment-institution/deep-links/delete-transaction-link.js +0 -0
- package/src/payment-institution/deep-links/get-transaction-link.js +0 -0
- package/src/payment-institution/deep-links/index.js +0 -0
- package/src/payment-institution/index.js +0 -0
- package/src/payment-institution/transactions/create-pi-transaction.js +0 -0
- package/src/payment-institution/transactions/finalize-transaction.js +0 -0
- package/src/payment-institution/transactions/get-transaction-history.js +0 -0
- package/src/payment-institution/transactions/get-transaction-status.js +0 -0
- package/src/payment-institution/transactions/process-pi-transaction.js +0 -0
- package/src/payment-institution/transactions/simulate-pi-callback.js +0 -0
- package/src/payment-institution/transactions/soundbite-transaction.js +0 -0
- package/src/proxy-server.js +25 -4
- package/src/shared/api-errors.js +0 -0
- package/src/shared/auth-headers.js +0 -0
- package/src/shared/data/data-api.js +0 -0
- package/src/shared/deep-links/api.js +0 -0
- package/src/shared/index.js +0 -0
- package/src/shared/logs/logs-api.js +0 -0
- package/src/shared/poi/poi-create-api.js +0 -0
- package/src/shared/products/products-api.js +0 -0
- package/src/shared/shops/shops-api.js +0 -0
- package/src/tools/advanced-code-generator.js +0 -0
- package/src/utils/code-examples/common/auth-examples.js +0 -0
- package/src/utils/code-examples/common/helpers.js +0 -0
- package/src/utils/code-examples/common/utils-examples.js +0 -0
- package/src/utils/code-examples/frameworks/examples.js +0 -0
- package/src/utils/code-examples/index.js +0 -0
- package/src/utils/code-examples/isv/oauth2.js +0 -0
- package/src/utils/code-examples/isv/products.js +0 -0
- package/src/utils/code-examples/isv/transactions.js +0 -0
- package/src/utils/code-examples/merchant/products.js +0 -0
- package/src/utils/code-examples/merchant/transactions.js +0 -0
- package/src/utils/code-examples/payment-institution/transactions.js +0 -0
- package/src/utils/code-examples/shared/data.js +0 -0
- package/src/utils/code-examples/shared/deep-links.js +0 -0
- package/src/utils/code-examples/shared/soundbites.js +0 -0
- package/src/utils/code-examples.js +0 -0
- package/src/utils/format-request.js +0 -0
- package/src/utils/json-formatter.js +0 -0
- 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.
|
|
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",
|
package/payware-mcp-config.json
CHANGED
|
File without changes
|
package/src/auth/rsa-keys.js
CHANGED
|
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
|
package/src/isv/data/index.js
CHANGED
|
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
|
package/src/isv/poi/create.js
CHANGED
|
File without changes
|
package/src/isv/poi/get-poi.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/isv/poi/index.js
CHANGED
|
File without changes
|
package/src/isv/poi/list-pois.js
CHANGED
|
File without changes
|
package/src/isv/poi/set-price.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
|
package/src/isv/shops/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/utils/auth.js
CHANGED
|
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
|
package/src/merchant/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
|
package/src/proxy-server.js
CHANGED
|
@@ -25,9 +25,16 @@ class PaywareMCPProxy {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
setupMiddleware() {
|
|
28
|
-
//
|
|
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:
|
|
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
|
-
|
|
172
|
-
|
|
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`);
|
package/src/shared/api-errors.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/shared/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
|
package/src/utils/server-info.js
CHANGED
|
File without changes
|