Skip to main content
The Pacifica MCP server is a Model Context Protocol server that exposes Pacifica’s REST API as MCP tools.
An MCP client such as Claude Desktop, Claude Code, or OpenAI Codex can then read the markets and place trades on your behalf, using natural language.
It wraps the same REST endpoints documented elsewhere in this section, covering:
  • Market data: exchange info, prices, orderbook, candles, funding rates, and more.
  • Account and positions: balances, settings, positions, and history queries.
  • Order management: limit, market, stop, TP/SL, and TWAP orders, plus batch operations.
  • Spot: spot asset data, balances, and withdrawals.
It also adds on-chain funding tools that act on Solana directly: mint test USDP on testnet and deposit USDC/USDP into your exchange balance. The server is open source and published to npm:

Prerequisites

  • Node.js 18 or newer
  • A Pacifica account address (your main account or a subaccount)
  • For trading (optional): a signing key, either your main wallet’s secret key or, recommended, a revocable agent key bound to your account
Read-only access (market data and account queries) needs only the account address.
Placing or cancelling orders requires a signing key. See Configuration.

Quickstart

The server runs the same way in every client: the command is npx -y @pacifica-fi/mcp-server, which downloads and runs the latest published version automatically (no manual install step), configured through environment variables. At minimum, set ADDRESS to your account. Add a signing key (AGENT_PRIVATE_KEY, recommended, or PRIVATE_KEY) to place trades, or omit it for read-only access. Only the config format differs per client. See Client Setup for step-by-step instructions for Claude Desktop, Claude Code, OpenAI Codex, Factory, Hermes, and Crush. On startup the server logs the active account and auth mode to stderr (visible in the MCP logs), e.g. [pacifica-mcp] account=<address> mode=agent-key.
Note: By default the server targets the Pacifica testnet (https://test-api.pacifica.fi). To trade on production, set PACIFICA_BASE_URL=https://api.pacifica.fi in the env block. See Configuration for all environment variables.

Next Steps

  • Configuration: environment variables, auth modes, and security.
  • Client Setup: configs for Claude Desktop, Claude Code, OpenAI Codex, Factory, Hermes, and Crush.
  • Tools: the full list of tools the server exposes.