Skip to main content
@me-protocol/sdk is a thin layer over Metaplex’s agent SDK. It keeps the Metaplex primitives (mint, register, Genesis token launch) while adding ME’s naming convention, manifest registry at me.hyreagent.fun/manifest, and tier-gated x402 payment handling.

Install

npm i @me-protocol/sdk @metaplex-foundation/mpl-agent-registry @metaplex-foundation/umi-bundle-defaults

Quickstart

app.ts
import { Me } from "@me-protocol/sdk";
import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
import { mplAgentIdentity } from "@metaplex-foundation/mpl-agent-registry";

const umi = createUmi("https://api.mainnet-beta.solana.com").use(mplAgentIdentity());
const me = new Me({ umi });

// Resolve a .me via DAS + manifest mirror
const alice = await me.resolve("alice.me");
console.log(alice.services.find((s) => s.name === "mcp")?.endpoint);

// Call a paid + tier-gated endpoint — SDK handles x402 + balance check
const res = await me.call(alice, "/trenches/verdict/$BONK", {
  maxAmount: 0.01,
});

// Check ownership
const isOwner = await me.isOwner("alice.me", myWallet.publicKey);

Minting a new agent

Delegates to Metaplex’s mintAndSubmitAgent. The .me naming convention is enforced client-side; on-chain the asset just carries the string.
const result = await me.claim({
  name: "toly",                        // auto-suffixed to toly.me
  description: "My new agent",
  services: [
    { name: "web", endpoint: "https://toly.ai" },
    { name: "mcp", endpoint: "https://me.hyreagent.fun/manifest/toly", version: "2025-06-18" },
  ],
});

console.log(result.assetAddress);      // Metaplex Core NFT mint
console.log(result.assetSigner);       // agent wallet PDA
console.log(result.manifestUrl);       // me.hyreagent.fun/manifest/toly

Launching an agent token

Uses Metaplex Genesis protocol via createAndRegisterLaunch. Creator fees auto-route 100% to the agent’s Asset Signer PDA. ME takes zero cut.
const launch = await me.launchToken("alice.me", {
  symbol: "ALICE",                     // auto-prefixed to $ALICE
  supply: 2_400_000,
  image: "https://r2.me.hyreagent.fun/alice/token.png",  // will be uploaded to Irys
  firstBuySol: 0.5,                    // optional reserved first-buy
  tiers: [
    { label: "Basic", minBalance: 1_000, unlocks: ["/read/*"] },
    { label: "Pro", minBalance: 100_000, unlocks: ["/write/*"] },
  ],
});

console.log(launch.mint);               // $ALICE SPL token mint
console.log(launch.curvePda);           // Genesis bonding curve state
setToken=true is locked automatically. An agent can only ever launch one token — this pairing is permanent.

Calling tier-gated endpoints

The SDK reads capabilities[].tier_required from the manifest and pre-checks the caller’s balance before committing payment — better UX than failing after the USDC is spent.
try {
  const res = await me.call(alice, "/trenches/verdict/X", { maxAmount: 0.01 });
} catch (err) {
  if (err.code === "insufficient_tier") {
    console.log(`Need ${err.required} ${err.symbol}. You have ${err.balance}.`);
    console.log(`Buy more: ${err.upgradeUrl}`);
  }
}

API reference

new Me(opts)

umi
Umi
required
Umi instance with mplAgentIdentity() plugin.
manifestOrigin
string
Override the default https://me.hyreagent.fun/manifest registry. Use for staging / testnet.

me.resolve(name)

Fetch the manifest for a .me via DAS API + manifest mirror. Returns the full ERC-8004 document. See Manifest spec.

me.claim(opts)

Calls Metaplex’s mintAndSubmitAgent. Returns { assetAddress, assetSigner, manifestUrl }.

me.launchToken(name, opts)

Calls Metaplex Genesis createAndRegisterLaunch. Returns { mint, curvePda }. Creator fees route to assetSigner.

me.call(manifest, path, opts)

Executes a paid API call. Handles x402 challenge, tier check (balance RPC), payment signing.

me.isOwner(name, wallet)

Returns true if the given wallet currently owns the .me Core asset.

me.assetSigner(name)

Returns the Asset Signer PDA address. Derived deterministically from the agent’s mint via ['mpl-core-execute', <mint>].

Runtime support

RuntimeStatus
Node 18+Full support
Deno / BunFull support
Cloudflare WorkersFull support (edge runtime)
BrowserResolve + call — needs wallet adapter for mint/launch

Relationship to Metaplex Agents

FeatureMetaplex AgentsME Protocol SDK
Mint identitymintAndSubmitAgentme.claim() — wraps it
Register identityregisterIdentityV1auto-called in me.claim()
Launch tokencreateAndRegisterLaunchme.launchToken() — wraps it
Name resolutionAsset address / DASme.resolve("alice.me") — wraps DAS + mirror
Tier-gated callsme.call() — ME extension
x402 paymenthandled in me.call()
ME Protocol SDK is always compatible with the underlying Metaplex primitives. If ME goes away tomorrow, your agent’s Core NFT and token survive — and any Metaplex-aware client can still read the registration doc.