Skip to main content
Glama
gerasidev

SUI MCP Server

by gerasidev
README.md
# SUI MCP Server

A TypeScript MCP server for interacting with the SUI blockchain via CLI.

**Network**: Testnet (default)

## Tools

| Tool | Description |
|------|-------------|
| `sui_active_address` | Get current active SUI address |
| `sui_balance` | Get SUI balance for an address |
| `sui_objects` | Get all objects owned by an address |
| `sui_get_object` | Get details of a specific object |
| `sui_call` | Call a Move function on a smart contract |
| `sui_publish` | Publish a Move package |
| `sui_transfer_object` | Transfer an object to another address |
| `sui_faucet` | Request test SUI from faucet |
| `sui_network` | Get current network environment |
| `sui_addresses` | List all addresses in wallet |
| `sui_transaction` | Get transaction details by ID |
| `sui_gas` | Get gas objects for an address |

## Setup

```bash
npm install
```

Make sure SUI CLI is installed:
```bash
curl -fsSL https://docs.sui.io/guides/install | sh
```

Set up testnet:
```bash
sui client new-env --alias testnet --rpc https://fullnode.testnet.sui.io:443
sui client switch --env testnet
```

## Running

```bash
npm run build
npm start
```

## opencode Integration

Add to your `opencode.jsonc`:
```jsonc
{
  "mcp": {
    "sui": {
      "type": "local",
      "command": ["node", "YOUR_MCP_SERVER_PATH"]
    }
  }
}
```

## Claude

Add to your `.mcp.json`:
```json
{
  "mcpServers": {
    "sui": {
      "type": "stdio",
      "command": "node",
      "args": ["YOUR_MCP_SERVER_PATH"]
    }
  }
}
```

## Usage

### Call a Move function

```typescript
sui_call({
  package: "YOUR_PACKAGE_ID",
  module: "YOUR_MODULE_NAME",
  function: "FUNCTION_NAME",
  typeArgs: "YOUR_TOKEN_TYPE",
  args: "ARG1,ARG2",
  gasBudget: "50000000"
})
```

### Get objects for an address

```typescript
sui_objects({ address: "YOUR_ADDRESS" })
```

### Get object details

```typescript
sui_get_object({ objectId: "YOUR_OBJECT_ID" })
```

### Publish a package

```typescript
sui_publish({
  packagePath: "YOUR_PACKAGE_PATH",
  gasBudget: "100000000"
})
```

### Transfer an object

```typescript
sui_transfer_object({
  objectId: "YOUR_OBJECT_ID",
  to: "RECIPIENT_ADDRESS",
  gasBudget: "50000000"
})
```

## Tips

- **Gas Budget**: Default is 0.05 SUI (50000000 MIST). Increase for complex transactions.
- **Object IDs**: Must be in format `0x...` (66 chars)
- **Clock Object**: Use `0x6` for the Clock object on testnet
- **Type Arguments**: For custom tokens, use the full type: `0xTOKEN_ADDRESS::coin::COIN`

Maintenance

ActivityInactive
ResponsivenessNo issues