# TON MCP server

> Lets AI clients query TON liteservers directly for balances, account state, transactions, get-methods, and build unsigned swaps.

- Repository: https://github.com/tonnode/mcp
- Page: https://hostedmcp.org/servers/tonnode/mcp
- Transport: stdio, remote
- Stars: 20
- License: MIT
- Latest version: 0.9.2

## Install

### Claude Code

```sh
claude mcp add mcp -- npx -y @tonnode/mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@tonnode/mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@tonnode/mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp","type":"stdio","command":"npx","args":["-y","@tonnode/mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@tonnode/mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp -- npx -y @tonnode/mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp]
command = "npx"
args = ["-y", "@tonnode/mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp npx -- -y @tonnode/mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@tonnode/mcp"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `TONNODE_KEYS` | no | no |  |
| `TON_LITESERVERS` | no | no | Optional JSON array of private liteserver entries: [{"ip":"host","port":41000,"key":"<base64 ed25519>"}]. Defaults to the public global config. |
| `TON_NETWORK` | no | no | Set to "testnet" to use the testnet global config. |

## Tools (16)

- `get_balance`
- `get_jetton_balance`
- `get_jetton_info`
- `get_transactions`
- `get_account_state`
- `run_get_method`
- `parse_address`
- `get_masterchain_info`
- `get_swap_quote`
- `build_swap_tx`
- `get_crosschain_quote`
- `build_crosschain_swap_tx`
- `track_crosschain_swap`
- `disclose_crosschain_secret`
- `build_crosschain_refund`
- `generate_wallet`

## FAQ

### What can an AI agent do with the TON MCP server?

It can query TON liteservers for GRAM and jetton balances, account state, transaction history and contract get-methods, and get swap quotes to build unsigned transactions.

### Does the server sign or broadcast swap transactions?

No. It returns unsigned, TonConnect-ready messages; signing and sending stay with the wallet owner.

### How do I connect Claude Desktop or Cursor to it?

Add the server to your MCP client config with npx -y @tonnode/mcp; it connects to TON mainnet via the public global config by default.

### How is the hosted HTTP mode authenticated?

It uses Bearer API keys passed via the Authorization or X-API-Key header, with per-key rate limiting.

### Which wallets can generate_wallet create?

It produces a 24-word mnemonic, ed25519 keypair and address for v4, v3r2, v5r1 or highload_v3 contract versions.
