receiptrail-mcp 0.2.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.
- package/README.md +45 -0
- package/mcp-server.mjs +32 -0
- package/package.json +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# receiptrail-mcp
|
|
2
|
+
|
|
3
|
+
**ReceiptRail** MCP server (stdio bridge) — issue and verify **on-chain x402 delivery receipts on Solana**.
|
|
4
|
+
|
|
5
|
+
Hash-locked, escrow-grade, independently verifiable proof of delivery for AI-agent payments. After an x402 settlement, sellers anchor a SHA-256 digest of the delivered content on Solana; buyers verify it offline, forever, with zero trust in the issuer.
|
|
6
|
+
|
|
7
|
+
## Quick start (Claude Desktop / any stdio MCP client)
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"mcpServers": {
|
|
12
|
+
"receiptrail": {
|
|
13
|
+
"command": "npx",
|
|
14
|
+
"args": ["-y", "receiptrail-mcp"]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Remote MCP clients (streamable-http) can connect directly — no npm needed:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
https://agenttoll-receipts.app.workbuddy.host/mcp
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Tools
|
|
27
|
+
|
|
28
|
+
| Tool | Cost | What it does |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| `issue_receipt` | 0.001 USDC via x402 (founding sellers: first 10 free for 30 days) | Anchor a SHA-256 digest of delivered content + settlement reference on Solana. Omit the payment signature to receive the x402 challenge first. Poll `get_receipt` until `outcome === "settled"`. |
|
|
31
|
+
| `verify_receipt` | free | Verify a receipt against live Solana state: PDA owner must be the ReceiptRail program, stored digest and payment ref must match. |
|
|
32
|
+
| `get_receipt` | free | Full receipt details by `receipt_id` or `x402_payment_ref` (payment_ref always resolves on-chain). |
|
|
33
|
+
|
|
34
|
+
## Why not just app-layer signed receipts?
|
|
35
|
+
|
|
36
|
+
Verification requires **no trust in the issuer**: the receipt lives in a Solana PDA owned by the ReceiptRail program (`8ACN1KNEFXM2N2FMzxTfAzB1c3g5n47ZuhbPoUXPnCTp`); anyone can re-derive and check the digests offline, forever.
|
|
37
|
+
|
|
38
|
+
## Links
|
|
39
|
+
|
|
40
|
+
- Open spec: https://github.com/xka0085-byte/agenttoll/blob/master/docs/specs/x402-receipts-draft.md
|
|
41
|
+
- Pricing: https://agenttoll-receipts.app.workbuddy.host/
|
|
42
|
+
- Official MCP Registry: `io.github.xka0085-byte/receiptrail`
|
|
43
|
+
- Contact: Telegram @EidonZe
|
|
44
|
+
|
|
45
|
+
MIT licensed. Chain: Solana (devnet during rollout, mainnet-beta at GA).
|
package/mcp-server.mjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// ReceiptRail MCP stdio wrapper — bridges stdio JSON-RPC to the remote ReceiptRail MCP endpoint.
|
|
3
|
+
// Lets MCP clients that only support stdio (e.g. older Claude Desktop configs) use ReceiptRail.
|
|
4
|
+
// Zero dependencies (Node 18+).
|
|
5
|
+
import { createInterface } from 'node:readline';
|
|
6
|
+
|
|
7
|
+
const REMOTE = process.env.RECEIPTRAIL_URL ?? 'https://agenttoll-receipts.app.workbuddy.host/mcp';
|
|
8
|
+
|
|
9
|
+
async function callRemote(method, params) {
|
|
10
|
+
const res = await fetch(REMOTE, {
|
|
11
|
+
method: 'POST',
|
|
12
|
+
headers: { 'content-type': 'application/json', accept: 'application/json, text/event-stream' },
|
|
13
|
+
body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),
|
|
14
|
+
signal: AbortSignal.timeout(60000),
|
|
15
|
+
});
|
|
16
|
+
return res.json();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const rl = createInterface({ input: process.stdin });
|
|
20
|
+
const write = (msg) => process.stdout.write(`${JSON.stringify(msg)}\n`);
|
|
21
|
+
|
|
22
|
+
rl.on('line', async (line) => {
|
|
23
|
+
let rpc;
|
|
24
|
+
try { rpc = JSON.parse(line); } catch { return; }
|
|
25
|
+
if (rpc.method?.startsWith('notifications/')) return; // stateless remote; drop notifications
|
|
26
|
+
try {
|
|
27
|
+
const back = await callRemote(rpc.method, rpc.params);
|
|
28
|
+
write({ jsonrpc: '2.0', id: rpc.id, ...(back.result ? { result: back.result } : { error: back.error ?? { code: -32603, message: 'remote error' } }) });
|
|
29
|
+
} catch (error) {
|
|
30
|
+
write({ jsonrpc: '2.0', id: rpc.id, error: { code: -32603, message: `receiptrail bridge error: ${error.message}` } });
|
|
31
|
+
}
|
|
32
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "receiptrail-mcp",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "ReceiptRail MCP (stdio bridge): issue and verify on-chain x402 delivery receipts on Solana. Hash-locked, verifiable proof of delivery for AI agent payments.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": { "receiptrail-mcp": "mcp-server.mjs" },
|
|
8
|
+
"main": "mcp-server.mjs",
|
|
9
|
+
"files": ["mcp-server.mjs", "README.md"],
|
|
10
|
+
"keywords": ["x402", "mcp", "receipt", "escrow", "solana", "usdc", "proof-of-delivery", "agent-payments", "receiptrail"],
|
|
11
|
+
"engines": { "node": ">=18" },
|
|
12
|
+
"repository": { "type": "git", "url": "git+https://github.com/xka0085-byte/agenttoll.git" },
|
|
13
|
+
"homepage": "https://agenttoll-receipts.app.workbuddy.host/"
|
|
14
|
+
}
|