shabaaspay-mcp-server 1.0.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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/dist/api/client.d.ts +60 -0
  3. package/dist/api/client.js +214 -0
  4. package/dist/config/index.d.ts +54 -0
  5. package/dist/config/index.js +79 -0
  6. package/dist/enricher/action-suggester.d.ts +2 -0
  7. package/dist/enricher/action-suggester.js +26 -0
  8. package/dist/enricher/index.d.ts +2 -0
  9. package/dist/enricher/index.js +166 -0
  10. package/dist/enricher/status-analyzer.d.ts +6 -0
  11. package/dist/enricher/status-analyzer.js +71 -0
  12. package/dist/enricher/summary-generator.d.ts +8 -0
  13. package/dist/enricher/summary-generator.js +45 -0
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.js +28 -0
  16. package/dist/security/auth.d.ts +4 -0
  17. package/dist/security/auth.js +30 -0
  18. package/dist/security/policy.d.ts +18 -0
  19. package/dist/security/policy.js +35 -0
  20. package/dist/security/rate-limiter.d.ts +13 -0
  21. package/dist/security/rate-limiter.js +55 -0
  22. package/dist/security/validator.d.ts +6 -0
  23. package/dist/security/validator.js +22 -0
  24. package/dist/server/http-server.d.ts +28 -0
  25. package/dist/server/http-server.js +524 -0
  26. package/dist/server/stdio-server.d.ts +13 -0
  27. package/dist/server/stdio-server.js +114 -0
  28. package/dist/server-http.d.ts +2 -0
  29. package/dist/server-http.js +27 -0
  30. package/dist/tools/auth.d.ts +17 -0
  31. package/dist/tools/auth.js +51 -0
  32. package/dist/tools/index.d.ts +159 -0
  33. package/dist/tools/index.js +14 -0
  34. package/dist/tools/payment-agreements.d.ts +68 -0
  35. package/dist/tools/payment-agreements.js +92 -0
  36. package/dist/tools/payment-initiations.d.ts +84 -0
  37. package/dist/tools/payment-initiations.js +162 -0
  38. package/dist/tools/response-helpers.d.ts +4 -0
  39. package/dist/tools/response-helpers.js +32 -0
  40. package/dist/types/index.d.ts +184 -0
  41. package/dist/types/index.js +80 -0
  42. package/dist/worker.d.ts +15 -0
  43. package/dist/worker.js +767 -0
  44. package/package.json +64 -0
  45. package/readme.md +113 -0
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "shabaaspay-mcp-server",
3
+ "version": "1.0.1",
4
+ "description": "ShaBaas Pay MCP Server - Australian real time payment API for AI applications",
5
+ "keywords": [
6
+ "mcp-server",
7
+ "mcp",
8
+ "shabaaspay",
9
+ "australian-payments",
10
+ "real-time-payments",
11
+ "claude",
12
+ "chatgpt",
13
+ "vscode-copilot",
14
+ "payment-api"
15
+ ],
16
+ "author": "ShaBaas",
17
+ "license": "MIT",
18
+ "homepage": "https://shabaas.com",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/shabaaspay/shabaaspay-mcp-server"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/shabaaspay/shabaaspay-mcp-server/issues"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "mcpName": "io.github.shabaaspay/shabaaspay-payto",
30
+ "main": "dist/index.js",
31
+ "bin": {
32
+ "shabaaspay-mcp": "dist/index.js",
33
+ "shabaaspay-mcp-http": "dist/server-http.js"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "README.md",
38
+ "LICENSE",
39
+ "server.json"
40
+ ],
41
+ "scripts": {
42
+ "build": "tsc",
43
+ "dev:stdio": "tsx watch src/index.ts",
44
+ "dev:http": "tsx watch src/server-http.ts",
45
+ "start:stdio": "node dist/index.js",
46
+ "start:http": "node dist/server-http.js",
47
+ "deploy:cloudflare": "wrangler deploy",
48
+ "inspect": "dotenv -e .env -- npx @modelcontextprotocol/inspector node dist/index.js"
49
+ },
50
+ "dependencies": {
51
+ "@modelcontextprotocol/sdk": "^1.0.0",
52
+ "axios": "^1.6.0",
53
+ "dotenv": "^16.3.0",
54
+ "zod": "^3.22.0",
55
+ "zod-to-json-schema": "^3.23.5"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "^20.0.0",
59
+ "dotenv-cli": "^11.0.0",
60
+ "tsx": "^4.7.0",
61
+ "typescript": "^5.3.0",
62
+ "wrangler": "^4.54.0"
63
+ }
64
+ }
package/readme.md ADDED
@@ -0,0 +1,113 @@
1
+ # ShaBaas Pay MCP Server
2
+
3
+ Australian real time payment processing for AI applications.
4
+
5
+ Connect AI assistants to ShaBaas Pay to create and retrieve PayTo payment agreements with optional enrichment.
6
+
7
+ ## Quick start
8
+
9
+ ### Install
10
+ npm install -g shabaaspay-mcp-server
11
+
12
+ ### Run locally
13
+ shabaaspay-mcp
14
+
15
+ ### Run HTTP (for VS Code / HTTP MCP clients)
16
+ shabaaspay-mcp-http
17
+
18
+ The HTTP server exposes:
19
+ - `GET /health` for health checks
20
+ - `POST /tools/execute` for simple REST execution
21
+ - `POST/GET /mcp` for MCP Streamable HTTP (use this endpoint in VS Code / HTTP clients)
22
+
23
+ Environment (defaults shown):
24
+ - `HTTP_PORT=3000`
25
+ - `HTTP_HOST=0.0.0.0`
26
+ - `MCP_HTTP_API_KEY=` (if empty, HTTP guard is disabled; set a value to lock down access)
27
+ - `API_RATE_LIMIT_PER_MINUTE=60`, `API_RATE_LIMIT_PER_HOUR=1000`
28
+ - `Authorization` header for tool calls: **plain ShaBaas-issued client UUID** (no Bearer prefix). Hosted Worker validates UUID against policy/secrets and fetches/caches the bearer internally.
29
+
30
+ ## Claude Desktop configuration
31
+
32
+ Edit this file:
33
+ %APPDATA%\Claude\claude_desktop_config.json
34
+
35
+ Example:
36
+
37
+ {
38
+ "mcpServers": {
39
+ "shabaaspay": {
40
+ "command": "shabaaspay-mcp",
41
+ "env": {
42
+ "SHABAAS_ENVIRONMENT": "sandbox",
43
+ "SHABAAS_SANDBOX_URL": "<sandbox_api_base_url>",
44
+ "SHABAAS_AUTH_UUID": "your_uuid_here"
45
+ }
46
+ }
47
+ }
48
+ }
49
+
50
+ ## VS Code / MCP HTTP configuration
51
+
52
+ Hosted (staging/prod): point to `https://mcp-staging.shabaas.com/mcp` or `https://mcp.shabaas.com/mcp` and send `Authorization: <client_uuid_issued_by_shabaas>` (plain, no Bearer).
53
+ Local dev: `http://localhost:3000/mcp` with `Authorization: <uuid>` (from your local env).
54
+
55
+ ## LLM integration quickstart
56
+ - **Auth header**: use your ShaBaas-issued client UUID as `Authorization: <uuid>` (plain, no Bearer). Hosted Worker validates it; server manages the bearer internally.
57
+ - **Endpoints**: STDIO (`shabaaspay-mcp`) or HTTP MCP (`http://localhost:3000/mcp`), staging (`https://mcp-staging.shabaas.com/mcp`), production (`https://mcp.shabaas.com/mcp`).
58
+ - **Common calls (curl)**:
59
+ - Get agreement:
60
+ ```bash
61
+ curl -X POST http://localhost:3000/mcp \
62
+ -H "Authorization: <uuid>" \
63
+ -H "Content-Type: application/json" \
64
+ -d '{"tool":"get_payment_agreement","arguments":{"payment_agreement_id":"2882PA20251227045450257","enrich":true}}'
65
+ ```
66
+ - Create agreement:
67
+ ```bash
68
+ curl -X POST http://localhost:3000/mcp \
69
+ -H "Authorization: <uuid>" \
70
+ -H "Content-Type: application/json" \
71
+ -d '{"tool":"create_payment_agreement","arguments":{"name":"Test","type":"email","maximum_amount":"10.00","frequency":"WEEK","number_of_transactions_permitted":1,"pay_id":"sample@shabaas.com"}}'
72
+ ```
73
+ - **Inspector/VS Code**: set MCP URL to `/mcp` and header `Authorization: <uuid>`; list tools then call by name. Enrichment toggles (`enrich`, `include_raw`) are available on payment tools.
74
+
75
+ ## Tool manifest (LLM-friendly)
76
+ - Catalog JSON: `docs/tool-catalog.json` (publishable at a stable URL for ingestion).
77
+ - Tools:
78
+ - `get_auth_token` – fetch bearer (debug; server auto-manages tokens)
79
+ - `create_payment_agreement` – create PayTo agreement
80
+ - `get_payment_agreement` – retrieve agreement with enrichment toggle
81
+ - `initiate_payment` – initiate payment against agreement
82
+ - `get_payment_initiation` – retrieve payment initiation
83
+ - Auth: `Authorization: <uuid>` (plain). Server fetches/caches ShaBaas bearer.
84
+
85
+ ## Auth & rate limits
86
+ - Provide your ShaBaas UUID in the `Authorization` header (plain value, no `Bearer`). The MCP server fetches and caches the ShaBaas bearer internally.
87
+ - HTTP guard is optional via `MCP_HTTP_API_KEY`; leave empty to avoid 403s in local testing.
88
+ - Rate limits: defaults 60/min and 1000/hour; configure with `API_RATE_LIMIT_PER_MINUTE` / `API_RATE_LIMIT_PER_HOUR`.
89
+ - CORS: configure `ALLOWED_ORIGINS` (comma separated) for HTTP clients (e.g., Inspector UI).
90
+
91
+ ## Enrichment toggle
92
+ Tools support `enrich` (default true) and `include_raw` (default false) to control business context and raw payloads. Set `enrich: false` for lean responses.
93
+
94
+ ## Available tools
95
+
96
+ Payment agreements
97
+ 1. create_payment_agreement
98
+ 2. get_payment_agreement
99
+
100
+ Authentication helper
101
+ 1. get_auth_token
102
+
103
+ ## Examples
104
+
105
+ See examples/basic.md
106
+
107
+ ## Documentation
108
+ 1. docs/installation.md
109
+ 2. docs/authentication.md
110
+ 3. docs/api-reference.md
111
+
112
+ ## License
113
+ MIT, see LICENSE