nutho-preset-editor
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Nutho Preset Editor
English | ภาษาไทย
An editor and Model Context Protocol (MCP) server for SillyTavern Chat Completion presets. A browser UI and AI agents (Claude Desktop, Claude Code, Cursor, Cline, and other MCP clients) work on the same in-memory document, with revision checks so neither can silently overwrite the other.
Contents
Related MCP server: Pure Writer MCP
Features
One shared session. The web UI and every MCP client see the same document; changes are pushed to the browser through server-sent events.
Optimistic concurrency. Every write carries the revision and document id it was based on; a stale write is rejected with the current values.
Atomic batches with dry run, plus undo, redo, and revert.
Safe saving. Writing requires explicit confirmation and makes a byte-exact backup of the previous file first.
Fidelity to the SillyTavern format. Unknown fields, duplicate order references, marker rows, and legacy fields are preserved.
Diagnostics: orphan references, duplicate identifiers, missing built-in prompts, empty enabled prompts, unknown macros, and an offline preview with token estimates.
Agent-friendly MCP surface: every parameter is documented, errors carry a
hint, replies are compact by default, and ahelptool plus server instructions explain the workflow.
Requirements and setup
Node.js 22 or newer
Windows, macOS, or Linux
git clone https://github.com/nattaphat010447/nutho-preset-editor.git
cd nutho-preset-editor
npm installRunning
The server needs at least one root directory that contains your preset .json files, for example the SillyTavern OpenAI Settings folder. No directory is chosen automatically.
node server.js --root "/path/to/SillyTavern/data/default-user/OpenAI Settings" --port 4173--root can be repeated. PORT selects the port (default 4173). The server listens on 127.0.0.1 only.
On Windows, run.bat starts the server with a default root and opens the browser; start-server.ps1 is the PowerShell equivalent. Edit the root path and token at the top of run.bat for your machine.
npm start serves the legacy browser-only mode (--static), which has no shared session and no MCP.
Connecting an MCP client
stdio (recommended)
The stdio process checks whether the web server is running on 127.0.0.1:4173 (or PORT). If it is, MCP calls are forwarded to that live session, so the browser and the agent edit the same document. Otherwise it starts its own session over the roots you give it.
Roots can be passed as arguments or through NUTHO_PRESET_ROOTS (separate several with ;). Add --read-only to block all writes.
Claude Desktop (claude_desktop_config.json), Cursor, Cline, and similar clients:
{
"mcpServers": {
"nutho-preset-editor": {
"command": "node",
"args": ["C:/path/to/nutho-preset-editor/src/mcp/stdio.js"],
"env": {
"NUTHO_PRESET_ROOTS": "C:/path/to/SillyTavern/data/default-user/OpenAI Settings"
}
}
}
}Streamable HTTP
Start the web server with a token and connect a client to /mcp:
NUTHO_MCP_TOKEN="<random string of at least 32 characters>" node server.js --root "/path/to/presets"URL:
http://127.0.0.1:4173/mcpHeader:
Authorization: Bearer <your token>POST only; the endpoint is stateless. Requests must use
Content-Type: application/json, a loopbackHost, and either noOriginor the same origin.
Choose your own token. Do not reuse the example token in run.bat outside a local test.
How a session works
One document at a time. Open a file with
open, create one withscaffold_presetorcreate_default_st_preset, or load text withimport_jsonfollowed bybind.Every write is gated. Pass
expectedRevisionandexpectedDocumentId. Take them fromget_sessionor from the previous write response. With no document open, use0and"none".Changes live in memory until
saveis called withconfirm: true.undo,redo, andrevertonly affect memory.Indexes and identifiers. Prompts are a flat array; order sets reference prompts by
identifier. An index is a 0-based array position and shifts when items are added or removed, so tools acceptidentifierwherever possible.Order positions are
{"kind":"start"},{"kind":"end"},{"kind":"before","identifier":"chatHistory"}, or{"kind":"after","entryIndex":3}.Response size. Write tools and
get_sessionacceptresponseMode:summary(default): revision, document id, per-operation results, changed paths, counts.diff: the summary plus exact before and after values.full: the whole document (without the saved copy).
Errors have
code,message,details, and usually ahintthat names the next call to make.
Tool reference
45 tools. Call help for a guide on the server itself; help with topic operations lists every apply_batch command with arguments and an example.
Guide and session
Tool | Purpose |
| Usage guide. Topics: overview, workflow, operations, read_methods, settings, errors, examples. |
| Current document: id, revision, dirty state, prompt list, order sets. Returns null if nothing is open. |
| Preset files under the configured roots, with |
| Open a file as the active document. |
| Create a default SillyTavern preset and open it. |
| Create a preset and fill it in one atomic call (prompts, placement, settings). |
| Load JSON text as an unsaved document; bind it to a file name. |
| Write (with backup), re-read from disk, or close. |
| Memory-only history. |
Reading
Tool | Purpose |
| Paginated prompt list with position, depth, order, and references. |
| One or several prompts with full content and references (by index or identifier). |
| Order sets and the entries of one set. |
| Which order entries reference a prompt. |
| Structure check, diagnostics, and automatic fixes. |
| Offline synthetic render with token estimates. |
| Compare with the saved state, the base state, or another preset. |
| The preset as formatted JSON text. |
| Generic read-only query ( |
Editing
Tool | Purpose |
| Create a prompt; the identifier is generated from the name when omitted. |
| Change one field by index or identifier. |
| Change a user prompt identifier and update order references. |
| Copy a prompt, optionally into an order set. |
| Delete a user prompt; requires |
| Restore a built-in prompt (main, nsfw, jailbreak, enhanceDefinitions). |
| Reference a prompt from an order set; insert or move a reference. |
| Remove or toggle an order entry. |
| Rearrange or replace an order set. |
| Generation settings (see below). |
| Apply a fix object from |
| Up to 100 operations, atomic, with |
Settings allowed in update_settings, apply_batch, and scaffold_preset
Numbers:
openai_max_context,openai_max_tokens,temperature,top_p,top_k,top_a,min_p,frequency_penalty,presence_penalty,repetition_penalty,seed,n,names_behaviorBooleans:
stream_openai,max_context_unlocked,wrap_in_quotes,show_thoughts,squash_system_messages,continue_prefill,use_sysprompt,function_callingStrings:
new_chat_prompt,new_group_chat_prompt,new_example_chat_prompt,continue_nudge_prompt,impersonation_prompt,group_nudge_prompt,wi_format,scenario_format,personality_format,send_if_empty,assistant_prefill,assistant_impersonation,reasoning_effort
Unknown names and wrong types are rejected with the list of allowed names.
Examples
Build a preset in one call (no document open yet):
{
"expectedRevision": 0,
"expectedDocumentId": "none",
"rootId": "root_0",
"name": "MyRoleplay",
"prompts": [
{ "identifier": "main", "content": "You are the narrator of a story with {{user}}." },
{ "identifier": "style", "name": "Style", "content": "Write vivid, concise prose.",
"placement": { "kind": "before", "identifier": "chatHistory" } },
{ "identifier": "reminder", "name": "Reminder", "content": "Never act for {{user}}.",
"placement": { "kind": "after", "identifier": "chatHistory" } }
],
"settings": { "temperature": 0.9, "openai_max_tokens": 800 }
}scaffold_preset rehearses the request on a throwaway document first, so a bad request leaves your current session untouched. The new document is unsaved until you call save with confirm: true.
Several edits atomically, using an identifier created earlier in the same batch:
{
"expectedRevision": 3,
"expectedDocumentId": "<documentId>",
"dryRun": true,
"operations": [
{ "command": "createPrompt", "args": {
"prompt": { "name": "Tone", "content": "Warm and playful." },
"addToOrder": { "orderIndex": 0, "position": { "kind": "before", "identifier": "chatHistory" } } } },
{ "command": "addPromptToOrder", "args": {
"orderIndex": 1, "identifier": "tone", "position": { "kind": "before", "identifier": "chatHistory" } } }
]
}Resources and prompts
Resources:
preset://guide: usage guide.preset://schema/operations: everyapply_batchcommand with arguments and an example.preset://active,preset://active/prompts,preset://active/orders: the open document.preset://roots: configured roots and the preset files under them.
Prompts: create_roleplay_preset (guided build with scaffold_preset, content rating, language), audit_and_doctor_preset, tune_hyperparameters.
Environment variables
Variable | Used by | Meaning |
| web server, stdio bridge | HTTP port, default 4173. |
| web server | Enables |
| stdio | Preset directories, separated by |
Testing
npm testThe suite covers the core model, the headless document, the session service, the HTTP API, the MCP protocol (tools, resources, prompts, stdio), the schema quality of every tool, and browser behavior in headless Chromium.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
A shared, governed brain for AI agents: versioned context with approvals, local or hosted.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
FlicenseAqualityBmaintenanceEnables 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-- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to read, search, patch, create, and export chapters in local Windows manuscript databases through stdio, with dry-run previews, revision checks, atomic batch edits, idempotent retries, automatic backups, native history, and operation-level undo. It also covers outline navigation, volume/category management, and TXT comparison or export.MIT
- AlicenseAqualityCmaintenanceEnables AI agents to read and write Elgato Stream Deck desktop profile manifests, generate icons, wrap shell commands in script-backed keys, and restart the app so edits take effect. It runs either locally over stdio or remotely over a bearer-token-gated Streamable HTTP transport that adds a health-check tool.9MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to audit git diffs, scan for leaked secrets and unsafe APIs, detect breaking changes, triage issues, generate changelogs, and assess repository hygiene through native stdio JSON-RPC tools.7Apache 2.0