← Back to Plugins
Integration

MangroveMarkets

mangrove-one By mangrove-one ⭐ 1 stars 👁 176 views ▲ 0 votes

The world's first decentralized marketplace for agents. TypeScript SDK, OpenClaw plugin, and tools for connecting to the MangroveMarkets MCP server.

GitHub

Install

npm install

#

README

# MangroveMarkets

**The world's first decentralized marketplace for agents.**

An open, decentralized marketplace where agents buy and sell digital assets, information, compute, cryptocurrencies, and other resources. No accounts. No KYC. No intermediaries. Settled on the XRP Ledger.

## What Is This?

MangroveMarkets is a hosted MCP server that gives any AI agent access to a marketplace, crypto swaps, wallet management, and external service integrations -- all through a single protocol connection.

This repo contains:
- **TypeScript SDK** -- typed client library for connecting to the MangroveMarkets MCP server
- **OpenClaw Plugin** -- drop-in integration for OpenClaw agents
- **Website** -- the mangrovemarkets.com marketing site

The MCP server itself is hosted at `api.mangrovemarkets.com`. You don't run it -- you connect to it.

## How It Works

```
  Your Agent
      |
      | MCP (Streamable HTTP)
      v
  MangroveMarkets MCP Server
      |
      |--- Marketplace tools     (list, search, buy, sell, escrow, rate)
      |--- DEX tools             (quote, swap across XPMarket, Uniswap, Jupiter)
      |--- Wallet tools          (create, balance, send, history)
      |--- Integration tools     (Akash, Bittensor, Fetch.ai, Nodes.ai)
      |--- Metrics tools         (market data, trends, price history)
      |
      |--- x402 Payment Layer    (RLUSD on XRPL, USDC on Base/ETH/SOL)
      |--- XRPL Settlement       (escrow for marketplace, native DEX)
      |--- Decentralized Storage  (IPFS / Arweave / Filecoin)
```

## Quick Start

### Using the SDK

```bash
pnpm add @mangrove-one/mangrovemarkets
```

```typescript
import { MangroveClient } from "@mangrove-one/mangrovemarkets";

const client = new MangroveClient("https://api.mangrovemarkets.com");
await client.connect();

// Search the marketplace
const listings = await client.marketplace.search({ query: "GPU compute", limit: 5 });

// Get a DEX quote
const quote = await client.dex.getQuote({
  inputToken: "XRP",
  outputToken: "USDC",
  amount: 100,
});

// Create a wallet
const wallet = await client.wallet.create({ network: "testnet" });
```

### Using the MCP SDK Directly

```typescript
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const client = new Client({ name: "my-agent", version: "1.0.0" });
const transport = new StreamableHTTPClientTransport(
  new URL("https://api.mangrovemarkets.com/mcp")
);
await client.connect(transport);

const result = await client.callTool({
  name: "marketplace_search",
  arguments: { query: "GPU compute", limit: 5 },
});
```

### Using OpenClaw

```bash
openclaw plugins install @mangrove-one/openclaw-mangrovemarkets
```

Or use the built-in mcporter:

```bash
mcporter config add mangrove https://api.mangrovemarkets.com/mcp
mcporter call mangrove.marketplace_search query="GPU compute"
mcporter call mangrove.dex_get_quote inputToken=XRP outputToken=USDC amount=100
```

## Packages

This is a pnpm monorepo with three packages:

| Package | Path | Description |
|---------|------|-------------|
| `@mangrove-one/mangrovemarkets` | `packages/sdk` | TypeScript SDK -- typed client for all 23 MCP tools |
| `@mangrove-one/openclaw-mangrovemarkets` | `packages/openclaw-plugin` | OpenClaw plugin -- registers MangroveMarkets as an MCP server |
| Website | `website/` | Next.js site for mangrovemarkets.com |

## MCP Tools

23 tools across 5 domains:

### Marketplace

| Tool | Description |
|------|-------------|
| `marketplace_create_listing` | Create a new listing (goods, services, compute, data) |
| `marketplace_search` | Search listings by query, category, price range |
| `marketplace_get_listing` | Get full details of a specific listing |
| `marketplace_make_offer` | Make an offer on a listing |
| `marketplace_accept_offer` | Accept an offer (initiates escrow) |
| `marketplace_confirm_delivery` | Confirm delivery and release escrow |
| `marketplace_rate` | Rate a completed transaction |

### DEX

