# magpie-mcp

Connects AI assistants to the Magpie lending protocol on Solana. Borrow against tokens and configure in-vault profit targets or stop triggers without selling your stash.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 7
- Author: magpiecapital
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/magpiecapital/magpie-x402/tree/HEAD/mcp
- Updated: 2026-09-14
- HTML: https://affpapa.org/en/nevibecode/mcp/magpie-mcp

## What it does

The server exposes 26 protocol tools via the Magpie x402 interface. Agents can inspect live lending pools, review liquidations, pull wallet credit data, and simulate borrow terms before acting. These informational queries require no wallet signature and function immediately upon launch.

Active borrowing and risk management run through localized transaction assembly. It lets agents build loan requests against memecoins or real-world assets, repay debt, and place take-profit or trailing-stop triggers directly inside V4 collateral vaults. When triggered, the collateral sells on-chain through a slippage buffer, retaining proceeds within the vault until the borrower settles the loan.

Without a local keypair in `MAGPIE_MCP_PAYER_KEYPAIR`, actions that build transactions or set vault orders will halt. Your secret key stays on the host machine because the server signs x402 fees and Ed25519 envelopes locally.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add magpie-mcp -- npx -y @magpieloans/magpie-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add mcp -- npx -y @magpieloans/magpie-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@magpieloans/magpie-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@magpieloans/magpie-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mcp npx -y @magpieloans/magpie-mcp
```

## When to use it
- query live Solana lending pool states and liquidations
- simulate SOL borrowing terms against token collateral
- arm take-profit or stop-loss triggers inside loan collateral vaults
- build transaction payloads to repay or deposit into Magpie loans

## Example prompts
- Check my active Magpie loans and show current pool liquidation thresholds.
- Simulate a SOL borrow against my collateral and estimate the liquidation price.
- Set a 2x take-profit trigger on the collateral vault of my active loan.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44591
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5469
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2817
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2197
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
