Skip to content

MCP Server

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

How It Works

The MCP server runs in one of two modes depending on whether you provide a Redis connection.

Docs-Only Mode

Without STRATA_REDIS_HOST, the server provides documentation tools and prompts only. No backend connection is made — it's completely inert and safe to add to any project for Strata documentation access.

Available tools:

ToolDescription
strata-docsSearches Strata documentation.
strata-docs-apiLooks up API reference details.
strata-docs-guideRetrieves guide content by topic.

Connected Mode

With STRATA_REDIS_HOST set, the server connects to your Redis backend and enables service tools on top of the documentation tools.

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

Connected mode 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.

Additional tools (connected mode only):

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.

Docs Only

The minimal configuration — no environment variables needed:

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"]
        }
    }
}

Cursor

Add to .cursor/mcp.json:

json
{
    "mcpServers": {
        "strata": {
            "command": "npx",
            "args": ["@strata-js/mcp"]
        }
    }
}

Connecting to Services

To enable service tools, add Redis connection details:

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_HOST--Redis host. Required to enable service tools — without this, the server runs in docs-only mode.
STRATA_REDIS_PORT6379Redis port.
STRATA_REDIS_DB0Redis database number.
STRATA_REDIS_USERNAME--Redis username (if using ACLs).
STRATA_REDIS_PASSWORD--Redis password.
STRATA_BACKEND_TYPEredisBackend type (redis or redis-streams).
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
  • An AI tool that supports MCP (Claude Code, Cursor, Windsurf, etc.)
  • A running Redis instance with Strata services connected (only for connected mode)