Skip to main content
Glama

Nutho Preset Editor

A high-performance, concurrency-safe editor and Model Context Protocol (MCP) integration server for SillyTavern Chat Completion presets.

Nutho Preset Editor bridges visual prompt engineering in the browser with autonomous AI agent workflows in Claude Desktop, Cursor, Cline, Open Code, and Antigravity. It enables real-time collaborative preset authoring, structural validation, macro diagnostics, and non-destructive prompt ordering.


Architectural Highlights

  • Dual-Transport MCP Architecture: Provides full Model Context Protocol server capabilities over both standard input/output (stdio) and Streamable HTTP (SSE) on /mcp.

  • Live Session Auto-Bridge: When the web UI server runs on loopback port 4173, stdio MCP clients transparently route commands to the live session, ensuring the browser UI and AI agents operate on the exact same in-memory state.

  • Optimistic Concurrency & Revision Safety: Every operation tracks integer revision counters. Concurrent edits from agents and users are safely sequenced, preventing accidental overwrites and silent data corruption.

  • Real-Time Live Synchronization: Utilizes Server-Sent Events (SSE) on /api/session/events to push mutations, external disk changes, and active prompt navigations instantly to connected browser tabs.

  • Always Auto-Navigate: When an external AI agent creates, updates, or moves a prompt via MCP, the web UI automatically switches focus to the affected prompt without manual user interaction.

  • SillyTavern Schema Fidelity: Preserves all known and unknown fields, duplicate order references, marker rows, custom parameters, and format quirks across SillyTavern V1 and V2 specifications.

  • Strict Aesthetic Design: Engineered with a zero-emoji interface, monospace data views, zero layout shift (CLS 0.00), and accessible high-contrast typography.


Related MCP server: genpark-live-artifact-version-diff-tracker-skill

System Architecture

+-------------------------------------------------------------------+
|                         AI Coding Agents                          |
|    Claude Desktop  *  Cursor  *  Cline  *  Open Code  *  AGY      |
+---------------------------------+---------------------------------+
                                  |
               JSON-RPC 2.0 via   |   JSON-RPC 2.0 via
               HTTP SSE (/mcp)    |   stdio (Auto-Bridge Proxy)
                                  v
+-------------------------------------------------------------------+
|                    Nutho MCP Server & HTTP Service                |
|                  (Loopback HTTP: 127.0.0.1:4173)                  |
+---------------------------------+---------------------------------+
                                  |
                       Internal Session Bus (SSE)
                                  v
+-------------------------------------------------------------------+
|                        Browser Web UI                             |
|           Prompt Editor * Order Organizers * Diff & Diagnostics   |
+---------------------------------+---------------------------------+
                                  |
                       Filesystem I/O (Safe Backups)
                                  v
+-------------------------------------------------------------------+
|                 SillyTavern OpenAI Settings Directory             |
|                   (*.json Preset Files on Disk)                   |
+-------------------------------------------------------------------+

Key Capabilities

1. Visual Preset & Prompt Management

  • Interactive editing of system prompts, jailbreaks, pre/post-history instructions, and author notes.

  • Support for SillyTavern macros (e.g., {{char}}, {{user}}, {{input}}, {{model}}, {{lastMessage}}).

  • Drag-and-drop prompt reordering across generation contexts.

  • Marker element isolation and read-only source preservation.

2. Comprehensive Sampling Parameters

Full support for updating and validating LLM sampling parameters:

  • temperature, top_p, top_k, min_p, typical_p

  • presence_penalty, frequency_penalty, repetition_penalty, repetition_penalty_range

  • max_tokens, context_window, mirostat, mirostat_tau, mirostat_eta

  • cfg_scale, temperature_last, and custom sampler order arrays.

3. Diagnostics and Diff Engine

  • Macro audit to identify undefined or malformed placeholders.

  • Side-by-side comparative diffing between multiple preset files on disk.

  • Prompt impact analysis showing which generation orders reference a target prompt.

  • Automated repair routines (apply_fix, doctor) for orphan entries and broken references.

