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

@manifest-network/manifest-mcp-core

v0.25.0

Published

Shared library for Cosmos SDK blockchain logic, tool functions, and server utilities (Manifest Network)

Readme

@manifest-network/manifest-mcp-core

Shared library for Manifest MCP servers. Contains Cosmos SDK logic, on-chain tool functions, server utilities, and the LCD/REST adapter. This package is not an MCP server itself -- it provides building blocks that the chain, lease, fred, cosmwasm, and agent packages compose into servers.

Installation

npm install @manifest-network/manifest-mcp-core

What's inside

  • CosmosClientManager (client.ts) -- Keyed-instance client lifecycle with rate limiting and lazy init (RPC + LCD)
  • LCD adapter (lcd-adapter.ts) -- Converts LCD/REST responses to the RPC query client shape, making the codebase transport-agnostic
  • Module registry (modules.ts) -- Static maps of Cosmos SDK modules with metadata and handler functions
  • Query/transaction routing (cosmos.ts) -- Routes (module, subcommand, args) to per-module handlers
  • On-chain tool functions (tools/) -- e.g. getBalance, fundCredits, setItemCustomDomain, stopApp, executeTx (atomic multi-message tx), plus read helpers such as getLease / getSKUs (used by lease and fred packages)
  • Server utilities (server-utils.ts) -- withErrorHandling, jsonResponse, structuredResponse, bigIntReplacer, sanitizeForLogging, sanitizeForModelText
  • Tool annotation helpers (tool-metadata.ts) -- readOnlyAnnotations, mutatingAnnotations, manifestMeta (versioned _meta.manifest payload, MANIFEST_TOOL_META_VERSION = 1)
  • Wallet providers (wallet/) -- MnemonicWalletProvider (BIP-39), signArbitraryWithAmino (ADR-036)
  • Logger (logger.ts) -- Leveled logger (stderr output; defaults to warn, configurable via logger.setLevel(); the node package's bootstrap reads LOG_LEVEL and applies it)
  • Retry (retry.ts) -- Exponential backoff with transient/permanent error classification. Exceptions encountered while inspecting an error or its standard .cause chain stop retries and preserve the original rejection. See the retry contract.
  • Validation (validation.ts) -- Input validation helpers (requireString, requireUuid, parseArgs, etc.)

Supported modules

| Module | Query | Transaction | |--------|:-----:|:-----------:| | bank | yes | yes | | staking | yes | yes | | distribution | yes | yes | | gov | yes | yes | | billing | yes | yes | | sku | yes | yes | | group | yes | yes | | wasm | yes | yes | | poa | yes | yes | | tokenfactory | yes | yes | | ibc-transfer | yes | yes | | authz | yes | yes | | feegrant | yes | yes | | auth | yes | -- | | mint | yes | -- | | manifest | -- | yes |

Usage

import {
  CosmosClientManager,
  cosmosQuery,
  cosmosTx,
  createValidatedConfig,
} from '@manifest-network/manifest-mcp-core';

const config = createValidatedConfig({
  chainId: 'manifest-1',
  rpcUrl: 'https://your-rpc-endpoint/',
  gasPrice: '0.01umfx',
  addressPrefix: 'manifest',
});

Broadcast failures after submission

SDK-created signing clients snapshot the signed bytes, compute their SHA-256 transaction hash, and compare the native CheckTx response against it. After CheckTx succeeds, a returned hash of the wrong length or value fails before any transaction lookup; diagnostics retain the local hash. If the subsequent inclusion timer or transaction lookup fails, cosmosTx and executeTx report TX_FAILED with details.sent: true, details.transactionHash, operation context and a non-enumerable cause chain to the original error. A structured cancellation thrown by a custom transaction lookup retains OPERATION_CANCELLED. These errors are not automatically retried. Inspect the transaction before submitting another mutation: acceptance does not establish block inclusion or execution success, and no confirmation, code or height is inferred.

An arbitrary timeout or claimed txId supplies no submission evidence. Errors before observed acceptance (including undecodable CheckTx responses) and custom broadcast methods keep their existing behavior. Caller cancellation remains prompt, preserves details.reason, and conservatively reports sent: true once signing/broadcast begins. On the supported native signAndBroadcast/broadcast path, it also includes the local transactionHash if this operation observed acceptance before cancellation. It does not wait for acceptance or change the error when a later observation arrives. Custom signAndBroadcast or broadcast methods, SYNC-only calls and opaque compatibility callbacks gain no cancellation hash. A missing hash does not establish that nothing was sent. With a configured logger, initialization warns if unsupported signing-client broadcast methods prevent the guard from installing; failures may then lack submission diagnostics. MCP servers use their leveled stderr logger; SDK consumers can supply opts.logger. A manager with no configured sink remains silent. Compatible clients and servers share initialization diagnostics: the last sink other than noopLogger wins, and disconnecting its holder does not restore the previous sink. A default SDK logger cannot silence an already configured manager. Only the exported noopLogger instance is ignored; custom logger objects, including silent ones, are deliberate sink assignments. If post-connect initialization fails, including a throwing diagnostic sink, the manager attempts to disconnect the transport before propagating the failure. Use distinct wallet-provider adapters when initialization diagnostics need independent sinks; each SDK client's other logging still uses its own opts.logger. See the SDK error contract for reconciliation.

SSRF-guarded fetch

Core hosts a shared, SSRF-guarded fetch factory (used by the fred and agent-core packages to route provider / off-chain HTTP). It is Node-only and exposed via the dedicated subpath export @manifest-network/manifest-mcp-core/guarded-fetch -- not the package barrel (index.ts). Keeping it off the barrel keeps the barrel isomorphic: the guard dynamic-imports undici (which transitively pulls in node:async_hooks), so re-exporting it from the root would drag Node-only modules into browser / Deno bundle graphs.

import {
  createGuardedFetch,
  isBlocked,
} from '@manifest-network/manifest-mcp-core/guarded-fetch';

const guardedFetch = createGuardedFetch();
  • createGuardedFetch() returns a typeof fetch that DNS-resolves each connection target at connect time and rejects any address whose ipaddr.js range is not 'unicast'.
  • Default-deny, allow-only-'unicast' policy. Loopback, private, link-local (incl. cloud metadata at 169.254.169.254), multicast, reserved, carrier-grade-NAT, and every other non-unicast classification are blocked; unparseable / unresolvable hosts fail closed.
  • isBlocked(ip) exposes the same single-IP verdict for audit / test use -- returns { range, rfc } when blocked, null when allowed.
  • Browser / Deno: createGuardedFetch() throws by construction on non-Node runtimes. Pass your own opts.fetch to the consuming code path instead.

SSRF-guarded WebSocket transport

Core also hosts the Node WebSocket transport for ctx.events (@beta) -- the live-status seam that waitForLeaseStatus transparently upgrades to. Like the guarded fetch, it is Node-only and exposed via a dedicated subpath, @manifest-network/manifest-mcp-core/events-node -- not the package barrel -- because it dynamic-imports the optional ws dependency; keeping it off the root barrel keeps the barrel isomorphic (a browser injects its own native-WebSocket-backed EventTransport instead).

import { createNodeEventTransport } from '@manifest-network/manifest-mcp-core/events-node';

const events = createNodeEventTransport(); // guarded: true by default
  • createNodeEventTransport(opts?) returns an EventTransport whose open(url) connects via ws, applying the same connect-time SSRF guard as the fetch path: it DNS-resolves the host (shared assertUnicastHost), rejects any non-'unicast' address, and pins the connection to the resolved IP while keeping the hostname for the Host header + TLS SNI (DNS-rebinding-safe). { guarded: false } opts out for loopback dev / e2e.
  • ws is an exact-pinned optionalDependency, dynamic-imported; if it is absent, open() surfaces a clear error (via onError + a synthetic onClose).
  • Browser / Deno: createNodeEventTransport() throws by construction on non-Node runtimes. Inject your own EventTransport backed by the native WebSocket instead (or omit ctx.events to fall back to polling).

Universal off-barrel subpaths

Three low-level surfaces are browser-safe (no Node builtins) but kept off the package barrel (index.ts) to keep the public surface small — each has its own subpath export:

  • @manifest-network/manifest-mcp-core/ssrf — the pure IP classifier isBlocked / isIpLiteral / BLOCKED_RANGES_IPV4 / BLOCKED_RANGES_IPV6 (ipaddr.js only, no node: builtins). This is the browser-safe half of the SSRF guard — what fred's URL-string check (isUrlSsrfSafe / validateProviderUrl) imports. The connect-time createGuardedFetch (undici) stays Node-only on /guarded-fetch. (ENG-490)
  • @manifest-network/manifest-mcp-core/faucet — the faucet ops requestFaucet / requestFaucetCredit / fetchFaucetStatus (+ their types), pure fetch + zod. A testnet/operator concern — deliberately off the barrel so export type * consumers don't inherit the testnet-only surface. (ENG-531)
  • @manifest-network/manifest-mcp-core/gas — buildGasFee + the gas-default constants DEFAULT_GAS_MULTIPLIER / DEFAULT_MAX_GAS, so a first-party sibling that broadcasts on its own can enforce the COSMOS_MAX_GAS gas-limit ceiling instead of passing 'auto'. (ENG-556)

Build

npm run build    # tsdown (platform: neutral)
npm run lint     # tsc --noEmit
npm run test     # vitest

License

MIT

Browser support

The root entry point and query/transaction helpers can be bundled for browsers. Inject a browser wallet and fetch transport through the client factory. Node-only /guarded-fetch and /events-node exports require Node; filesystem-backed operations also require Node when invoked. Browser-safe importability does not make every exported operation available in a browser. See the runtime guidance.