Skip to main content
Glama
n1snt
by n1snt
README.md
# redux-mcp

`redux-mcp` lets AI tools (via MCP) and your app connect to Redux state in a simple way.

It gives you:

- MCP tools to read state, list actions, dispatch actions, and reset history
- A WebSocket runtime for live state updates
- A simple API to register your own Redux stores

## What It Does

After integration, LLMs or clients can:

- read current Redux state
- see available/observed actions
- dispatch actions into your store
- receive live updates over WebSocket

## Install

Use in your app:

`npm install redux-mcp`

For local development of this repo:

`npm install`

## Integrate In Your App

### Quick start (auto-start runtime)

```ts
import "redux-mcp";
```

This auto-starts the runtime WebSocket server on:

- `ws://localhost:8788/redux-events`

### Register your Redux stores (recommended)

```ts
import { registerStoresForMCP } from "redux-mcp";

registerStoresForMCP({
  stores: [{ storeName: "app", store }],
});
```

Notes:

- `store` should provide `getState()` and `dispatch(...)`
- multiple stores are supported
- action types are learned from observed dispatched actions

### Manual runtime control (optional)

```ts
import { startReduxRuntimeServers } from "redux-mcp";

const runtime = startReduxRuntimeServers({
  websocketPort: 8788,
  websocketPathname: "/redux-events",
});

// runtime.stop();
```

## Install MCP In Cursor

Add this to Cursor MCP config:

```json
{
  "mcpServers": {
    "redux-mcp": {
      "command": "npx",
      "args": ["-y", "redux-mcp"]
    }
  }
}
```

If Cursor cannot find `npx` (`spawn npx ENOENT`), use the absolute `npx` path instead:

```json
{
  "mcpServers": {
    "redux-mcp": {
      "command": "/absolute/path/to/npx",
      "args": ["-y", "redux-mcp"]
    }
  }
}
```

Then restart MCP servers in Cursor.

Available tools:

- `redux_get_state`
- `redux_get_state_diff`
- `redux_get_actions`
- `redux_dispatch_action`
- `redux_reset_state`

For detailed Cursor setup: `documentation/cursor-mcp-setup.md`.

TDQS

A3.8/5.0

Scored across 5 tools

Disambiguation5/5

Each tool serves a unique purpose: dispatching actions, retrieving actions/history, getting state, computing state diffs, and resetting state. No overlaps exist.

Naming Consistency5/5

All tools follow the consistent pattern 'redux_verb_noun', using snake_case and clear verbs (dispatch, get, reset). No deviations.

Tool Count5/5

Five tools cover the essential operations for Redux state management without being excessive or insufficient. The count matches the domain scope.

Completeness5/5

The set covers all key Redux interactions: dispatching, reading state, diffing, resetting, and viewing action history. No obvious gaps for a basic server.

Maintenance

ActivityInactive
ResponsivenessNo issues