Skip to content

MCP Server

@strata-js/mcp is an MCP (Model Context Protocol) server that bridges AI coding tools with your running Strata.js services via Redis. It lets tools like Claude Code, Cursor, and Windsurf discover, inspect, and call your services directly.

This is a lightsaber. You will cut your arm off.

The MCP server gives an AI tool direct access to your running services. It can discover every operation and send requests with arbitrary payloads. Do not use this in production. It is a development tool.

Things to consider before enabling it:

  • Data exposure. Every request and response flows through your LLM provider. If your services handle sensitive data (PII, credentials, financial data), that data will be sent to the LLM.
  • Destructive operations. An AI tool can call any operation it discovers. While the server blocks common destructive patterns (delete, remove, purge) by default, it cannot guarantee safety. A poorly worded prompt could trigger unintended writes or state changes.
  • No auth boundary. The MCP server connects to Redis with whatever credentials you give it. There's no additional auth layer between the AI tool and your services.

Use this for local development and debugging. Never point it at a production Redis instance.

What It Does

The MCP server exposes three tools to your AI assistant:

ToolDescription
strata-discoverLists all registered services and their operations.
strata-service-infoGets detailed info about a specific service group (operations, instance count, metadata).
strata-requestSends a request to a Strata service with a custom payload and returns the response.

This means your AI tool can:

  • Ask "what services are running?" and get a real answer
  • Inspect a service's available operations before calling them
  • Make actual requests to services and see the responses
  • Debug service behavior interactively

Setup

No global install needed. Add the server to your AI tool's MCP configuration:

Claude Code

Add to .mcp.json in your project root (or ~/.claude/mcp.json for global access):

json
{
    "mcpServers": {
        "strata": {
            "command": "npx",
            "args": ["@strata-js/mcp"],
            "env": {
                "STRATA_REDIS_HOST": "localhost",
                "STRATA_REDIS_PORT": "6379"
            }
        }
    }
}

Cursor

Add to .cursor/mcp.json:

json
{
    "mcpServers": {
        "strata": {
            "command": "npx",
            "args": ["@strata-js/mcp"],
            "env": {
                "STRATA_REDIS_HOST": "localhost",
                "STRATA_REDIS_PORT": "6379"
            }
        }
    }
}

Configuration

All configuration is via environment variables:

VariableDefaultDescription
STRATA_REDIS_HOSTlocalhostRedis host.
STRATA_REDIS_PORT6379Redis port.
STRATA_REDIS_DB0Redis database number.
STRATA_REDIS_USER--Redis username (if using ACLs).
STRATA_REDIS_PASS--Redis password.
STRATA_CLIENT_NAMEstrata-mcpClient name on the message bus.
STRATA_BLOCK_RULES(see below)Comma-separated wildcard patterns for blocked operations.

Block Rules

By default, the server blocks operations matching common destructive patterns:

*.save, *.delete, *.remove, *.purge, *.drop, *.truncate, *.destroy

You can customize this with the STRATA_BLOCK_RULES environment variable:

json
"env": {
    "STRATA_BLOCK_RULES": "*.delete,*.remove,admin.*"
}

Set to an empty string to disable blocking entirely (not recommended).

Requirements

  • Node.js >= 22.0.0
  • A running Redis instance with Strata services connected
  • An AI tool that supports MCP (Claude Code, Cursor, Windsurf, etc.)