@calixpay/mcp 0.0.0-stage → 1.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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +73 -2
  3. package/index.mjs +109 -0
  4. package/package.json +19 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Calix Pay
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
@@ -1,3 +1,74 @@
1
- # Temporary Holding Version
1
+ # Calix Pay MCP server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Let an AI agent accept payments through **Calix Pay** as native tools — create hosted checkout sessions, charge cards and ACH, and fetch the in-app tokenization config. Works with Claude Desktop, Cursor, and any MCP-compatible client.
4
+
5
+ Calix Pay is a Stripe-style payments API for apps, platforms, marketplaces, and high-risk/specialty businesses. White-label, developer-first, AI-ready.
6
+
7
+ ## Tools
8
+
9
+ | Tool | What it does |
10
+ | --- | --- |
11
+ | `create_checkout_session` | Create a hosted checkout URL (one-time or subscription). Simplest, zero-PCI. |
12
+ | `create_charge` | Charge a tokenized card (token from Calix Pay.js). Idempotent. |
13
+ | `create_ach_charge` | Charge a bank account via ACH. Idempotent. |
14
+ | `get_client_config` | Get the Calix Pay.js tokenization key + script URL for in-browser tokenization. |
15
+
16
+ ## Setup
17
+
18
+ You need a Calix Pay API key from your dashboard → **Developers → API keys**.
19
+ - `sk_test_…` = **sandbox** (no real money) — use while building.
20
+ - `sk_live_…` = **live** (real charges) — swap in for production, no other changes.
21
+
22
+ ### Install
23
+
24
+ ```bash
25
+ cd mcp
26
+ npm install
27
+ ```
28
+
29
+ ### Claude Desktop
30
+
31
+ Add to `claude_desktop_config.json` (Settings → Developer → Edit Config):
32
+
33
+ ```json
34
+ {
35
+ "mcpServers": {
36
+ "calixpay": {
37
+ "command": "node",
38
+ "args": ["/absolute/path/to/mcp/index.mjs"],
39
+ "env": { "CALIXPAY_API_KEY": "sk_test_your_key" }
40
+ }
41
+ }
42
+ }
43
+ ```
44
+
45
+ ### Cursor
46
+
47
+ Add to `~/.cursor/mcp.json` (or project `.cursor/mcp.json`):
48
+
49
+ ```json
50
+ {
51
+ "mcpServers": {
52
+ "calixpay": {
53
+ "command": "node",
54
+ "args": ["/absolute/path/to/mcp/index.mjs"],
55
+ "env": { "CALIXPAY_API_KEY": "sk_test_your_key" }
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ Restart the client, and your agent can call the Calix Pay tools directly — e.g. "create a $29.99 checkout session for a Pro plan and give me the URL."
62
+
63
+ ## Environment
64
+
65
+ | Var | Required | Default |
66
+ | --- | --- | --- |
67
+ | `CALIXPAY_API_KEY` | yes | — |
68
+ | `CALIXPAY_API_BASE` | no | `https://api.calixpay.co/api/v1` |
69
+
70
+ ## Notes
71
+
72
+ - Keep your `sk_live_` key private — treat it like a password. The server reads it from the environment; it is never logged.
73
+ - Charges are automatically sent with a unique idempotency key, so a retried tool call never double-charges.
74
+ - Full REST reference: <https://calixpay.co/openapi.json> · integration guide: <https://calixpay.co/llms-full.txt>
package/index.mjs ADDED
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Calix Pay MCP server.
4
+ *
5
+ * Exposes Calix Pay's payment API as MCP tools so an AI agent (Claude Desktop,
6
+ * Cursor, etc.) can create checkout sessions, charge cards/ACH, and fetch the
7
+ * in-app tokenization config — all with the merchant's own API key.
8
+ *
9
+ * Config (environment):
10
+ * CALIXPAY_API_KEY required — your secret key (sk_test_… sandbox, sk_live_… live)
11
+ * CALIXPAY_API_BASE optional — defaults to https://api.calixpay.co/api/v1
12
+ *
13
+ * The key decides the mode: sk_test_ = sandbox (no real money), sk_live_ = real.
14
+ */
15
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
16
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
17
+ import { z } from 'zod';
18
+ import { randomUUID } from 'node:crypto';
19
+
20
+ const API_BASE = (process.env.CALIXPAY_API_BASE || 'https://api.calixpay.co/api/v1').replace(/\/$/, '');
21
+ const API_KEY = process.env.CALIXPAY_API_KEY || '';
22
+
23
+ async function call(method, path, { body, idempotent } = {}) {
24
+ if (!API_KEY) {
25
+ return { ok: false, text: 'CALIXPAY_API_KEY is not set. Add your Calix Pay secret key (sk_test_… or sk_live_…) to the server environment.' };
26
+ }
27
+ const headers = { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' };
28
+ if (idempotent) headers['Idempotency-Key'] = randomUUID();
29
+ let res, json;
30
+ try {
31
+ res = await fetch(`${API_BASE}${path}`, { method, headers, body: body ? JSON.stringify(body) : undefined });
32
+ const raw = await res.text();
33
+ try { json = JSON.parse(raw); } catch { json = raw; }
34
+ } catch (err) {
35
+ return { ok: false, text: `Request failed: ${err?.message || err}` };
36
+ }
37
+ const text = typeof json === 'string' ? json : JSON.stringify(json, null, 2);
38
+ return { ok: res.ok, text: res.ok ? text : `HTTP ${res.status}: ${text}` };
39
+ }
40
+
41
+ const result = (r) => ({ content: [{ type: 'text', text: r.text }], isError: !r.ok });
42
+
43
+ const server = new McpServer({ name: 'calixpay', version: '1.0.0' });
44
+
45
+ server.tool(
46
+ 'create_checkout_session',
47
+ 'Create a Calix Pay hosted checkout session and get a URL to redirect the customer to. Use for the simplest, zero-PCI flow. mode "payment" for one-time, "subscription" for recurring.',
48
+ {
49
+ amount: z.number().positive().optional().describe('Amount in dollars (one-time) — or use planId.'),
50
+ planId: z.string().optional().describe('A saved plan id (for subscriptions).'),
51
+ mode: z.enum(['payment', 'subscription']).default('payment'),
52
+ productName: z.string().optional(),
53
+ currency: z.string().default('USD'),
54
+ email: z.string().email().optional(),
55
+ clientReferenceId: z.string().optional().describe('Your order id — echoed back on the webhook.'),
56
+ successUrl: z.string().url().optional(),
57
+ cancelUrl: z.string().url().optional(),
58
+ },
59
+ async (args) => result(await call('POST', '/checkout/sessions', { body: args })),
60
+ );
61
+
62
+ server.tool(
63
+ 'create_charge',
64
+ 'Charge a tokenized card. Pass a one-time paymentToken from Calix Pay.js (never a raw card number). Idempotent automatically.',
65
+ {
66
+ amount: z.number().positive().describe('Amount in dollars.'),
67
+ paymentToken: z.string().describe('One-time token from Calix Pay.js.'),
68
+ email: z.string().email().optional(),
69
+ description: z.string().optional(),
70
+ },
71
+ async ({ amount, paymentToken, email, description }) =>
72
+ result(await call('POST', '/charges', {
73
+ idempotent: true,
74
+ body: { amount, paymentToken, description, customerInfo: email ? { email } : undefined },
75
+ })),
76
+ );
77
+
78
+ server.tool(
79
+ 'create_ach_charge',
80
+ 'Charge a bank account via ACH (no card). Idempotent automatically.',
81
+ {
82
+ amount: z.number().positive().describe('Amount in dollars.'),
83
+ routingNumber: z.string(),
84
+ accountNumber: z.string(),
85
+ accountHolderName: z.string(),
86
+ accountType: z.enum(['checking', 'savings']).default('checking'),
87
+ email: z.string().email().optional(),
88
+ },
89
+ async ({ amount, routingNumber, accountNumber, accountHolderName, accountType, email }) =>
90
+ result(await call('POST', '/charges', {
91
+ idempotent: true,
92
+ body: {
93
+ amount, paymentMethod: 'ach',
94
+ paymentDetails: { routingNumber, accountNumber, accountHolderName, accountType },
95
+ customerInfo: email ? { email } : undefined,
96
+ },
97
+ })),
98
+ );
99
+
100
+ server.tool(
101
+ 'get_client_config',
102
+ 'Get the Calix Pay.js tokenization key + script URL for in-browser card tokenization (PCI SAQ-A). Load these in a checkout page to tokenize a card, then charge the token with create_charge.',
103
+ {},
104
+ async () => result(await call('GET', '/client-config')),
105
+ );
106
+
107
+ const transport = new StdioServerTransport();
108
+ await server.connect(transport);
109
+ console.error(`Calix Pay MCP server running (base ${API_BASE}, key ${API_KEY ? API_KEY.slice(0, 8) + '…' : 'NOT SET'}).`);
package/package.json CHANGED
@@ -1,6 +1,21 @@
1
1
  {
2
2
  "name": "@calixpay/mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Calix Pay MCP server — let an AI agent accept payments (checkout, charges, ACH, tokenization) via Calix Pay.",
5
+ "type": "module",
6
+ "bin": { "calixpay-mcp": "./index.mjs" },
7
+ "main": "./index.mjs",
8
+ "files": ["index.mjs", "README.md", "LICENSE"],
9
+ "engines": { "node": ">=18" },
10
+ "keywords": ["calixpay", "payments", "mcp", "model-context-protocol", "stripe-alternative", "high-risk", "vibe-coding"],
11
+ "license": "MIT",
12
+ "author": "Calix Pay",
13
+ "homepage": "https://calixpay.co",
14
+ "repository": { "type": "git", "url": "https://github.com/GetAgentPulse/calixpay", "directory": "mcp" },
15
+ "bugs": { "url": "https://calixpay.co" },
16
+ "publishConfig": { "access": "public" },
17
+ "dependencies": {
18
+ "@modelcontextprotocol/sdk": "^1.4.0",
19
+ "zod": "^3.23.8"
20
+ }
21
+ }