home / mcp / narrative graph mcp server

Narrative Graph MCP Server

Provides a Narrative Graph MCP server implementing the Random Tree Model to encode, traverse, and analyze narrative memory with configurable depth and ensemble methods.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "angrysky56-narrative-graph-mcp": {
      "command": "node",
      "args": [
        "/path/to/narrative-graph-mcp/dist/index.js"
      ]
    }
  }
}

You will run a Narrative Graph MCP server that implements the Random Tree Model to encode, traverse, and analyze narratives. This server lets you encode stories and other texts into hierarchical trees, generate ensembles to study recall variance, and retrieve summaries at different abstraction levels for practical analysis and research workflows.

How to use

You integrate the Narrative Graph MCP server with your MCP client to encode narratives into a hierarchical tree, generate ensembles for population-level analysis, and traverse narratives to obtain summaries at chosen abstraction levels. Use it to study how narratives are compressed, recalled, and analyzed across varying depths and memory constraints.

How to install

Prerequisites: you need Node.js 18 or newer and a compatible package manager such as npm or yarn.

Install dependencies by running the package manager in the project directory.

Build the server for production to generate the runnable JavaScript artifacts.

Run the server in development mode to enable automatic recompilation as you edit the source.

Additional sections

Configuration notes describe how to start and integrate the server with an MCP client. When you start the server, you can run it directly or via a wrapper that points to the compiled entry point.

Troubleshooting covers common startup issues, such as missing dependencies, build problems, or type errors, and provides steps to diagnose and resolve them.

Security and maintenance guidance emphasizes keeping dependencies up to date, validating inputs, and controlling access to MCP endpoints.

Available tools

rtm_create_narrative_tree

Creates a single Random Tree encoding of a narrative with configurable text, title, type, and memory constraints.

rtm_generate_ensemble

Generates a statistical ensemble of Random Trees to model population-level recall variance for a given narrative.

rtm_traverse_narrative

Traverses a narrative tree to retrieve summaries at specified abstraction depths and reports compression metrics.

rtm_find_optimal_depth

Finds the optimal traversal depth to achieve a target recall length.