4. Enterprise Concurrency Control

  • Atomic multi-operation batch executions (apply_batch) committing under a single revision step.

  • Dry-run validation mode allowing agents to verify mutations before disk commit.

  • Deterministic undo and redo stack tracking preset history.

  • Automatic byte-exact file backup before writing changes to disk.


Installation & Prerequisites

Prerequisites

  • Node.js version 22.0.0 or higher

  • Windows, macOS, or Linux

Setup

Clone the repository and install dependencies:

git clone https://github.com/nattaphat010447/nutho-preset-editor.git
cd nutho-preset-editor
npm install

Launching the Server

Double-click run.bat or execute in terminal:

run.bat

This automatically initializes the server, sets the root directory to your SillyTavern OpenAI Settings path, and launches the Web UI in your default browser at http://127.0.0.1:4173.

Option B: PowerShell Launcher

.\start-server.ps1 -Root "C:\path\to\SillyTavern\data\default-user\OpenAI Settings"

Option C: Node CLI Direct Execution

node server.js --root "/path/to/SillyTavern/data/default-user/OpenAI Settings" --port 4173

Environment variables:

  • PORT: HTTP port to listen on (default: 4173).

  • NUTHO_MCP_TOKEN: Bearer token for authenticating HTTP SSE MCP requests (minimum 32 characters).


Model Context Protocol (MCP) Client Configuration

Nutho Preset Editor supports both Streamable HTTP (SSE) and standard stdio transports.

1. Claude Desktop

Add to %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "nutho-preset-editor": {
      "command": "node",
      "args": [
        "C:\\Users\\User\\Documents\\Code\\JS\\nutho-preset-editor\\src\\mcp\\stdio.js"
      ],
      "env": {
        "NUTHO_ROOT": "C:\\Users\\User\\Documents\\Code\\Phyton\\SillyTarvern\\data\\default-user\\OpenAI Settings"
      }
    }
  }
}

2. Cursor / Cline

Add to cline_mcp_settings.json:

