npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mcp3/sui

v1.0.18

Published

Model Context Protocol implementation for Sui Network

Readme

Sui MCP (Model Context Protocol)

A TypeScript implementation of the Model Context Protocol for the Sui Network.

GitHub

Features

  • MCP server for integration with AI assistants
  • Connect to Sui network nodes
  • Download ABI (Application Binary Interface) for Sui packages
  • Call view functions with type arguments support
  • Query events from the Sui blockchain
  • TypeScript support
  • Command-line interface

Prerequisites

  • Node.js (v16 or higher)
  • pnpm (v7 or higher)

Installation

  1. Clone the repository:
git clone <repository-url>
cd sui-mcp
  1. Install dependencies:
pnpm install
  1. Create a .env file in the root directory with your configuration:
SUI_RPC_URL=https://fullnode.mainnet.sui.io:443

Usage

MCP Server

The primary use case for this project is running an MCP server for integration with AI assistants.

Start the MCP server:

npx sui-mcp serve

The server provides the following tools for AI assistants:

  • sui-view-function: Call a view function for a given address (with type arguments support)
  • sui-download-abi: Get the ABI for a given object ID
  • sui-query-events: Query events from Sui RPC
  • sui-get-balance: Get the balance of a specific coin type for a wallet address
  • sui-get-all-balances: Get all coin balances for a wallet address
  • sui-get-coins: Get detailed information about coins owned by a wallet address
  • sui-get-coin-metadata: Get metadata for a specific coin type

CLI Usage

The project also provides a command-line interface for interacting with the Sui network.

Global Options

  • -n, --nodeUrl <nodeUrl>: Specify Sui RPC URL (defaults to value from .env or mainnet)
  • -v, --verbose: Enable verbose output

Commands

View Function

Call a view function for a given address:

npx sui-mcp view <package_module> <fn_and_params>

The function name can include type arguments in the format function<T0,T1>(arg1,arg2).

Example:

# Call a simple function
npx sui-mcp view 0x2::coin "total_supply(0x2::sui::SUI)"

# Call a function with type arguments
npx sui-mcp view 0x2::coin "balance<0x2::sui::SUI>(0x123)"
Get ABI

Get the ABI for a given package ID:

npx sui-mcp get-abi <object_id>

Options:

  • -j, --json: Output in JSON format
  • -l, --long-address: Display full addresses instead of shortened versions
  • -p, --public-only: Only show public functions (default: true)
  • -r, --read-only: Only show read-only non-void functions

Example:

# Get ABI for a package
npx sui-mcp get-abi 0x2

# Get ABI in JSON format
npx sui-mcp get-abi 0x2 --json
Query Events

Query events from Sui RPC:

npx sui-mcp query-events <filter>

Options:

  • -c, --cursor <cursor>: Pagination cursor (JSON string)
  • -l, --limit <limit>: Maximum number of events to return (default: 50)
  • -d, --descending: Sort events in descending order
  • -j, --json: Output in JSON format

Filter formats:

  1. txId - e.g., "0x123..."
  2. package::module::type - e.g., "0x2::coin::CoinEvent"

Examples:

# Get events by transaction digest
npx sui-mcp query-events 0x123abc

# Get events with a specific type
npx sui-mcp query-events 0x2::coin::CoinEvent

# Get events from a specific module
npx sui-mcp query-events 0x2::coin

Development

To run the project in development mode:

npm run dev

Building

To build the project:

npm run build

API Documentation

MCP Server

The MCP server is the primary way to use this project. It provides a server that can be integrated with AI assistants.

import { startServer } from 'sui-mcp';

// Start the MCP server
await startServer({ nodeUrl: 'https://fullnode.mainnet.sui.io:443' });

Core Functions

Call View Function

import { callViewFunction } from 'sui-mcp';

// Call a view function
const result = await callViewFunction({
  nodeUrl: 'https://fullnode.mainnet.sui.io:443',
  packageId: '0x2',
  module: 'coin',
  functionName: 'balance',
  params: ['0x123'],
  typeArguments: ['0x2::sui::SUI']
});

Download ABI

import { downloadABI } from 'sui-mcp';

// Download ABI for a package
const abi = await downloadABI(nodeUrl, packageId);

Query Events

import { queryEvents, parseEventFilter } from 'sui-mcp';

// Query events
const filter = parseEventFilter('0x2::coin::CoinEvent');
const events = await queryEvents({
  nodeUrl: 'https://fullnode.mainnet.sui.io:443',
  filter,
  limit: 10,
  descending: false
});

Get Balance

import { SuiClient } from '@mysten/sui/client';

// Get balance for a specific coin type
const client = new SuiClient({ url: 'https://fullnode.mainnet.sui.io:443' });
const balance = await client.getBalance({
  owner: '0x123...',
  coinType: '0x2::sui::SUI' // Optional, defaults to SUI if not specified
});

// Get all balances for a wallet
const allBalances = await client.getAllBalances({
  owner: '0x123...'
});

// Get coins owned by a wallet
const coins = await client.getCoins({
  owner: '0x123...',
  coinType: '0x2::sui::SUI', // Optional
  limit: 50 // Optional
});

// Get metadata for a specific coin type
const metadata = await client.getCoinMetadata({
  coinType: '0x2::sui::SUI'
});

License

MIT# mcp3