Mnemonica Strategy MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install @mnemonica/strategy
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add mnemonica-strategy -- node "<FULL_PATH_TO_STRATEGY>/dist/index.js"

Replace <FULL_PATH_TO_STRATEGY>/dist/index.js with the actual folder you prepared in step 1.

README.md

MCP server for Mnemonica runtime analysis via Chrome Debug Protocol.

@mnemonica/strategy

MCP (Model Context Protocol) server for Mnemonica runtime analysis via Chrome Debug Protocol.

Overview

Strategy connects to running Node.js applications via Chrome Debug Protocol to extract and analyze Mnemonica type hierarchies. It compares runtime types with Tactica-generated types to validate and improve static analysis.

Installation

npm install @mnemonica/strategy

Usage

Prerequisites

Your target application must be running with the debug flag:

# For NestJS
nest start --debug --watch

# For regular Node.js
node --inspect=9229 your-app.js

As MCP Server

npx @mnemonica/strategy

Configure with Roo Code

Add to .roo/mcp.json:

{
	"mcpServers": {
		"mnemonica-strategy": {
			"command": "node",
			"args": ["/code/mnemonica/strategy/lib/cli.js"]
		}
	}
}

MCP Tools Provided

The Strategy MCP server exposes 3 bundled tools:

1. `execute`

Execute any command from the 3 context folders (MCP, RPC, RUN).

Input:

  • context (string, required): Execution context - "MCP", "RPC", or "RUN"
  • command (string, required): Command name to execute
  • message (string, optional): JSON string containing command arguments

Example:

// Connect to NestJS debugger
execute {
  context: "RPC",
  command: "connection",
  message: "{ \"action\": \"connect\", \"host\": \"localhost\", \"port\": 9229 }"
}

// Check connection status
execute {
  context: "RPC",
  command: "connection",
  message: "{ \"action\": \"status\" }"
}

// Get runtime types
execute {
  context: "RPC",
  command: "get_runtime_types",
  message: "{}"
}

2. `list`

List available commands by context.

Input:

  • context (string, required): "MCP", "RPC", "RUN", or "ALL"

Example:

list { context: "ALL" }

3. `help`

Get detailed help for any command.

Input:

  • context (string, required): Command context
  • command (string, required): Command name

Example:

help { context: "RPC", command: "connection" }

Args Passing Mechanism (IMPORTANT)

Due to MCP protocol limitations, command arguments must be passed as a JSON string in the message field, not as direct object properties.

Correct format:

execute {
  context: "RPC",
  command: "connection",
  message: "{ \"action\": \"connect\", \"host\": \"localhost\", \"port\": 9229 }"
}

Incorrect format (will not work):

// DON'T DO THIS
execute {
  context: "RPC",
  command: "connection",
  args: { action: "connect" }  // This won't work!
}

Common Commands

Connection Management

// Connect to Node.js debugger
execute {
  context: "RPC",
  command: "connection",
  message: "{ \"action\": \"connect\", \"host\": \"localhost\", \"port\": 9229 }"
}

// Check connection status
execute {
  context: "RPC",
  command: "connection",
  message: "{ \"action\": \"status\" }"
}

// Disconnect from runtime
execute {
  context: "RPC",
  command: "connection",
  message: "{ \"action\": \"disconnect\" }"
}

Type Analysis

// Get runtime types from connected application
execute {
  context: "RPC",
  command: "get_runtime_types",
  message: "{}"
}

// Analyze type hierarchy via CDP (retrieves complete type tree from NestJS)
execute {
  context: "MCP",
  command: "cdp_analyze_type_hierarchy",
  message: "{}"
}

// Create type in NestJS via CDP
execute {
  context: "MCP",
  command: "cdp_create_type",
  message: "{ \"typeName\": \"MyType\" }"
}

// Load Tactica-generated types
execute {
  context: "MCP",
  command: "load_remote_tactica_types",
  message: "{ \"projectPath\": \"/path/to/project\" }"
}

// Compare runtime vs Tactica types
execute {
  context: "MCP",
  command: "compare_with_tactica",
  message: "{ \"projectPath\": \"/path/to/project\" }"
}

Memory Management

// Store memory in connected runtime
execute {
  context: "RPC",
  command: "store_memory",
  message: "{ \"key\": \"myKey\", \"data\": { ... } }"
}

// Recall memories
execute {
  context: "RPC",
  command: "recall_memories",
  message: "{ \"key\": \"myKey\" }"
}

Example Workflow

  1. Start your application with debug mode:

    cd tactica-examples/nestjs
    npm run start:debug
    
  2. Connect to the debugger:

    execute {
      context: "RPC",
      command: "connection",
      message: "{ \"action\": \"connect\" }"
    }
    
  3. Analyze runtime types:

    execute {
      context: "RPC",
      command: "get_runtime_types",
      message: "{}"
    }
    
  4. Compare with Tactica-generated types:

    execute {
      context: "MCP",
      command: "compare_with_tactica",
      message: "{ \"projectPath\": \"/path/to/project\" }"
    }
    

Command Contexts

Context Folder Execution Environment
MCP commands-mcp/ Local MCP server process
R

Tools (3)

executeExecute any command from the MCP, RPC, or RUN context folders.
listList available commands by context.
helpGet detailed help for any command.

Configuration

claude_desktop_config.json
{"mcpServers": {"mnemonica-strategy": {"command": "node", "args": ["/code/mnemonica/strategy/lib/cli.js"]}}}

Try it

Connect to my running Node.js application on port 9229 using the RPC context.
Get the current runtime types from the connected application.
Compare the current runtime types with the Tactica-generated types in my project path.
Analyze the type hierarchy of my NestJS application using the CDP context.

Frequently Asked Questions

What are the key features of Mnemonica Strategy?

Connects to running Node.js applications via Chrome Debug Protocol. Extracts and analyzes Mnemonica type hierarchies at runtime. Validates static analysis by comparing runtime types with Tactica-generated types. Supports memory management for storing and recalling data in the runtime. Provides a flexible command execution interface across MCP, RPC, and RUN contexts.

What can I use Mnemonica Strategy for?

Validating that runtime type behavior matches static type definitions in NestJS projects. Debugging complex type hierarchies in live Node.js environments. Automating the comparison between generated type schemas and actual runtime data. Managing application state and memory during runtime analysis sessions.

How do I install Mnemonica Strategy?

Install Mnemonica Strategy by running: npm install @mnemonica/strategy

What MCP clients work with Mnemonica Strategy?

Mnemonica Strategy works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Mnemonica Strategy docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare