# drain-mcp [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/kimbo128/DRAIN  
**GitHub Stars:** 2  
**npm Downloads (last month):** 158  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/drain-mcp

## Description
Pay for AI inference with USDC micropayments on Polygon. No API keys needed.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "drain-mcp": {
    "command": "npx",
    "args": ["-y","drain-mcp"],
    "env": {
      "DRAIN_PRIVATE_KEY": ""
    }
  }
}
```

**Requires environment variables:** `DRAIN_PRIVATE_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What drain-mcp MCP server does

drain-mcp MCP server lets an AI agent discover compatible inference providers and pay for their services with USDC on Polygon. Provider discovery comes from Handshake58, the official DRAIN marketplace and provider directory. The payment model is based on prepaid channels: the consumer deposits USDC for a provider, uses the balance across requests, and later closes the channel to recover unused funds.

The server is intended for agents that need to use paid AI services programmatically. It does not require provider API keys; authentication and payment use cryptographic wallet signatures and signed vouchers instead.

## How it works

The consumer supplies a Polygon wallet private key through configuration. To begin using a provider, DRAIN opens a payment channel and locks the chosen USDC amount in the DRAIN contract. Requests then travel off-chain with cumulative signed vouchers. Each voucher records the total amount spent so far rather than only the latest request charge.

The provider can validate the voucher, return an inference response, and later submit the highest voucher to claim the accumulated payment. When the consumer is finished, closing the channel settles the remainder and returns unused USDC. Opening and closing require blockchain transactions; ordinary requests use the off-chain voucher flow.

DRAIN uses USDC on Polygon. The README identifies the protocol with ERC-8190, which specifies payment channels using EIP-712 signed vouchers. The channel is associated with a particular provider and a duration selected by the consumer.

## Setup and configuration

Install the package globally with npm:

```bash
npm install -g drain-mcp
```

Configure the command as an MCP server in a compatible client. The documented configuration uses the `drain-mcp` executable and the `DRAIN_PRIVATE_KEY` environment variable:

```json
{
  "mcpServers": {
    "drain": {
      "command": "drain-mcp",
      "env": {
        "DRAIN_PRIVATE_KEY": "your-polygon-wallet-key"
      }
    }
  }
}
```

The supplied key must correspond to a Polygon wallet used for payments. After installation, the server automatically discovers providers from Handshake58.

## Tools and capabilities

The documented capabilities include:

- Discovering AI inference providers through Handshake58.
- Sending requests to compatible providers with paid, signed vouchers.
- Using USDC micropayments on Polygon instead of provider API keys.
- Opening payment channels and depositing funds.
- Closing channels and withdrawing unused funds.
- Supporting provider settlement through cumulative voucher claims.

The marketplace exposes agent-oriented resources, including a provider discovery API at `https://www.handshake58.com/api/mcp/providers` and an agent quick-start page at `/for-agents`.

## Limitations and notes

The drain-mcp MCP server requires USDC on Polygon and a funded wallet. Blockchain operations are not free: the README estimates roughly $0.02 per transaction, with actual costs varying. Opening and closing also involve transaction confirmation time.

Channel funds are not returned automatically when a channel expires. The consumer must actively close the channel, and a provider may claim a valid voucher before that happens. Providers can also require or recommend a minimum channel duration.

The available provider set depends on Handshake58 and provider compatibility. Treat the private key as sensitive wallet material and avoid exposing it in client logs or shared configuration.

_Full upstream README: https://allmcps.com/mcp/drain-mcp/readme_

