Magpie MCP Server

Agent-native lending on Solana via x402: borrow against tokens, arm in-vault TP/SL, repay.

Local serverstdioTypeScript

What is the Magpie MCP server?

Agent-native lending on Solana via x402: borrow against tokens, arm in-vault TP/SL, repay. Exposed over MCP by the magpie mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

What it actually does

Borrow SOL against your memecoins, tokenized stocks, and RWAs — and set take-profits and stops on that same collateral. Liquidity now, upside intact: collateral that can still sell itself.

Its toolset

Everything the assistant can do here goes through one of these:

  • vercel.json — routes all paths to /api
  • MAGPIE_PAY_TO — your Solana treasury pubkey
  • MAGPIE_LENDER_PUBKEY — the Magpie lender authority
  • SOLANA_RPC_URL — use a paid Helius/Triton/QuickNode URL for speed (public RPC will rate-limit you)
  • CORS_ORIGINS — comma-separated allowlist (use * only during testing)
  • Replay — resistant.** Single-use nonces bound to payment memos
  • Rate — limited from day one** — per-IP minute + hour buckets on every endpoint
  • Method — Path
  • GET — /
  • POST — /api/v1/agent/build-borrow

Adding it to your client

Installation goes through your MCP client rather than a global install: point it at tsx on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

Configuration

You will need one environment variable: SOLANA_RPC_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

When to reach for it

Among the payments and commerce options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Magpie's toolset — vercel.json, MAGPIE_PAY_TO, MAGPIE_LENDER_PUBKEY and 7 more — is a fair guide to whether it matches your workflow. It is maintained by magpiecapital; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Magpie's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 10 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Magpie.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the magpie mcp server does with a few real requests.

Available tools

ToolWhat it does
vercel.jsonroutes all paths to /api
MAGPIE_PAY_TOyour Solana treasury pubkey
MAGPIE_LENDER_PUBKEYthe Magpie lender authority
SOLANA_RPC_URLuse a paid Helius/Triton/QuickNode URL for speed (public RPC will rate-limit you)
CORS_ORIGINScomma-separated allowlist (use * only during testing)
Replayresistant.** Single-use nonces bound to payment memos.
Ratelimited from day one** — per-IP minute + hour buckets on every endpoint.
MethodPath
GET/
POST/api/v1/agent/build-borrow

How to install the Magpie MCP server

{
  "mcpServers": {
    "magpie": {
      "command": "npx",
      "args": ["-y", "tsx"],
      "env": {
        "SOLANA_RPC_URL": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
SOLANA_RPC_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use Magpie to vercel.json.
  • Use Magpie to MAGPIE PAY TO.
  • Use Magpie to MAGPIE LENDER PUBKEY.

Frequently asked questions

It connects Magpie to MCP-compatible AI assistants such as Claude and Cursor, exposing 10 tools (vercel.json, MAGPIE_PAY_TO, MAGPIE_LENDER_PUBKEY, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Magpie directly.