Skip to content

mppfinance/mppfinance-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPPFinance

mppfinance

Virtual Visa cards for AI agents — powered by Machine Payments Protocol

npm version License: MIT CI Twitter

Website · Docs · NPM


What is MPPFinance?

MPPFinance bridges the Machine Payments Protocol to the real world. Your AI agent pays via MPP — gets a virtual Visa card — spends anywhere online. No humans in the loop.

import { MPPFinance } from 'mppfinance'

const card = await MPPFinance.issue({
  agentId: 'agent-7x2k',
  amount: 50_00,        // $50.00
  currency: 'USD',
  rules: {
    merchant: 'aws.com',
    singleUse: true,
    expiresIn: 300,
  },
})

// card.number → ready in 0.3s
console.log(card.number) // "4111 •••• •••• 9821"

Features

Feature Description
⚡ 300ms issuance Virtual Visa ready in under 300ms
🔒 On-chain rules Spending limits enforced by MPP protocol
🎯 Merchant whitelist Restrict card to exact domains
🔥 Single-use cards Card burns after first charge
🤖 MCP native Works with Claude, GPT-4, Cursor out of the box
🔑 Non-custodial Your keys, your funds

Installation

npm install mppfinance
# or
pnpm add mppfinance
# or
yarn add mppfinance

Quick Start

1. Initialize

import { MPPFinance } from 'mppfinance'

const client = new MPPFinance({
  agentId: 'your-agent-id',
  network: 'solana',   // 'solana' | 'ethereum'
  testnet: true,       // use testnet for development
})

2. Issue a card

const card = await client.issue({
  amount: 100_00,   // $100.00
  currency: 'USD',
  rules: {
    merchant: 'stripe.com',
    singleUse: false,
    expiresIn: 86400,  // 24 hours
    maxPerTx: 50_00,   // $50 per transaction
  },
})

console.log(card.id)      // "card_7x2k..."
console.log(card.number)  // "4111 •••• •••• 9821"
console.log(card.cvv)     // "***" (revealed once)
console.log(card.expiry)  // "12/27"

3. List active cards

const cards = await client.list()
cards.forEach(card => {
  console.log(`${card.id}${card.merchant} — $${card.spent}`)
})

4. Revoke a card

await client.revoke('card_7x2k...')

5. Webhooks

client.on('charge', (event) => {
  console.log(`Charged $${event.amount} at ${event.merchant}`)
})

client.on('expired', (event) => {
  console.log(`Card ${event.cardId} expired`)
})

MCP Tool (Claude / GPT / Cursor)

MPPFinance ships with an MCP tool for direct agent integration:

{
  "mcpServers": {
    "mppfinance": {
      "command": "npx",
      "args": ["-y", "mppfinance", "--mcp"],
      "env": {
        "MPPFINANCE_AGENT_ID": "your-agent-id",
        "MPPFINANCE_NETWORK": "solana"
      }
    }
  }
}

Available MCP tools:

  • issue_card — issue a new virtual card with rules
  • list_cards — list all active cards
  • revoke_card — revoke a card by ID
  • get_balance — get agent wallet balance
  • get_history — get transaction history

API Reference

MPPFinance(config)

Param Type Description
agentId string Your agent identifier
network 'solana' | 'ethereum' Blockchain network
testnet boolean Use testnet (default: false)
webhookUrl string? Webhook endpoint for events

client.issue(options)

Param Type Description
amount number Amount in cents (e.g. 50_00 = $50)
currency 'USD' | 'EUR' Card currency
rules.merchant string? Allowed merchant domain
rules.singleUse boolean Burn after first charge
rules.expiresIn number TTL in seconds
rules.maxPerTx number? Max charge per transaction (cents)

Roadmap

  • Core SDK (TypeScript)
  • Solana network support
  • MCP tool
  • Single-use cards
  • Merchant whitelisting
  • Ethereum mainnet (Q2 2026)
  • Python SDK (Q2 2026)
  • Rust SDK (Q3 2026)
  • Recurring card billing (Q3 2026)
  • Multi-agent sub-accounts (Q4 2026)

License

MIT © 2026 MPPFinance // v4 - Wed Jan 22 14:35:29 MSK 2025 // v10 - Sun Feb 2 14:34:27 MSK 2025 // v16 - Thu Feb 13 18:02:07 MSK 2025 // v22 - Mon Feb 24 19:30:03 MSK 2025 // v28 - Fri Mar 7 21:32:48 MSK 2025 // v34 - Tue Mar 18 21:55:54 MSK 2025

About

Virtual Visa cards for AI agents — powered by Machine Payments Protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors