> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decibel.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server Overview

> Model Context Protocol server for AI agent integration with Decibel DEX

## What is the Decibel MCP server?

The Decibel MCP server implements the [Model Context Protocol](https://modelcontextprotocol.io), allowing AI agents like Claude to trade on Decibel DEX programmatically. It exposes 25 tools covering:

* **Trading** - Place and cancel orders (limit, market, stop, TWAP), close positions, set TP/SL
* **Market data** - Prices, orderbook snapshots, market listings
* **Account management** - Balances, positions, orders, and trade history

<Info>
  The MCP server requires a [Node API token](/quickstart/node-api-key) and an API wallet for trading operations. Get your API token from [Geomi](https://geomi.dev) and create an API wallet at [app.decibel.trade/api](https://app.decibel.trade/api).
</Info>

The MCP server is bundled with the [Decibel CLI](/cli/overview) (`@decibeltrade/cli`). Installing the CLI gives you both the command-line interface and the MCP server.

<CardGroup cols={3}>
  <Card title="Installation" icon="download" href="/agents/mcp/installation">
    Set up the MCP server with Claude Code, Claude Desktop, or other MCP clients.
  </Card>

  <Card title="Tool Reference" icon="wrench" href="/agents/mcp/reference">
    Full reference for all 25 tools with parameters and descriptions.
  </Card>

  <Card title="CLI Reference" icon="terminal" href="/cli/reference">
    The CLI exposes the same functionality for direct terminal use.
  </Card>
</CardGroup>

## How it works

The MCP server runs as a local stdio process. An MCP-compatible client (like Claude Code or Claude Desktop) launches the server and communicates with it over stdin/stdout using the Model Context Protocol.

Each MCP tool maps directly to a CLI action. The server validates inputs using Zod schemas, calls the Decibel SDK to execute on-chain transactions or query market data, and returns JSON results.

```
AI Agent <-> MCP Client <-> Decibel MCP Server <-> Decibel SDK <-> Aptos Blockchain
```

## Available tools

The server exposes 25 tools organized into four categories:

| Category         | Tools | Description                                                                 |
| ---------------- | ----- | --------------------------------------------------------------------------- |
| Trading          | 5     | Limit, market, stop-limit, stop-market, TWAP                                |
| Order management | 6     | Close, cancel, cancel all, cancel TWAP, TP/SL set & cancel                  |
| Account queries  | 9     | Positions, orders, balances, TWAPs, TP/SL, trade/order/funding/TWAP history |
| Market data      | 3     | Markets list, price, orderbook                                              |
| Configuration    | 2     | Leverage, margin type                                                       |

See the [Tool Reference](/agents/mcp/reference) for complete details on each tool.

## Related

* [CLI Overview](/cli/overview) - Use the same functionality from the terminal
* [TypeScript SDK](/typescript-sdk/overview) - Build custom integrations in TypeScript
* [REST API](/api-reference/rest/overview) - Direct HTTP API access
* [LLMs.txt](/agents/llms-txt) - Machine-readable documentation for AI agents
