agentcash 0.2.3

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 (37) hide show
  1. package/README.md +195 -0
  2. package/dist/cjs/run-server.cjs +112199 -0
  3. package/dist/esm/chunk-3MUBKDR7.js +95 -0
  4. package/dist/esm/chunk-3MUBKDR7.js.map +1 -0
  5. package/dist/esm/chunk-A2KI7TKE.js +59 -0
  6. package/dist/esm/chunk-A2KI7TKE.js.map +1 -0
  7. package/dist/esm/chunk-FYIUFEVS.js +36 -0
  8. package/dist/esm/chunk-FYIUFEVS.js.map +1 -0
  9. package/dist/esm/chunk-HIR4VH7V.js +197 -0
  10. package/dist/esm/chunk-HIR4VH7V.js.map +1 -0
  11. package/dist/esm/chunk-J3LUL7DB.js +23 -0
  12. package/dist/esm/chunk-J3LUL7DB.js.map +1 -0
  13. package/dist/esm/chunk-PBZIKECT.js +46013 -0
  14. package/dist/esm/chunk-PBZIKECT.js.map +1 -0
  15. package/dist/esm/chunk-U6HC4IE3.js +119 -0
  16. package/dist/esm/chunk-U6HC4IE3.js.map +1 -0
  17. package/dist/esm/chunk-WW65CMHP.js +826 -0
  18. package/dist/esm/chunk-WW65CMHP.js.map +1 -0
  19. package/dist/esm/chunk-XCVCGASL.js +57 -0
  20. package/dist/esm/chunk-XCVCGASL.js.map +1 -0
  21. package/dist/esm/cli-context-2MKOXVXU.js +10 -0
  22. package/dist/esm/cli-context-2MKOXVXU.js.map +1 -0
  23. package/dist/esm/commands-EOBZV2HH.js +536 -0
  24. package/dist/esm/commands-EOBZV2HH.js.map +1 -0
  25. package/dist/esm/fund-GUW4GKZT.js +37 -0
  26. package/dist/esm/fund-GUW4GKZT.js.map +1 -0
  27. package/dist/esm/index.d.ts +1 -0
  28. package/dist/esm/index.js +249 -0
  29. package/dist/esm/index.js.map +1 -0
  30. package/dist/esm/install-OYN36YE4.js +720 -0
  31. package/dist/esm/install-OYN36YE4.js.map +1 -0
  32. package/dist/esm/server-BEEIW53K.js +1814 -0
  33. package/dist/esm/server-BEEIW53K.js.map +1 -0
  34. package/dist/esm/shared/operations/index.d.ts +194 -0
  35. package/dist/esm/shared/operations/index.js +19 -0
  36. package/dist/esm/shared/operations/index.js.map +1 -0
  37. package/package.json +82 -0
