{"_id":"@autospendai/mcp","name":"@autospendai/mcp","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@autospendai/mcp","version":"0.1.0","description":"Autospend MCP server — gives any MCP-compatible agent a request_card tool that issues scoped, single-use virtual cards through the Autospend platform.","license":"MIT","type":"module","keywords":["mcp","model-context-protocol","autospend","agent","payments","virtual-card","claude","cursor"],"homepage":"https://autospend.ai","repository":{"type":"git","url":"git+https://github.com/Autospend/autospend-agent-platform.git","directory":"mcp"},"publishConfig":{"access":"public"},"bin":{"autospend-mcp":"dist/index.js"},"scripts":{"prepublishOnly":"npm run build","build":"tsc","start":"node dist/index.js","lint":"tsc --noEmit","test":"jest"},"dependencies":{"@modelcontextprotocol/sdk":"^1.29.0","zod":"^3.23.8"},"devDependencies":{"@types/jest":"^29.5.12","@types/node":"^20.11.24","jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.4.2"},"jest":{"moduleFileExtensions":["js","json","ts"],"rootDir":"src","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.ts$":["ts-jest",{"useESM":true}]},"extensionsToTreatAsEsm":[".ts"],"moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"},"testEnvironment":"node"},"_id":"@autospendai/mcp@0.1.0","gitHead":"d93dad9c2656462ec8aff2dbb77e65fdceb86c1c","bugs":{"url":"https://github.com/Autospend/autospend-agent-platform/issues"},"_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-zhuAqlNAfJk5oJtFUvvmjqHEJScvzrFxgjfThqsjsEsLhtAjpQHiPfS6I/UIRx3F/sP6eq9aixu4CSNXzvPpMw==","shasum":"43f2c47ab9b03b347d11d07ed46d14e75e72e830","tarball":"https://registry.npmjs.org/@autospendai/mcp/-/mcp-0.1.0.tgz","fileCount":11,"unpackedSize":24934,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDk3j9WnQWy4sKbzIYM6oRwJM4mPLDEmkfwOf3wgpiQ4wIhAK5Htia/DVGYa/svIuJ8GEQ2yObHI1i8kFo8kOk6WniE"}]},"_npmUser":{"name":"ojes","email":"abraham@autospend.ai"},"directories":{},"maintainers":[{"name":"dotunajl","email":"dotun@collect.africa"},{"name":"ojes","email":"abraham@autospend.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp_0.1.0_1784723806274_0.5555640504268424"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-22T12:36:46.082Z","0.1.0":"2026-07-22T12:36:46.416Z","modified":"2026-07-22T12:36:46.724Z"},"maintainers":[{"name":"dotunajl","email":"dotun@collect.africa"},{"name":"ojes","email":"abraham@autospend.ai"}],"description":"Autospend MCP server — gives any MCP-compatible agent a request_card tool that issues scoped, single-use virtual cards through the Autospend platform.","homepage":"https://autospend.ai","keywords":["mcp","model-context-protocol","autospend","agent","payments","virtual-card","claude","cursor"],"repository":{"type":"git","url":"git+https://github.com/Autospend/autospend-agent-platform.git","directory":"mcp"},"bugs":{"url":"https://github.com/Autospend/autospend-agent-platform/issues"},"license":"MIT","readme":"# @autospend/mcp\n\nAn [MCP](https://modelcontextprotocol.io) server that gives **any** MCP-compatible\nagent (Claude, Cursor, or any MCP runtime) a single tool — `request_card` — to\nissue a **scoped, single-use virtual card** through the\n[Autospend platform](../README.md).\n\nThe card auto-closes after one charge, is capped to the amount requested, and is\nbounded by the agent owner's spending policy. This server is a **thin, stateless\nbridge**: it holds one agent key and forwards to the platform, where all\nauthorization lives — per-agent policy, daily/exposure ceilings, freeze/revoke,\nand the hash-chained audit trail. Nothing is enforced (or persisted) here.\n\n## The tool\n\n**`request_card`** — issue a card to pay for a purchase.\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `amountInUSDCents` | yes | Card limit in US cents (`4200` = $42.00). |\n| `allowedMccs` | no | 4-digit merchant category codes the card may be used at (e.g. `[\"5812\"]` restaurants). |\n| `ttlSeconds` | no | Card lifetime in seconds. |\n| `memo` | no | Human note for the audit trail. |\n| `idempotencyKey` | no | Reuse to safely retry **without** issuing a second card. |\n\nOn success it returns the PAN, CVC, and expiry (once) plus a `structuredContent.card`\npayload. The card is **ephemeral** — never logged or persisted by this process.\n\nThe tool never throws for a normal failure: policy rejections, caps, freezes, and\nambiguous (no-response) outcomes come back as actionable text the agent can act on\n— e.g. an ambiguous result tells the agent to retry with the *same* `idempotencyKey`\nrather than issue a new card.\n\n## Install & configure\n\n```bash\nnpm install && npm run build\n```\n\nPoint any MCP client at the built server with two env vars:\n\n```jsonc\n// e.g. claude_desktop_config.json / .cursor/mcp.json\n{\n  \"mcpServers\": {\n    \"autospend\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/mcp/dist/index.js\"],\n      \"env\": {\n        \"AUTOSPEND_API_URL\": \"https://api.autospend.ai\",\n        \"AUTOSPEND_AGENT_KEY\": \"ak_….secret\"\n      }\n    }\n  }\n}\n```\n\n| Env var | Required | Default |\n|---------|----------|---------|\n| `AUTOSPEND_API_URL` | yes | — |\n| `AUTOSPEND_AGENT_KEY` | yes | — |\n| `AUTOSPEND_REQUEST_TIMEOUT_MS` | no | `20000` |\n\nMint the `AUTOSPEND_AGENT_KEY` with the platform's\n`POST /v1/tenants/:id/keys` (see the [platform README](../README.md)); its policy\nis what bounds every card this agent can request.\n\n## Test\n\n```bash\nnpm test        # config, HTTP client (Definite/Ambiguous), tool-result mapping\n```\n\nFor an end-to-end check, see the recipes in [`../docs/recipes/`](../docs/recipes/):\neach pairs a real checkout flow with the policy preset to mint the agent key from.\n","readmeFilename":"README.md","_rev":"1-f2808b375e48678c5d740507b90eaeb1"}