# TON PRIMES

> TON PRIMES is an open-source MCP server for games and play. Play TON PRIMES, a number-theory NFT game on TON, from an AI agent. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Telegram
- **Website:** https://primes.live
- **Repository:** https://github.com/konnikpahoni/primes/tree/HEAD/backend/mcp
- **MCP Registry name:** io.github.KonnikPahoni/ton-primes
- **Categories:** [games and play](https://ai-powered.com/categories/games-and-play), [crypto and web3](https://ai-powered.com/categories/crypto-and-web3)
- **Listing updated:** 2026-11-22

## About

This local MCP server lets an AI agent interact with TON PRIMES, a number-theory game on the TON blockchain and Telegram where each integer is minted in turn as an NFT and primes are proved on chain. The game describes its token's internal floor price as one that never falls.

The agent can read chain state, request a quote, then mint and bid. It runs over stdio from the npm package @ton-primes/mcp and can target testnet or mainnet, with testnet the default. Without a wallet mnemonic it is read-only; with a dedicated wallet's 24 words it can transact. Optional settings cover a referral number and a toncenter API key for higher rate limits.

Use a dedicated wallet only, since the mnemonic gives the agent spending ability.

## Features

- **Read chain state:** Inspect the game's on-chain state without a wallet.
- **Quote before acting:** Request a quote before minting or bidding.
- **Mint and bid:** Transact with a dedicated wallet when a mnemonic is provided.
- **Testnet or mainnet:** Choose the network by environment variable, defaulting to testnet.
- **Referral support:** Set a default referral number cited on mints.

## Good for

- Let an agent read TON PRIMES state
- Get a quote before minting a number
- Run the game on testnet safely
- Automate bidding with a dedicated wallet

## Install

### Claude Code (Terminal)

```sh
claude mcp add ton-primes --env PRIMES_MNEMONIC='<PRIMES_MNEMONIC>' --env TONCENTER_API_KEY='<TONCENTER_API_KEY>' -- npx -y @ton-primes/mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "ton-primes": {
      "command": "npx",
      "args": [
        "-y",
        "@ton-primes/mcp"
      ],
      "env": {
        "PRIMES_MNEMONIC": "<PRIMES_MNEMONIC>",
        "TONCENTER_API_KEY": "<TONCENTER_API_KEY>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "ton-primes": {
      "command": "npx",
      "args": [
        "-y",
        "@ton-primes/mcp"
      ],
      "env": {
        "PRIMES_MNEMONIC": "<PRIMES_MNEMONIC>",
        "TONCENTER_API_KEY": "<TONCENTER_API_KEY>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "ton-primes": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@ton-primes/mcp"
      ],
      "env": {
        "PRIMES_MNEMONIC": "<PRIMES_MNEMONIC>",
        "TONCENTER_API_KEY": "<TONCENTER_API_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "ton-primes": {
      "command": "npx",
      "args": [
        "-y",
        "@ton-primes/mcp"
      ],
      "env": {
        "PRIMES_MNEMONIC": "<PRIMES_MNEMONIC>",
        "TONCENTER_API_KEY": "<TONCENTER_API_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "ton-primes": {
      "command": "npx",
      "args": [
        "-y",
        "@ton-primes/mcp"
      ],
      "env": {
        "PRIMES_MNEMONIC": "<PRIMES_MNEMONIC>",
        "TONCENTER_API_KEY": "<TONCENTER_API_KEY>"
      }
    }
  }
}
```

## FAQ

### Is TON PRIMES read-only by default?

Yes. Without PRIMES_MNEMONIC set, it is read-only.

### Which networks work?

Testnet and mainnet, selected with PRIMES_NETWORK; testnet is the default.

### How do I install TON PRIMES?

It is an npm package, @ton-primes/mcp, run over stdio.

### Should I use my main wallet?

No. The mnemonic should belong to a dedicated wallet.

### Is TON PRIMES free?

Yes. TON PRIMES is open source, so you can use and self-host it for free.

### How do I add TON PRIMES to Claude Code?

Run this command in your terminal: claude mcp add ton-primes --env PRIMES_MNEMONIC='<PRIMES_MNEMONIC>' --env TONCENTER_API_KEY='<TONCENTER_API_KEY>' -- npx -y @ton-primes/mcp

### What are the best alternatives to TON PRIMES?

The closest alternatives to TON PRIMES are Space-core, TronEnergyFrog, BRAINIAC Account Abstraction, BRAINIAC Base Chain Data and Semiosis.

## Where this comes from

- Description: written from the project's website and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Space-core](https://ai-powered.com/mcp/space-core-2): Space-core is a free MCP server for games and play.
- [TronEnergyFrog](https://ai-powered.com/mcp/tronenergyfrog): TronEnergyFrog is an open-source MCP server for crypto and web3.
- [BRAINIAC Account Abstraction](https://ai-powered.com/mcp/brainiac-account-abstraction): BRAINIAC Account Abstraction is a paid MCP server for crypto and web3.
- [BRAINIAC Base Chain Data](https://ai-powered.com/mcp/brainiac-base-chain-data): BRAINIAC Base Chain Data is a paid MCP server for crypto and web3.
- [Semiosis](https://ai-powered.com/mcp/semiosis): Semiosis is a free MCP server for crypto and web3.
- [ArcanumFleet MCP Server](https://ai-powered.com/mcp/arcanumfleet-mcp-server): ArcanumFleet MCP Server is a paid MCP server for trading analysis.
- [Agent Exchange: find a paid API that works](https://ai-powered.com/mcp/agent-exchange-find-a-paid-api-that-works): Agent Exchange: find a paid API that works is a free MCP server for crypto and web3.
- [THE PASSWORD — Club MCP (Store Zero)](https://ai-powered.com/mcp/the-password-club-mcp-store-zero): THE PASSWORD — Club MCP (Store Zero) is an MCP server for e-commerce.

---
Source: https://ai-powered.com/mcp/ton-primes