package/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # agentcash
2
+
3
+ MCP server for calling [x402](https://x402.org)-protected APIs with automatic payment handling.
4
+
5
+ ## Install
6
+
7
+ ### Recommended (Guided Install)
8
+
9
+ ```bash
10
+ npx agentcash install
11
+ ```
12
+
13
+ ### Claude Code
14
+
15
+ ```bash
16
+ claude mcp add agentcash --scope user -- npx -y agentcash@latest
17
+ ```
18
+
19
+ ### Codex
20
+
21
+ ```bash
22
+ codex mcp add agentcash -- npx -y agentcash@latest
23
+ ```
24
+
25
+ ### Cursor
26
+
27
+ [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=agentcash&config=eyJjb21tYW5kIjoiL2Jpbi9iYXNoIiwiYXJncyI6WyItYyIsInNvdXJjZSAkSE9NRS8ubnZtL252bS5zaCAyPi9kZXYvbnVsbDsgZXhlYyBucHggLXkgQHg0MDJzY2FuL21jcEBsYXRlc3QiXX0%3D)
28
+
29
+ ### Claude Desktop
30
+
31
+ [![Add to Claude](https://img.shields.io/badge/Add_to_Claude-agentcash-blue?logo=anthropic)](https://github.com/merit-systems/agentcash/raw/main/agentcash.mcpb)
32
+
33
+ <details>
34
+ <summary>Manual installation</summary>
35
+
36
+ **Codex** - Add to `~/.codex/config.toml`:
37
+
38
+ ```toml
39
+ [mcp_servers.agentcash]
40
+ command = "npx"
41
+ args = ["-y", "agentcash@latest"]
42
+ ```
43
+
44
+ **Cursor** - Add to `.cursor/mcp.json`:
45
+
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "agentcash": {
50
+ "command": "/bin/bash",
51
+ "args": [
52
+ "-c",
53
+ "source $HOME/.nvm/nvm.sh 2>/dev/null; exec npx -y agentcash@latest"
54
+ ]
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ **Claude Desktop** - Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
61
+
62
+ ```json
63
+ {
64
+ "mcpServers": {
65
+ "agentcash": {
66
+ "command": "/bin/bash",
67
+ "args": [
68
+ "-c",
69
+ "source $HOME/.nvm/nvm.sh 2>/dev/null; exec npx -y agentcash@latest"
70
+ ]
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ </details>
77
+
78
+ ## Usage
79
+
80
+ On first run, a wallet is generated at `~/.agentcash/wallet.json`. Deposit USDC on Base to the wallet address before making paid API calls.
81
+
82
+ **Workflow:**
83
+
84
+ 1. `get_wallet_info` - Check wallet and get deposit address
85
+ 2. `redeem_invite` - Redeem an invite code to fund your wallet (if you have one)
86
+ 3. `discover_api_endpoints` - Find available x402 endpoints on an origin
87
+ 4. `check_endpoint_schema` - Probe endpoint for pricing/schema (optional)
88
+ 5. `fetch` - Make the paid request (or `fetch_with_auth` for SIWX auth)
89
+
90
+ ## Tools
91
+
92
+ | Tool | Description |
93
+ | ------------------------ | ------------------------------------------------------------ |
94
+ | `fetch` | Fetch x402-protected resource with automatic payment |
95
+ | `fetch_with_auth` | Make request to SIWX-protected endpoint with automatic auth |
96
+ | `get_wallet_info` | Get wallet address and USDC balance |
97
+ | `redeem_invite` | Redeem an invite code to receive USDC |
98
+ | `check_endpoint_schema` | Check if endpoint is x402-protected, get pricing/schema/auth |
99
+ | `discover_api_endpoints` | Discover x402 resources from origin's .well-known/x402 |
100
+ | `report_error` | Report critical MCP tool bugs to agentcash developers |
101
+
102
+ ## Environment
103
+
104
+ | Variable | Description |
105
+ | ------------------ | --------------------------------- |
106
+ | `X402_PRIVATE_KEY` | Override wallet (optional) |
107
+ | `X402_DEBUG` | Set to `true` for verbose logging |
108
+
109
+ ## Supported Networks
110
+
111
+ Base, Base Sepolia, Ethereum, Optimism, Arbitrum, Polygon (via CAIP-2)
112
+
113
+ ## Develop
114
+
115
+ ```bash
116
+ pnpm install
117
+
118
+ # Build
119
+ pnpm -w dev:mcp
120
+
121
+ # In a separate terminal with cwd packages/external/mcp
122
+ pnpm dev install --dev
123
+
124
+ # Build .mcpb for Claude Desktop
125
+ pnpm build:mcpb
126
+ ```
127
+
128
+ ## Evaluations
129
+
130
+ MCP changes are automatically tested via CI. Comprehensive evaluations run in the [x402-evals](https://github.com/merit-systems/x402-evals) repository.
131
+
132
+ ### Automatic Checks
133
+
134
+ - **PR Smoke Test** - Automatically runs when you modify MCP source code
135
+ - **Release Eval** - Full evaluation suite runs when a new version is published
136
+
137
+ ### Manual Evaluation
138
+
139
+ Comment on your PR to trigger evaluations:
140
+
141
+ | Command | Description |
142
+ | ------------------------ | ---------------------------------------- |
143
+ | `/eval` or `/eval smoke` | Quick validation (~2-3 min) |
144
+ | `/eval full` | Comprehensive testing (~10 min) |
145
+ | `/eval regression` | Known edge cases and historical failures |
146
+
147
+ Results are posted back to your PR with a link to detailed metrics.
148
+
149
+ ### Local Evaluation
150
+
151
+ ```bash
152
+ # In x402-evals repo
153
+ MCP_SERVER_DIR=/path/to/agentcash/packages/external/mcp/dist/esm pnpm --filter @x402-evals/promptfoo eval
154
+ ```
155
+
156
+ ### Evals on changes to enrichx402 or stablestudio
157
+
158
+ 1. Make a PR in enrichx402 and generate a preview URL with vercel
159
+ 2. Make a branch in the agentcash repo
160
+ 3. Replace the enrichx402.com URL in `src/shared/origins.ts` with your preview URL
161
+ 4. Push and make a PR, then comment on it with "/eval full" (or smoke, regression)
162
+
163
+ ## Publishing
164
+
165
+ This package uses [changesets](https://github.com/changesets/changesets) for versioning and publishing.
166
+
167
+ ### Standard Release Flow (main branch)
168
+
169
+ 1. Create a changeset describing your changes:
170
+ ```bash
171
+ pnpm changeset
172
+ ```
173
+ 2. Commit the changeset file with your PR
174
+ 3. When merged to `main`, the CI creates a "Version Packages" PR
175
+ 4. Merging the version PR triggers automatic npm publish
176
+
177
+ ### Beta Release Flow (beta branch)
178
+
179
+ For pre-release versions, use the `beta` branch with prerelease mode:
180
+
181
+ 1. Enter prerelease mode:
182
+ ```bash
183
+ pnpm changeset pre enter beta
184
+ ```
185
+ 2. Commit the generated `.changeset/pre.json` file
186
+ 3. Create changesets and merge to `beta` as normal
187
+ 4. Versions will be published as `x.x.x-beta.x`
188
+
189
+ To exit prerelease mode and promote to stable:
190
+
191
+ ```bash
192
+ pnpm changeset pre exit
193
+ ```
194
+
195
+ **Note:** The CI enforces that `beta` branch must have `pre.json` and `main` branch must not.