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.
- Source: github.com/pacifica-fi/pacifica-mcp
- Package:
@pacifica-fi/mcp-server
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
Placing or cancelling orders requires a signing key. See Configuration.
Quickstart
The server runs the same way in every client: the command isnpx -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, setPACIFICA_BASE_URL=https://api.pacifica.fiin theenvblock. 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.