SDK/Getting started

Install

@esseyonsui/sui-sdk is version 0.1.12 and @esseyonsui/sui-mcp is version 0.1.16. Node 22 or newer: both packages set "engines": { "node": ">=22" }.

Put this in the project's package.json and run npm install. The overrides entry has to live in that root file. npm ignores an override that is only inside a dependency.

JSON
{
  "dependencies": {
    "@esseyonsui/sui-sdk": "0.1.12",
    "@esseyonsui/sui-mcp": "0.1.16"
  },
  "overrides": {
    "underscore": "1.13.8"
  }
}

npm install @esseyonsui/sui-sdk@0.1.12 @esseyonsui/sui-mcp@0.1.16 without that override prints three high advisories. They are one bug: GHSA-qpx9-hpmf-5gmw, unbounded recursion in underscore 1.13.6. The chain is snarkjs@0.7.6 → bfj → jsonpath, which pins underscore@1.13.6. 1.13.8 is the fixed release. The SDK calls snarkjs groth16.fullProve only (snarkjsProver, settleProver, provedPassFor). bfj is the snarkjs command-line JSON writer and is not on that path. ProverPaths.snarkjs takes another module's path. The proving keys are downloaded and checked by fetchProofBundle({ baseUrl, dir }) (membership and spend) and fetchSettleKeys({ baseUrl, dir }) (the Settle(16) key of the v2 rooms); see Private flows with the SDK.

The MCP package installs two commands: essey-sui-init, which links your agent to an account its owner approves once (Link your agent), and essey-sui-mcp, the server itself, over stdio.

The two id files#

The server reads its ids from two JSON files. Save them from the hosted API; each response is accepted exactly as saved.

Text
API=https://sui-agent-prototype-production.up.railway.app
curl -s $API/v1/config > essey-testnet.json
curl -s $API/v1/private/config > essey-private.json
Text
ESSEY_NETWORK=testnet
ESSEY_DEPLOYMENT=essey-testnet.json
ESSEY_PRIVATE=essey-private.json
ESSEY_AGENT_KEY_FILE=/path/to/agent.env

The server requires an agent key file before it starts, even to list its tools. It reads the path only from ESSEY_AGENT_KEY_FILE. That variable is required and has no default. From the project that installed the packages, this writes a mode-600 testnet file and prints the new address:

Shell
node --input-type=module -e "import { createAgentKeyFile } from '@esseyonsui/sui-sdk'; console.log(createAgentKeyFile('agent.env', 'testnet'))"

Point the server at it with ESSEY_AGENT_KEY_FILE=agent.env. essey-sui-init --key writes the same kind of file when that path is missing.

ESSEY_DEPLOYMENT is the deployment record: package, market, pool, oracle, loan coin and the shared Access the lending calls take. ESSEY_PRIVATE adds the private-flow ids and the essey_private_* tools; without it the server serves the public tools only. Public-tool signing limits are in MCP server.

What they depend on#

PackageRuntime dependencies
@esseyonsui/sui-sdk@mysten/sui 2.37.0, @mysten/seal 1.5.1, @noble/ciphers 2.4.0, @noble/curves 2.4.0, @noble/hashes 2.4.0, snarkjs 0.7.6
@esseyonsui/sui-mcp@esseyonsui/sui-sdk 0.1.12 and @mysten/sui 2.37.0. It speaks the stdio part of MCP itself rather than pulling in the official server SDK.

A tarball ships compiled dist/. In this repository the sources run under tsx.

Tests#

In each package folder: npm test and npm run typecheck.