mcp-mercado-bitcoin — Claude Code MCP server: install and setup
Connects AI coding assistants to the Mercado Bitcoin exchange for automated trading, orderbook tracking, and balance checks. Useful for Brazilian crypto workflows.
claude mcp add mcp-mercado-bitcoin -e MB_API_KEY=<MB_API_KEY> -- npx -y @codespar/mcp-mercado-bitcoinWhat mcp-mercado-bitcoin 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.
What it helps with
- 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 for the agent
- 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
How to install mcp-mercado-bitcoin
Platform CLI
claude mcp add mcp-mercado-bitcoin -e MB_API_KEY=<MB_API_KEY> -- npx -y @codespar/mcp-mercado-bitcoinReplace <…> with your own values
Platform CLI
codex mcp add mercado-bitcoin --env MB_API_KEY=<MB_API_KEY> -- npx -y @codespar/mcp-mercado-bitcoinReplace <…> with your own values
Config file
{
"mcpServers": {
"mercado-bitcoin": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-mercado-bitcoin"
],
"env": {
"MB_API_KEY": "<MB_API_KEY>"
}
}
}
}Replace <…> with your own values
Config file
{
"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
Platform CLI
gemini mcp add -e MB_API_KEY=<MB_API_KEY> mercado-bitcoin npx -y @codespar/mcp-mercado-bitcoinReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-mercado-bitcoin
How to install mcp-mercado-bitcoin in Claude Code?
Run claude mcp add mcp-mercado-bitcoin -e MB_API_KEY=<MB_API_KEY> -- npx -y @codespar/mcp-mercado-bitcoin in your terminal, replacing the placeholder with your actual key.
What does mcp-mercado-bitcoin do?
It gives AI assistants 20 tools to trade on Mercado Bitcoin. The agent can monitor prices, manage open orders, and check deposits or withdrawals.
Can I test mcp-mercado-bitcoin without real money?
Yes, Mercado Bitcoin provides a sandbox environment in user settings. You can pass sandbox API credentials via environment variables for safe testing.