PurseString MCP Server
Spending guardrails for AI agents: your rules, and a human when needed, checked before money moves.
PurseString scores 70 (Good), licensed Apache-2.0 and written in TypeScript. It installs as a local process. It declares 8 tools. Filed under Finance. GitHub shows 0 stars. Package registries report about 392 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
70 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: apache-2.0.
License, quality and maintenance
Where the 70 comes from
22 + 20 + 4 + 10 + 4 + 10 = 70. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 4 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "suseendar1414-pursestring": { "command": "npx", "args": [ "-y", "pursestring@0.4.0" ], "env": { "PURSESTRING_POLICY": "", "LITHIC_API_KEY": "YOUR_LITHIC_API_KEY", "PAYPAL_CLIENT_ID": "YOUR_PAYPAL_CLIENT_ID", "PAYPAL_CLIENT_SECRET": "YOUR_PAYPAL_CLIENT_SECRET", "SLACK_WEBHOOK_URL": "YOUR_SLACK_WEBHOOK_URL" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
PURSESTRING_POLICY | Optional | Path to policies.yaml (default ./policies.yaml, then ~/.pursestring/policies.yaml) |
LITHIC_API_KEYSecret | Optional | Use Lithic virtual cards (sandbox by default) instead of the mock rail |
PAYPAL_CLIENT_IDSecret | Optional | Enable PayPal payouts to vendor accounts set in the policy (sandbox by default) |
PAYPAL_CLIENT_SECRETSecret | Optional | PayPal client secret, needed with PAYPAL_CLIENT_ID |
SLACK_WEBHOOK_URLSecret | Optional | Slack incoming webhook for approval requests |
Tools8Tool docs quality grade C
All capabilitiescheck_payouttoolWhen a vendor says a payment never arrived, reads its real status from the rail, never from the vendor's message.
Dry run. Returns autoapprove, requireapproval or deny, and every rule checked. Nothing is issued, nobody is pinged.
Checks status, or waits up to 5 minutes for a human to approve or deny.
replace_payouttoolSends one replacement, only when the rail says the first payout failed and the money came back.
The agent reports that it read outside content (a web page, an email); its spends then need a human for a while.
Issues a single-use card capped at the approved amount, only for an approved intent. Retries return the same card.
send_paymenttoolPays an approved intent through a payout rail to the vendor's account on file in the policy. The agent can't choose the recipient, and each intent is paid at most once.
Declares the purchase. Policy decides; risky spend pauses and pings a human. Identical retries return the original intent.
About
AI agents can now pay for things: API credits, SaaS seats, datasets, cloud resources, invoices. Every bank, card issuer and payment provider gives them a different API, and none of them knows why the agent is spending. That's how you end up with:
- π A checkout page hangs, the agent retries, and you pay twice.
- π A $15 "trial" fits under the $50 cap and auto-renews forever.
- π€· Finance asks "what was this charge?" and nobody can say why the agent bought it.
PurseString is an open-source, self-hosted MCP server that gives AI agents spending guardrails. The agent declares what it wants to pay for, why, and what it tried first. PurseString checks that against your policies.yaml, blocks duplicates, pauses risky spend for a human in Slack or Discord, records the decision, and only then executes it on the right provider.
[!WARNING] v0.4.0 alpha (changelog). PurseString issues real Lithic cards: use a production Lithic key and set
adapter.lithic.environment: production. It's early software, so start with low limits. Tested end to end on the Lithic sandbox: card issue, duplicate-request replay, auto-close after 10 minutes, and real-time charge approval (answered in under 3 ms; try it yourself). Tell us what breaks in issues.
π PayPal AI Hackathon: how PurseString uses PayPal and AI
- PayPal Agent Toolkit / PayPal MCP server (
@paypal/mcp): PurseString runs PayPal's own MCP server behind itself and re-exposes its tools to the agent, with guardrails. Read-only tools pass through. Refunds are auto-run, paused for a human, or refused, depending on the amount. Accepting a dispute or cancelling always needs a human. A retried refund returns PayPal's first answer instead of refunding twice. - PayPal Payouts API (PayPal and Venmo): the
send_paymenttool pays vendors. The recipient comes from a payee directory inpolicies.yaml, never from the agent, so a prompt injection has no address to swap in. The intent ID is sent asPayPal-Request-Id, so a payout can't happen twice. - PayPal OAuth (client credentials): PurseString keeps the client secret, and PayPal's MCP server only ever sees short-lived access tokens.
- AI: the agent being governed is any MCP-capable model. We built and tested with Claude (Claude Desktop and Claude Code), and the project speaks the Model Context Protocol through the official TypeScript SDK. Claude Code was also used as a pair programmer for the code, tests and docs.
Setup in the PayPal sandbox takes about 5 minutes: see docs/paypal.md.
π§© What it does, and what works today
| Status | ||
|---|---|---|
| π Connect | Banks, payment providers and card issuers behind one MCP interface, through community-built adapters. | π‘ Virtual cards via Lithic (sandbox and production), Privacy.com cards funded from your own bank account and Airwallex cards for businesses outside the US (both new, untested with a live account), PayPal and Venmo payouts straight to a vendor's account on file, Stripe Connect, RazorpayX, Modern Treasury and Airwallex payouts (new, tested against stubbed API responses only), x402 pay-per-request APIs in USDC (new, testnet by default, not yet run against a live facilitator), guardrails in front of PayPal's own MCP server (refunds, disputes, cancellations), plus a mock rail for testing. Not yet: your existing card directly, and other providers (see roadmap). |
| π‘οΈ Govern | Budgets, vendor allow and block lists, and human approvals, defined once and enforced the same way on every provider. | β
Live: policies.yaml, per-agent daily budgets, a velocity limit on spends per agent across all merchants, Slack / Discord approval pause, per-purchase rail routing, a kill switch for one agent or all of them that freezes their cards at the rail and trips itself when an agent keeps re-buying the same thing or keeps getting denied, and card controls that lock a card to the vendor's merchant categories. |
| π³ Execute | Authorized payments and other supported financial operations. | π‘ Single-use and merchant-locked virtual cards today. Bank transfers (ACH / wire) are on the roadmap (#16). |
| π Protect | No duplicate operations, safe handling of uncertain payment states, and a record of every decision. | β
Live: idempotency keys, safe retries after a hung checkout, real-time checks on every card charge, cards that close after 10 minutes, hash-chained audit log (pursestring verify-log). |
| π Expand | Developers add integrations for more providers and countries. | β Live: a small adapter interface and a contributor guide. The first community adapters are up for grabs. |
β live today Β· π‘ partly live, more on the roadmap
Govern and Protect in detail
| π No double charges | Every intent gets a deterministic key, SHA256(agent_id, task_id, vendor, amount). Retry inside 30 minutes and you get the same card back, not a second transaction. |
| π No surprise subscriptions | Anything marked is_recurring goes to a human, whatever the amount. Approved subscriptions get a merchant-locked card with a monthly cap, so they can't be reused elsewhere. |
| π Approve by risk, not by dollar amount | Small, one-time, allowlisted spend is auto-approved. Recurring, over-threshold or unknown-vendor spend pauses and pings Slack or Discord. Blocklisted vendors and spend over the hard cap are refused outright. |
| β‘ Every charge checked as it happens | With just-in-time authorization, the card issuer asks PurseString before each charge goes through. Only a charge that matches the approved intent (right card, right amount, first use, still live) is approved. |
| β±οΈ Cards that close themselves | Single-use cards close 10 minutes after issue, so a leaked number is worthless. |
| π§ Intent before money | The agent must state the goal and the free alternatives it tried. A vague goal or no alternatives means a human looks first. |
| πΌ A black box recorder for every decision | Goal, alternatives, the agent's reasoning, every rule and how it ruled, who approved, and what was executed, as append-only JSON lines. Card numbers are never written to disk. |
| π One policy, routed per provider | routes in policies.yaml picks the provider per purchase by amount, vendor or recurrence, so the same rules apply wherever the money moves. |
| π Measured, not claimed | An attack benchmark runs prompt-injected refunds, split payouts, swapped payees, retries, loops and over-budget agents with and without PurseString (mock mode, npm run bench). With the default policy, unwanted spend fell from $6,784.71 to $528.94, and money reaching an attacker fell from $2,198.00 to $192.00. |
| π Self-hosted, Apache 2.0 | Runs on your laptop or in your VPC. Your financial credentials never leave your infrastructure. |
π€ Use it with your rail, not instead of it
PurseString doesn't replace your card issuer or bank. It's the interface and policy layer on top, so the same rules apply whichever provider moves the money.
| Card issuer controls(Ramp, Stripe Issuing, Lithic) | PurseString on top | |
|---|---|---|
| Spend caps and merchant locks | β | β (enforced on the card it issues) |
| One policy across several rails | Each rail has its own | β |
| Agent must declare goal and alternatives | β | |
| Intent-level duplicate-charge protection | β | |
| Real-time approval checked against why the card was issued | β | |
| Recurring charges always routed to a human | β | |
| Reasoning-level audit trail ("why did it buy this?") | β | |
| Open source, self-hosted | β |
π Quickstart
New here? Try it in 10 minutes with Claude Desktop and test cards: an auto-approved purchase, a blocked double charge, and a subscription that waits for your approval.
1. Add it to your MCP client. Claude Desktop (claude_desktop_config.json), Cursor (.cursor/mcp.json) and most others use the same shape:
{
"mcpServers": {
"pursestring": {
"command": "npx",
"args": ["-y", "pursestring"],
"env": { "SLACK_WEBHOOK_URL": "https://hooks.slack.com/services/..." }
}
}
}
With Claude Code: claude mcp add pursestring -- npx -y pursestring
With ChatGPT (developer mode) or claude.ai custom connectors: run it as a server and sign in with OAuth. See docs/chatgpt.md.
2. Write a policy. Run npx -y pursestring init to get a commented policies.yaml, then edit the vendor allowlist. With no file, safe defaults apply: auto-approve under $20 on allowlisted vendors, a human above $50 or for anything recurring.
3. Ask your agent to buy something. It calls the tools below. Out of the box it uses the mock rail (test card numbers, no money moves). Set LITHIC_API_KEY to issue real Lithic cards: a sandbox key for testing, or a production key plus adapter.lithic.environment: production for live cards.
Prefer Docker? Run the prebuilt image (linux/amd64 and arm64) and the server answers over HTTP at http://localhost:8787/mcp:
npx -y pursestring init # writes policies.yaml; edit the allowlist
docker run -d --name pursestring -p 127.0.0.1:8787:8787 \
-v $PWD/policies.yaml:/config/policies.yaml:ro -v pursestring-data:/data \
ghcr.io/suseendar1414/pursestring:latest
Or docker compose up -d from a clone. See docs/deploy.md.
π§° Tools your agent gets
| Tool | What it does |
|---|---|
check_policy_compliance | Dry run. Returns auto_approve, require_approval or deny, and every rule checked. Nothing is issued, nobody is pinged. |
submit_purchase_intent | Declares the purchase. Policy decides; risky spend pauses and pings a human. Identical retries return the original intent. |
request_ephemeral_card | Issues a single-use card capped at the approved amount, only for an approved intent. Retries return the same card. |
send_payment | Pays an approved intent through a payout rail to the vendor's account on file in the policy. The agent can't choose the recipient, and each intent is paid at most once. |
check_payout | When a vendor says a payment never arrived, reads its real status from the rail, never from the vendor's message. |
replace_payout | Sends one replacement, only when the rail says the first payout failed and the money came back. |
get_intent_status | Checks status, or waits up to 5 minutes for a human to approve or deny. |
report_untrusted_content | The agent reports that it read outside content (a web page, an email); its spends then need a human for a while. |
Optional: x402_fetch pays for HTTP 402 APIs in USDC (docs/x402.md), and PayPal's own MCP tools can be re-exposed with guardrails (docs/paypal.md). For a one-page summary written for AI assistants, see llms.txt.
What the agent sends:
{
"agent_id": "invoice-bot",
"task_id": "102",
"task_goal": "Parse invoice PDF for task #102",
"vendor_domain": "pdfocr.io",
"amount": 15.00,
"is_recurring": true,
"alternatives_attempted": ["PyPDF2 (failed OCR)"]
}
What it gets back:
{
"intent_id": "int_19099cd4d52542c2a33f",
"status": "pending_approval",
"summary": "Needs human approval: require_approval.recurring (recurring charge: will renew until cancelled)",
"next_step": "Paused for human approval. Do not buy another way. Call get_intent_status ..."
}
A human approves with the Slack Approve button, from the terminal, or through the HTTP approval API. When Slack or Discord is set up, the terminal needs the one-time code from that message, so an agent with a shell can't approve its own purchase (who can approve):
$ npm i -g pursestring
$ pursestring pending
int_19099cd4d52542c2a33f 15.00 USD pdfocr.io (recurring) agent=invoice-bot task=102
$ pursestring approve int_19099cd4d52542c2a33f --code 7KQ2M-X9D4T --note "ok for one month"
ποΈ How it works
flowchart LR
A["AI agent<br/>Claude Β· Cursor Β· LangGraph Β· CrewAI"] -->|"intent: goal, amount,<br/>vendor, recurring, alternatives"| S
subgraph S["PurseString"]
direction TB
I["Intent check"] --> D["Idempotency lock"] --> P["Policy engine<br/>auto Β· human Β· deny"] --> L["Decision log"]
end
P -.->|"risky spend"| H["Slack / Discord<br/>human approves"]
S -->|"approved only, routed by policy"| R["Payment adapters"]
R --> C1["BaaS virtual cards<br/>Lithic Β· Highnote* Β· Marqeta*"]
R --> C2["Corporate cards<br/>Amex*"]
R --> C3["Bank transfers<br/>ACH / wire*"]
C1 -.->|"real-time: approve this charge?"| S
* on the roadmap, contributions welcome
Deep dive: docs/how-it-works.md. Policy reference: docs/policies.md.
πΊοΈ Roadmap
- MCP server (stdio + Streamable HTTP), intent schema, policy engine
- OAuth sign-in for remote clients (ChatGPT developer mode, claude.ai connectors)
- Idempotency locks, single-use cards, decision log
- Slack / Discord approval pause, CLI and HTTP approve/deny
- One-click Slack approve/deny buttons, and one-time approval codes so agents can't approve themselves
- Mock rail, Lithic virtual cards, Docker image
- Just-in-time authorization (Lithic ASA), cards that close after 10 minutes
- Policy-based rail routing
- Connect more providers: Highnote (#13), Marqeta (#14), Amex corporate cards (#15), the user's own Visa / Mastercard via Visa Intelligent Commerce and Mastercard Agent Pay (#20), Stripe Issuing (#1), x402 / USDC (#2)
- Existing bank accounts: ACH / wire transfers from the company's own account, with reconciliation of uncertain transfer states (#16)
- More countries: SEPA and local rails, contributed as adapters
- Per-agent and per-team policies
- Audit log viewer
- Framework examples: LangGraph, CrewAI, Vercel AI SDK, OpenAI Agents SDK
Want one of these? Grab a good first issue and comment "I'd like to take this".
π§ Open core
PurseString is open core. Everything in this repository is free and stays Apache 2.0: the MCP server, policies.yaml, the decision log, the approval pause, and the card adapters. A hosted PurseString Cloud for teams running agents in production is planned on top of it:
| Community core (this repo, free) | PurseString Cloud (planned) |
|---|---|
| Self-hosted MCP server, YAML policies | Audit dashboard with visual decision trees for every charge |
| Local JSON decision log | One-click Slack / Teams approvals |
| Slack / Discord approval pause | Role-based access: policies per department, project or agent squad |
| Card adapters (Lithic, Privacy.com, Airwallex) | Enterprise rails: Amex, bank ACH / wires, ERP purchase orders |
The full product vision is in docs/VISION.md.
π¬ Community
- Discord: questions, ideas, show what you built
- Issues: bugs and feature requests
- Contributing guide: set up in two minutes, add a rail in an afternoon
If PurseString saves you from a double charge, a β helps other agent builders find it.
π Security
PurseString handles payment credentials, so it's built to be read: no telemetry, no outbound calls except to your configured rail and webhooks, and card numbers are never written to state or logs. Found a vulnerability? Please follow SECURITY.md instead of opening a public issue.
π License
Apache 2.0. Use it commercially, fork it, run it in your VPC. Apache 2.0 includes an explicit patent grant, which matters for anything that touches payments and is what enterprise security and legal teams expect to see.
Frequently asked questions
What is PurseString MCP Server?
Spending guardrails for AI agents: your rules, and a human when needed, checked before money moves.
How do I install PurseString MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. PurseString MCP Server runs locally from the npm package pursestring with the command npx -y pursestring@0.4.0.
Is PurseString MCP Server free and open source?
Yes. PurseString MCP Server is released under the Apache-2.0 license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does PurseString MCP Server support remote (HTTP) connections?
No remote endpoint is listed for PurseString MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does PurseString MCP Server provide?
PurseString MCP Server provides 8 tools, including check_payout, check_policy_compliance, get_intent_status, and replace_payout. See the full tool list for descriptions and parameters.
How is PurseString MCP Server's trust score calculated?
PurseString MCP Server scores 70 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yetβBe the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.