{
  "mcpServers": {
    "nutho-preset-editor": {
      "command": "node",
      "args": [
        "C:/Users/User/Documents/Code/JS/nutho-preset-editor/src/mcp/stdio.js"
      ],
      "env": {
        "NUTHO_ROOT": "C:/Users/User/Documents/Code/Phyton/SillyTarvern/data/default-user/OpenAI Settings"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

3. Open Code

Add to opencode.jsonc:

{
  "mcp": {
    "servers": {
      "nutho-preset-editor": {
        "command": "node",
        "args": [
          "C:/Users/User/Documents/Code/JS/nutho-preset-editor/src/mcp/stdio.js"
        ],
        "environment": {
          "NUTHO_ROOT": "C:/Users/User/Documents/Code/Phyton/SillyTarvern/data/default-user/OpenAI Settings"
        }
      }
    }
  }
}

4. HTTP SSE Client Configuration

When integrating with an HTTP-based MCP client:

  • SSE URL: http://127.0.0.1:4173/mcp

  • Headers:

    Authorization: Bearer nutho_preset_editor_secret_token_2026_key

MCP Tool Reference (40 Tools)

Session & Lifecycle Management

Tool

Description

get_session

Retrieve active preset metadata, file path, revision counter, and dirty state.

list_files

List all .json preset files in the configured root directory.

open

Load a specified preset file into the active workspace.

create_default_st_preset

Instantiate a clean SillyTavern default preset template in memory.

bind

Bind an in-memory or imported document to a target file path on disk.

save

Persist active workspace changes to disk with automatic byte backup.

reload

Discard in-memory changes and reload the preset directly from disk.

close

Close the active preset session and release memory buffers.

Prompt & Order Operations

Tool

Description

list_prompts

Enumerate all prompt blocks with identifiers, roles, and content previews.

get_prompt

Retrieve full content and attributes of a prompt by identifier.

create_prompt

Insert a new prompt block into the preset.

update_prompt

Modify text, role, marker flags, or metadata of an existing prompt.

delete_prompt

Remove a prompt block and detach associated references across all orders.

reset_prompt

Revert a prompt to its original factory state if provided by default schemas.

list_orders

List all generation order profiles configured in the preset.

get_order

Retrieve the ordered prompt sequence for a specific context identifier.

add_prompt_to_order

Add an existing prompt reference into an order at a target index or anchor.

move_prompt

Reorder a prompt entry within a specific order context.

detach_order_entry

Remove a prompt reference from an order without deleting the prompt source.

set_order_entry_enabled

Toggle the active execution state of a prompt within an order.

reorder_order_entry

Move an entry to an explicit new index position in the sequence.

replace_order

Replace an entire order sequence atomically.

reset_order

Revert an order sequence to default baseline configuration.

Sampling & Diagnostics

Tool

Description

update_settings

Update generation settings (temperature, top_p, top_k, penalty parameters).

get_prompt_impact

Analyze which orders and execution contexts depend on a given prompt.

validate

Perform strict structural and schema validation on the active preset.

diagnose

Run comprehensive health check detecting invalid macros, orphans, and anomalies.

doctor

Automatically repair detected schema inconsistencies and dangling references.

apply_fix

Apply an explicit diagnostic recommendation directly to the session.

compare_presets

Perform detailed semantic diff between two preset files on disk.

diff

Generate unified diff comparing working draft against disk state.

preview

Generate projected output sequence simulating prompt insertion order.

Transactional & Batch Tools

Tool

Description

apply_batch

Execute multiple operations atomically with optional dry-run preview.

undo

Revert the most recent operation in the session history.

redo

Re-apply the previously undone operation in the session history.

revert

Reset the active document state to the latest saved disk revision.

import_json

Ingest external raw JSON preset data into the working draft.

export_json

Export the current document state as a formatted JSON payload.


MCP Resources & Prompts

Available Resources

  • preset://active: Current active preset document JSON payload.

  • preset://orders: Graph mapping of all generation orders and prompt references.

  • preset://diagnostics: Real-time health diagnostic audit report.

  • preset://files: Catalog of discovered preset files on the local root path.

Available Prompts

  • analyze-preset: Guided agent inspection of system prompts, ordering logic, and token budgets.

  • compare-presets: Comparative prompt analyzing differences between two target presets.

  • optimize-sampler-settings: Agent audit of temperature, min_p, repetition penalty, and CFG values.


Verification & Testing

Nutho Preset Editor includes an automated test suite verifying protocol conformance, concurrency safety, browser rendering, and schema fidelity.

To run all test suites:

npm test

Test coverage includes:

  • Protocol Conformance: JSON-RPC 2.0 validation, strict schema guardrails, error code mapping.

  • Concurrency Safety: Race condition simulation, revision collision rejection, atomic transactions.

  • Aesthetic Consistency: DOM inspection verifying zero emoji characters and zero cumulative layout shift.

  • Browser Automation: Headless Chromium testing covering splitter drag, order manipulation, and SSE updates.


License

This project is licensed under the MIT License. See the LICENSE file for details.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables ChatGPT, Codex, and other AI clients to search, read, create, and carefully update Markdown notes in an Obsidian vault, either locally over stdio or on a VPS via Syncthing and an OpenAI Secure MCP Tunnel, while blocking writes when a file changed since it was last read.
    11 npm
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables developers and AI agents to compute deterministic in-memory unified diffs between successive versions of live artifacts and receive structured change telemetry in return. It runs with zero external dependencies and plugs into MCP-compliant clients such as Claude Desktop, Cursor, and Windsurf.
    8
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Exposes a living systems memory vault to autonomous agents, letting them search notes with BM25 ranking, read sections within token budgets, extract API/port/schema contracts, compute dependency blast radius, and run machine-verifiable invariant assertions before mutating code. It also supports surgical frontmatter edits, schema linting, wikilink integrity checks, and worklog recording, over stdio MCP.
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    Enables MCP agents to inspect and precisely edit a paired browser editor project through local stdio, with batch commands, previews, exports, validation, and guarded undo/redo while keeping changes hand-editable.
    11
    -