@useagentpay/mcp-server 0.1.2 → 0.1.4

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 ADDED
@@ -0,0 +1,124 @@
1
+ # @useagentpay/mcp-server
2
+
3
+ MCP server for [AgentPay](https://github.com/kar69-96/useagentpay) — exposes the full payment lifecycle to any MCP-compatible AI host (Claude Desktop, Cursor, Claude Code, Windsurf).
4
+
5
+ 8 tools, 3 resources, 3 prompts. Agents can propose purchases, wait for human approval, execute checkout, and retrieve receipts — all over the Model Context Protocol.
6
+
7
+ ## Install & Run
8
+
9
+ ```bash
10
+ npx @useagentpay/mcp-server # stdio (default)
11
+ npx @useagentpay/mcp-server --http # HTTP transport
12
+ ```
13
+
14
+ Or via the AgentPay CLI:
15
+ ```bash
16
+ agentpay mcp # stdio
17
+ agentpay mcp --http # HTTP
18
+ ```
19
+
20
+ ## Host Configuration
21
+
22
+ Add to your Claude Desktop, Cursor, or Claude Code config:
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "agentpay": {
28
+ "command": "npx",
29
+ "args": ["@useagentpay/mcp-server"]
30
+ }
31
+ }
32
+ }
33
+ ```
34
+
35
+ ### With passphrase (for execute)
36
+
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "agentpay": {
41
+ "command": "npx",
42
+ "args": ["@useagentpay/mcp-server"],
43
+ "env": {
44
+ "AGENTPAY_PASSPHRASE": "your-passphrase"
45
+ }
46
+ }
47
+ }
48
+ }
49
+ ```
50
+
51
+ ## Prerequisites
52
+
53
+ AgentPay must be set up before the MCP server can operate:
54
+
55
+ ```bash
56
+ npm install -g @useagentpay/sdk
57
+ agentpay setup # encrypt & store credentials
58
+ agentpay budget --set 200
59
+ ```
60
+
61
+ ## Tools
62
+
63
+ | Tool | Description |
64
+ |------|-------------|
65
+ | `agentpay_status` | Check if setup is complete, balance, budget, pending count |
66
+ | `agentpay_check_balance` | Current balance and limits (call before proposing) |
67
+ | `agentpay_list_pending` | Pending transactions awaiting approval |
68
+ | `agentpay_propose_purchase` | Propose a new purchase (merchant, amount, description, url) |
69
+ | `agentpay_get_transaction` | Get transaction details by ID |
70
+ | `agentpay_wait_for_approval` | Long-poll until approved or rejected |
71
+ | `agentpay_execute_purchase` | Execute an approved purchase (requires passphrase config) |
72
+ | `agentpay_get_receipt` | Get receipt for a completed purchase |
73
+
74
+ ## Resources
75
+
76
+ | URI | Description |
77
+ |-----|-------------|
78
+ | `agentpay://wallet` | Wallet balance and limits |
79
+ | `agentpay://transactions/{txId}` | Transaction details |
80
+ | `agentpay://audit-log` | Last 50 audit log entries |
81
+
82
+ ## Prompts
83
+
84
+ | Name | Description |
85
+ |------|-------------|
86
+ | `buy` | Guided step-by-step purchase flow |
87
+ | `budget-check` | Balance and pending transaction summary |
88
+ | `purchase-status` | Recent transaction history |
89
+
90
+ ## Typical Agent Flow
91
+
92
+ ```
93
+ 1. agentpay_status → verify setup is complete
94
+ 2. agentpay_check_balance → confirm budget for purchase
95
+ 3. agentpay_propose_purchase → create pending transaction
96
+ 4. agentpay_wait_for_approval → wait for human to approve
97
+ 5. agentpay_execute_purchase → run checkout via headless browser
98
+ 6. agentpay_get_receipt → retrieve confirmation
99
+ ```
100
+
101
+ ## Passphrase Modes
102
+
103
+ The `execute_purchase` tool needs access to the vault passphrase. Three modes:
104
+
105
+ | Mode | Config | Description |
106
+ |------|--------|-------------|
107
+ | **env** | `AGENTPAY_PASSPHRASE` | Passphrase from environment variable |
108
+ | **server** | `AGENTPAY_PASSPHRASE_SERVER` | Fetch passphrase from a URL |
109
+ | **none** | Neither set | Read-only — propose/approve works, execute does not |
110
+
111
+ ## Environment Variables
112
+
113
+ | Variable | Purpose | Default |
114
+ |----------|---------|---------|
115
+ | `AGENTPAY_PASSPHRASE` | Passphrase for execute (env mode) | — |
116
+ | `AGENTPAY_PASSPHRASE_SERVER` | URL to fetch passphrase (server mode) | — |
117
+ | `ANTHROPIC_API_KEY` | LLM API key for browser navigation | — |
118
+ | `AGENTPAY_HOME` | Override data directory | `~/.agentpay` |
119
+ | `MCP_TRANSPORT` | Set to `http` for HTTP transport | `stdio` |
120
+ | `MCP_HTTP_PORT` | HTTP port | `3100` |
121
+
122
+ ## License
123
+
124
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { }