# mcp-mercado-bitcoin

Connects AI coding assistants to the Mercado Bitcoin exchange for automated trading, orderbook tracking, and balance checks. Useful for Brazilian crypto workflows.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/crypto/mercado-bitcoin
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-mercado-bitcoin

## What it does

This server exposes 20 tools for interacting with Mercado Bitcoin through the Model Context Protocol. Your assistant can inspect live ticker numbers, fetch OHLCV candles, and inspect active bids and asks. It also handles account actions, such as checking asset balances, placing buy or sell orders, and triggering asset withdrawals.

Authentication relies on headers. Without `MB_API_KEY` and `MB_API_SECRET` defined in your environment, private account calls will fail immediately. Mercado Bitcoin offers sandbox credentials in its dashboard, so you can test execution logic without risking real funds.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `MB_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-mercado-bitcoin -e MB_API_KEY=<MB_API_KEY> -- npx -y @codespar/mcp-mercado-bitcoin
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mercado-bitcoin --env MB_API_KEY=<MB_API_KEY> -- npx -y @codespar/mcp-mercado-bitcoin
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mercado-bitcoin": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-mercado-bitcoin"
            ],
            "env": {
                "MB_API_KEY": "<MB_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mercado-bitcoin": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-mercado-bitcoin"
            ],
            "env": {
                "MB_API_KEY": "<MB_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MB_API_KEY=<MB_API_KEY> mercado-bitcoin npx -y @codespar/mcp-mercado-bitcoin
```
Replace <…> with your own values

## When to use it
- fetch live orderbook bids and asks for any supported trading pair
- execute and cancel limit or market orders
- check account balances across crypto and fiat currencies
- create withdrawal requests directly from the assistant

## Example prompts
- Check the orderbook and recent trades for BTC-BRL on Mercado Bitcoin
- Cancel all active orders for ETH-BRL using cancel_all_orders
- List my account balances and supported withdrawal networks for USDT

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

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
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