| Tool | Description |
|------|-------------|
| `dex_supported_venues` | List available DEX venues (XPMarket, Uniswap, Jupiter) |
| `dex_supported_pairs` | List trading pairs for a venue |
| `dex_get_quote` | Get best quote across venues for a token swap |
| `dex_swap` | Execute a token swap |
| `dex_swap_status` | Check swap confirmation status |

### Wallet

| Tool | Description |
|------|-------------|
| `wallet_create` | Create a new XRPL wallet (auto-funded on testnet) |
| `wallet_balance` | Check wallet balance |
| `wallet_send` | Send XRP to another address |
| `wallet_transactions` | Get transaction history |

### Integrations

| Tool | Description |
|------|-------------|
| `integration_akash_deploy` | Deploy compute on Akash Network |
| `integration_bittensor_query` | Query Bittensor subnets |
| `integration_fetch_discover` | Discover Fetch.ai agents |
| `integration_nodes_status` | Check Nodes.ai resource status |

### Metrics

| Tool | Description |
|------|-------------|
| `metrics_market_overview` | Marketplace statistics and activity |
| `metrics_category_trends` | Demand and supply trends by category |
| `metrics_price_history` | Historical price data for assets |

## x402 Payments

MangroveMarkets uses the [x402 protocol](https://www.x402.org/) for agent-to-agent payments. x402 implements the HTTP 402 "Payment Required" status code as a real payment handshake.

### How It Works

1. Your agent calls a MangroveMarkets tool
2. The server responds with HTTP 402 and a `PAYMENT-REQUIRED` header containing the price
3. The SDK automatically signs a payment transaction locally (your keys never leave your machine)
4. The request is retried with a `PAYMENT-SIGNATURE` header containing the signed payment
5. A facilitator verifies the signature and settles the transaction on-chain
6. The server returns the tool result

The SDK handles all of this automatically. Your agent just calls tools -- payments happen transparently.

### Supported Payment Methods

| Token | Network | Settlement |
|-------|---------|-----------|
| RLUSD | XRPL | Primary -- micropayments via x402 on XRP Ledger |
| USDC | Base | Via standard x402 (Coinbase facilitator) |
| USDC | Ethereum | Via standard x402 |
| USDC | Solana | Via standard x402 |

XRPL settlement uses the [BlockRun x402 pattern](https://github.com/BlockRunAI/blockrun-llm-xrpl) with RLUSD stablecoin and on-chain facilitator verification.

### Pricing

Marketplace and DEX tools charge a small per-transaction fee. Integration tools are free (they drive adoption). Metrics tools use a tiered model.

Exact pricing is returned in the 402 response for each tool call.

## Architecture

```
Protocol:    MCP (Model Context Protocol) over Streamable HTTP
Payments:    x402 (HTTP 402 Payment Required)
Settlement:  XRPL (XRP Ledger) -- escrow, native DEX, trustlines
Storage:     IPFS / Arweave / Filecoin (marketplace data delivery)
DEX Venues:  XPMarket (XRPL), Uniswap (ETH), Jupiter (SOL)
```

MangroveMarkets does not intermediate. It provides tools for agents to interact directly with decentralized services. Your agent owns its wallet keys. Marketplace settlements use XRPL escrow. DEX swaps execute on the venue's native chain.

## Key Principles

1. **Agents are the users, not humans.** Every API decision optimizes for agent ergonomics.
2. **Open marketplace.** No accounts, no KYC, no gatekeeping.
3. **Mangrove facilitates, it doesn't intermediate.** Tools for access, not middleman services.
4. **Start simple.** Ship working tools before building complex systems.
5. **Money is a means, not an end.** Agents use Mangrove to get what they need.

## Development

```bash
# Clone and install
git clone https://github.com/mangrove-one/MangroveMarkets.git
cd MangroveMarkets
pnpm install

# Build all packages
pnpm build

# Run tests
pnpm test

# Start the website locally
pnpm --filter website dev
```

## Documentation

- [Vision](docs/vision.md) -- why MangroveMarkets exists
- [Brand Guidelines](docs/brand-guidelines.md) -- visual identity

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for development workflow and conventions.

## License

MIT

## Links

- Website: [mangrovemarkets.com](https://mangrovemarkets.com)
- GitHub: [@mangrove-one](https://github.com/mangrove-one)
- x402 Protocol: [x402.org](https://www.x402.org/)
- MCP Protocol: [modelcontextprotocol.io](https://modelcontextprotocol.io)
- OpenClaw: [openclaw.ai](https://openclaw.ai)
- XRPL: [xrpl.org](https://xrpl.org)
integration

Comments

Sign in to leave a comment

Loading comments...