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

# MCP Server (AI Agents)

> Connect AI agents like Claude, Cursor, and VS Code Copilot to AKKA's DEX aggregation via the Model Context Protocol

AKKA provides an official [MCP server](https://github.com/Akka-Finance/akka-mcp-server) that lets AI agents get swap quotes, compare DEX prices, and build unsigned transactions — all through natural language.

## What is MCP?

The [Model Context Protocol](https://modelcontextprotocol.io/) is an open standard that connects AI assistants to external tools. With AKKA's MCP server, an AI agent can:

* Get the best swap quote across 25+ DEXes
* Compare prices across individual liquidity pools
* Build unsigned swap and approval transactions
* Look up token details and supported chains

The server is a thin client that calls the AKKA REST API. It does not hold private keys or execute transactions — it only returns unsigned transaction data.

## Prerequisites

An AKKA API key is required. [Get your API key here](/authentication).

## Install

<Tabs>
  <Tab title="Claude Desktop">
    Add to your `claude_desktop_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "akka-dex": {
          "command": "npx",
          "args": ["-y", "@akka-finance/mcp-server"],
          "env": {
            "AKKA_API_KEY": "your-api-key"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Claude Code">
    ```bash theme={null}
    claude mcp add akka-dex -e AKKA_API_KEY=your-api-key -- npx -y @akka-finance/mcp-server
    ```
  </Tab>

  <Tab title="Cursor">
    Add to `.cursor/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "akka-dex": {
          "command": "npx",
          "args": ["-y", "@akka-finance/mcp-server"],
          "env": {
            "AKKA_API_KEY": "your-api-key"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="VS Code">
    Add to `.vscode/mcp.json`:

    ```json theme={null}
    {
      "servers": {
        "akka-dex": {
          "command": "npx",
          "args": ["-y", "@akka-finance/mcp-server"],
          "env": {
            "AKKA_API_KEY": "your-api-key"
          }
        }
      }
    }
    ```
  </Tab>
</Tabs>

## Available tools

Once connected, your AI agent has access to these tools:

| Tool                   | Description                                        |
| ---------------------- | -------------------------------------------------- |
| `akka_get_quote`       | Get the best swap quote across all supported DEXes |
| `akka_get_swap`        | Build an unsigned swap transaction                 |
| `akka_dex_compare`     | Compare quotes across individual DEX pools         |
| `akka_get_spender`     | Get the router contract address for token approval |
| `akka_get_approve_tx`  | Build an ERC-20 approve transaction                |
| `akka_check_allowance` | Check current token spending allowance             |
| `akka_list_tokens`     | List tradeable tokens on a chain                   |
| `akka_get_token`       | Get token details by address                       |
| `akka_list_chains`     | List all supported chains                          |

## Example conversations

Once the MCP server is connected, you can ask your AI agent things like:

<AccordionGroup>
  <Accordion title="Get a swap quote">
    **You:** "What's the best rate for swapping 1 ETH to USDC on Arbitrum?"

    The agent calls `akka_get_quote` with the correct chain ID, token addresses, and amount in wei, then shows you the expected output.
  </Accordion>

  <Accordion title="Compare DEX prices">
    **You:** "Compare prices for 1000 USDC to WETH across all DEXes on Base"

    The agent calls `akka_dex_compare` and presents a table showing which DEX offers the best rate.
  </Accordion>

  <Accordion title="Build a swap transaction">
    **You:** "Build a swap transaction for 0.5 HYPE to USDC on HyperEVM for wallet 0xabc..."

    The agent calls `akka_get_quote` first, confirms the rate with you, then calls `akka_get_swap` to return the unsigned transaction data you can sign and broadcast.
  </Accordion>
</AccordionGroup>

## Configuration

The MCP server can be configured via environment variables:

| Variable             | Default                    | Description                  |
| -------------------- | -------------------------- | ---------------------------- |
| `AKKA_API_BASE`      | `https://api.akka.finance` | AKKA API base URL            |
| `AKKA_API_KEY`       | **required**               | API key for AKKA Finance API |
| `AKKA_MCP_TRANSPORT` | `stdio`                    | Transport: `stdio` or `http` |
| `AKKA_MCP_PORT`      | `3100`                     | Port for HTTP transport      |
| `AKKA_TIMEOUT`       | `15000`                    | Request timeout in ms        |

### HTTP transport

For remote or web-based agents, run the server with HTTP transport:

```bash theme={null}
npx @akka-finance/mcp-server --transport=http --port=3100
```

This exposes a Streamable HTTP endpoint at `http://localhost:3100/mcp`.

## Architecture

```
AI Agent (Claude, Cursor, VS Code, etc.)
  ↕ MCP Protocol (stdio or HTTP)
AKKA MCP Server (@akka-finance/mcp-server)
  ↕ HTTP REST
AKKA Finance API (api.akka.finance)
  ↕ On-chain
25+ DEXes across EVM chains
```

The MCP server translates natural language tool calls into AKKA API requests and formats the responses for the AI agent. All swap and approve tools return **unsigned transaction data** — signing and broadcasting is always the user's responsibility.

## Links

* [npm package](https://www.npmjs.com/package/@akka-finance/mcp-server)
* [GitHub repository](https://github.com/Akka-Finance/akka-mcp-server)
* [MCP Registry](https://registry.modelcontextprotocol.io)
* [Model Context Protocol](https://modelcontextprotocol.io/)
