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

@xera-web3/sharx-mcp-protocol

v0.3.1

Published

Shared TypeScript types between promotion-web3 backend and sharx-mcp-server. Single source of truth for the Sharx MCP protocol (Web3 ↔ MCP API contract). See specs/api-contract-v2-2.md.

Downloads

557

Readme

@xera-web3/sharx-mcp-protocol

Shared TypeScript types between promotion-web3 backend and sharx-mcp-server. The single source of truth for the Sharx MCP protocol — i.e. the Web3 ↔ MCP API contract.

This package contains only TypeScript type declarations + a couple of branded-type runtime guards. No business logic, no HTTP clients, no servers.

Why this package exists

Two products talk to each other across a process boundary:

  • promotion-web3 (Next.js) — exposes /api/v1/agent/* routes that AI agents can call (lookup, record)
  • sharx-mcp-server — exposes MCP-protocol tools (list_nft, mint_nft, lookup_*, etc.) that AI agents call

Without a shared type definition, the two sides drift: tx_hash becomes txHash, optional fields multiply, error envelopes mismatch. This package eliminates that drift by being the canonical schema both sides import.

Install (consumers)

Both consumer repos depend on this package via a git tag:

{
  "dependencies": {
    "@xera-web3/sharx-mcp-protocol": "git+ssh://[email protected]/xera-web3/sharx-mcp-protocol.git#v0.1.1"
  }
}

Then in code:

import type {
  WriteContext,
  ListNftInput,
  ListNftOutput,
  ApiResult,
  UserRecord,
  HealthResponse,
} from '@xera-web3/sharx-mcp-protocol';

What's in here

  • src/chain.tsChainId enum + DEFAULT_CHAIN_ID
  • src/session-key.tsSerializedSessionKey branded opaque type + runtime cast helper
  • src/idempotency.tsIdempotencyKey branded UUIDv4 + hash contract (sha256 of lowercased UUID)
  • src/errors.tsErrorCode enum, ApiError, ApiResult<T>, ScopeViolationDetails
  • src/scope-policy.tsMintCallPolicy, ListingCallPolicy, ListingSignaturePolicy, SessionKeyScopeBundle
  • src/pagination.tsCursorPage<T> + default/max page limits
  • src/health.tsHealthResponse shape (used by MCP /health and consumed by web3 /api/health/zerodev)
  • src/web3-routes.ts — promotion-web3 /api/v1/agent/* route I/O types (lookup, record)
  • src/mcp-tools.ts — MCP write-side tool I/O types (list_nft, mint_nft, plus WriteContext)
  • src/index.ts — barrel export

Specs

Versioned spec markdown is under specs/:

  • specs/v1.md — initial draft
  • specs/v2.md — first lock attempt
  • specs/v2-1.md — Option A locked (MCP self-contains chain logic)
  • specs/v2-2.md — current canonical spec (anchor reviews + dock + codex feedback incorporated)

When the spec changes:

  1. Add a new specs/v2-X.md (don't edit prior versions)
  2. Update the relevant src/*.ts types
  3. npm version patch|minor|major
  4. git push && git push --tags
  5. Notify both consumer repos to update

Maintenance ownership

Owned by Xera ⚡ (PM/integrator role). Contract changes flow:

Tim decides → Xera writes spec MD → Xera updates types → Xera bumps version
  → git push --tags → Xera notifies web3 + sharx-mcp builders
  → builders run `npm install <package>@^<new>` → fix tsc errors → ship patch PR

Builders (web3, sharx-mcp) do not modify this package directly. If they need a contract change, they request via Xera.

Versioning

Semver:

  • patch (0.1.x) — bug fix in types, no consumer change needed
  • minor (0.x.0) — additive (new optional fields, new types), backwards-compatible
  • major (x.0.0) — breaking change, both consumers must follow up + URL prefix should bump (/api/v1/agent/*/api/v2/agent/*)

Pin exact versions on the consumer side via #v0.1.1 git tag.

License

Private. Internal use within xera-web3 org only.