Back to docs

MCP Integration

Connect your agent to Opal.

Opal exposes a native Model Context Protocol server. Any MCP-compatible agent — Claude, custom tools built on the Anthropic SDK, or your own orchestration — can call Opal tools to research, analyse, and trade on Solana.

Quick start

Add Opal's MCP server to your agent's configuration. The example below uses the Anthropic SDK, but any MCP client works.

// Configure the MCP server
const client = new McpClient({
  server: "https://mcp.heyopal.ai",
  apiKey: process.env.OPAL_API_KEY,
})

// Call a tool
const result = await client.callTool({
  name: "opal_top_tokens_by_volume",
  arguments: { limit: 5, window: "1h" },
})

console.log(result.tokens)

API keys are available from your Opal account. During the beta, keys are issued manually — email us to request one.

Available tools

opal_get_market_data

Get live price, volume, and liquidity for any Solana token.

opal_top_tokens_by_volume

Return the top N tokens by trading volume over a given window.

opal_token_price_history

Time-series price data for a token over a specified range.

opal_get_portfolio

Fetch positions, P&L, and wallet balances for the authenticated user.

opal_assess_risk

Run a risk check on a candidate trade before execution.

opal_execute_order

Submit a swap, limit, or market order through the DAX execution layer.

opal_list_strategies

List strategies registered in the user's Opal workspace.

opal_query

Read-only SQL against trade and market data. Useful for analytical questions.

Authentication

Every MCP request is authenticated with an API key. Read-only tools (opal_get_market_data, opal_top_tokens_by_volume, etc.) are available to all keys. Execution tools (opal_execute_order) require an additional wallet binding step where you connect a Solana wallet whose signing you've explicitly authorised.

Wallet signing happens locally in your environment via the custom tool pattern — the MCP server never sees your private key.

Need help?

MCP integration is new, and the docs above will expand as more developers start building. If something is missing or unclear, get in touch or message on X.