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

metro-mcp-plugin-zustand

v0.1.0

Published

metro-mcp plugin for debugging Zustand stores (inspect, modify, dispatch via CDP)

Readme

metro-mcp-plugin-zustand

A Metro MCP plugin for inspecting and manipulating Zustand stores in your React Native app during development.

Installation

bun add -D metro-mcp-plugin-zustand
# or
npm install --save-dev metro-mcp-plugin-zustand

Setup

1. Register the plugin

Add the plugin to your metro-mcp.config.ts:

import { defineConfig } from 'metro-mcp';

export default defineConfig({
  plugins: ['metro-mcp-plugin-zustand'],
});

2. Initialize in your app

Call initializeZustandMetroMcp() in your app entry point, passing a map of store names to store objects. Wrap it in a __DEV__ guard so it's never included in production builds.

import { initializeZustandMetroMcp } from 'metro-mcp-plugin-zustand';
import { useBearStore } from './stores/bearStore';
import { useUserStore } from './stores/userStore';

if (__DEV__) {
  initializeZustandMetroMcp({
    bears: useBearStore,
    user: useUserStore,
  });
}

Note: Pass the store object itself (returned by create() or createStore()), not the hook — e.g. useBearStore where const useBearStore = create(...).

Tools

Once running, the following MCP tools are available:

zustand_list_stores

Lists all store names registered with initializeZustandMetroMcp().

zustand_get_state

Returns the current state of a store as a JSON-serializable object. Functions in state are represented as "[Function]", Sets and Maps are converted to plain objects.

| Parameter | Type | Description | |-----------|------|-------------| | storeName | string | Name of the store to inspect |

zustand_set_state

Updates a store's state. By default the provided object is merged (shallow) with the existing state. Set replace: true to fully replace the state instead.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | storeName | string | — | Name of the store to update | | state | object | — | State to apply | | replace | boolean | false | If true, replaces the entire state instead of merging |

Note: Only JSON-serializable values can be set via this tool. Functions and other non-serializable values in your store will not be affected.

zustand_reset_state

Resets a store to the state it had when initializeZustandMetroMcp() was called. For Zustand v4+ stores this uses getInitialState(); for older stores it falls back to the state captured at initialization time.

| Parameter | Type | Description | |-----------|------|-------------| | storeName | string | Name of the store to reset |

License

MIT