state-bridge-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@state-bridge-mcpList all stores and their state."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
state-bridge-mcp
MCP server + client SDK for bridging Zustand stores over WebSocket. Lets any MCP-capable AI inspect and manipulate your app's live state.
How it works
┌─────────────┐ WebSocket ┌──────────────┐ stdio ┌──────────┐
│ Your App │──────────────▶│ MCP Server │◀─────────▶│ Claude │
│ (client) │◀──────────────│ (server) │ │ │
└─────────────┘ └──────────────┘ └──────────┘The server runs as an MCP server (launched by Claude, Cursor, etc.) and opens a WebSocket port. Your app connects as a client and exposes its Zustand stores. The AI can then list stores, read state, write state, and call actions.
Related MCP server: Tesseron
Installation
npm install state-bridge-mcpServer Setup
Add to your .mcp.json (or equivalent MCP config):
{
"mcpServers": {
"app-state": {
"command": "npx",
"args": ["state-bridge-mcp"]
}
}
}Custom port
{
"mcpServers": {
"app-state": {
"command": "npx",
"args": ["state-bridge-mcp", "--port", "9000"]
}
}
}Or via environment variable: STATE_BRIDGE_PORT=9000
Default port: 8098
Client Usage
import { createStateBridge } from 'state-bridge-mcp/client';
import { useSessionStore, useAppStore } from './store';
const bridge = createStateBridge({
stores: {
session: useSessionStore,
app: useAppStore,
},
url: 'ws://localhost:8098',
});
// Later, to tear down:
bridge.stop();React Native (Android emulator)
For Android emulator, use 10.0.2.2 to reach the host machine:
const bridge = createStateBridge({
stores: { session: useSessionStore, app: useAppStore },
url: 'ws://10.0.2.2:8098',
});Client Config
Option | Type | Default | Description |
|
| required | Named map of Zustand stores |
|
|
| WebSocket URL of the MCP server |
|
|
| Auto-reconnect interval in ms. |
|
| — | Called when WebSocket opens |
|
| — | Called when WebSocket closes |
MCP Tools
Once connected, the AI has access to these tools:
Tool | Description |
| Check if a client app is connected |
| List all stores and their top-level state keys |
| Read state from a store (supports dot-paths like |
| Write a value at a dot-path (supports arbitrary depth) |
| Invoke a store action function by name |
Store Compatibility
Any object with getState() and setState() works. Zustand stores satisfy this out of the box:
type StoreEntry = {
getState: () => Record<string, unknown>;
setState: (partial: Record<string, unknown>) => void;
};License
MIT
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jonjoe/mcp-state-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server