[GH-ISSUE #7675] Proposal: built-in MCP server so AI assistants can read and edit your library #4240

Closed
opened 2026-10-21 06:13:17 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Gunterlie on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7675

Originally assigned to: @Gunterlie, @SpicyMarinara on GitHub.

The problem

You can only change your characters, lorebooks, personas and presets by hand in the Marinara UI. AI assistants like Claude Desktop, Claude Code or Codex cannot see or edit them. There is an MCP server in tools/dev-mcp, but it is a developer tool: it needs a local checkout of the code, it talks over stdio only, and it cannot reach an installed or remote Marinara.

The idea

Marinara gets its own built-in MCP server. It is off unless you turn it on. When it is on, any MCP client can connect to your Marinara by URL and work with your library:

  • "Find every character that mentions the Northern Wastes and list them."
  • "Make Mira's backstory darker and fix the typo in her greeting." (shows you a preview first)
  • "Which lorebook entries would fire in my last chat, and why does the tavern entry never trigger?"
  • "Add three new entries for the city guard factions to my Ashfall lorebook."

How you turn it on

Add one or two secrets to your .env and restart:

MCP_TOKEN=<long random secret>         # turns the MCP server on, read-only
MCP_WRITE_TOKEN=<another long secret>  # optional: lets a client also make changes

Then point your MCP client at http://<your-marinara>/api/mcp and give it one of the tokens as a Bearer token.

  • A client with MCP_TOKEN can only read. Give this one to anything you do not fully trust.
  • A client with MCP_WRITE_TOKEN can also edit. Without it, write tools do not even show up.
  • With neither set, /api/mcp does not exist.

What it can do

Area Read token Write token adds
Characters find, read edit a field or a snippet, create
Lorebooks find, read entries edit, add, turn entries on/off
Personas, presets, regex scripts list, read edit
Chats list, read messages —
Prompts preview the next turn (no model call, no cost) —

Safety

  • MCP never gets around your existing protection. Basic Auth, the IP allowlist and admin rules still apply, and the token is checked on top of them.
  • Every change goes through the same code as the UI, so the same validation and version history apply.
  • Every write tool has a dry run and asks for a reason. The reason is saved in the version history, so you can see later what the assistant changed and why.
  • Write tools are marked as destructive, so clients like Claude Desktop ask you before they run one.
  • Not in the first version: deleting things, starting generations (they cost model quota), connections and API keys, and admin actions.

What happens to dev-mcp

tools/dev-mcp stays for developer jobs that must run outside the engine: rebuild and restart with rollback, the sanitized sandbox, and reading logs while the engine is down. It does not do user jobs anymore once this ships.

Status

  • Slice 1: the token gate, /api/mcp, read-only tools, regression test that MCP is off by default and refuses calls without a valid token
  • Slice 2: write tools for characters and lorebooks (dry run, reason, version history)
  • Slice 3: personas, presets, regex, prompt preview, docs (docs/CONFIGURATION.md, docs/REMOTE_ACCESS.md)

Slice 1 is in progress. Feedback on the scope and the token setup is welcome.

Originally created by @Gunterlie on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7675 Originally assigned to: @Gunterlie, @SpicyMarinara on GitHub. ## The problem You can only change your characters, lorebooks, personas and presets by hand in the Marinara UI. AI assistants like Claude Desktop, Claude Code or Codex cannot see or edit them. There is an MCP server in `tools/dev-mcp`, but it is a developer tool: it needs a local checkout of the code, it talks over stdio only, and it cannot reach an installed or remote Marinara. ## The idea Marinara gets its own built-in MCP server. It is **off unless you turn it on**. When it is on, any MCP client can connect to your Marinara by URL and work with your library: - "Find every character that mentions the Northern Wastes and list them." - "Make Mira's backstory darker and fix the typo in her greeting." (shows you a preview first) - "Which lorebook entries would fire in my last chat, and why does the tavern entry never trigger?" - "Add three new entries for the city guard factions to my Ashfall lorebook." ## How you turn it on Add one or two secrets to your `.env` and restart: ```env MCP_TOKEN=<long random secret> # turns the MCP server on, read-only MCP_WRITE_TOKEN=<another long secret> # optional: lets a client also make changes ``` Then point your MCP client at `http://<your-marinara>/api/mcp` and give it one of the tokens as a Bearer token. - A client with `MCP_TOKEN` can only **read**. Give this one to anything you do not fully trust. - A client with `MCP_WRITE_TOKEN` can also **edit**. Without it, write tools do not even show up. - With neither set, `/api/mcp` does not exist. ## What it can do | Area | Read token | Write token adds | | --- | --- | --- | | Characters | find, read | edit a field or a snippet, create | | Lorebooks | find, read entries | edit, add, turn entries on/off | | Personas, presets, regex scripts | list, read | edit | | Chats | list, read messages | — | | Prompts | preview the next turn (no model call, no cost) | — | ## Safety - MCP never gets around your existing protection. Basic Auth, the IP allowlist and admin rules still apply, and the token is checked on top of them. - Every change goes through the same code as the UI, so the same validation and version history apply. - Every write tool has a **dry run** and asks for a **reason**. The reason is saved in the version history, so you can see later what the assistant changed and why. - Write tools are marked as destructive, so clients like Claude Desktop ask you before they run one. - Not in the first version: deleting things, starting generations (they cost model quota), connections and API keys, and admin actions. ## What happens to dev-mcp `tools/dev-mcp` stays for developer jobs that must run outside the engine: rebuild and restart with rollback, the sanitized sandbox, and reading logs while the engine is down. It does not do user jobs anymore once this ships. ## Status - [ ] Slice 1: the token gate, `/api/mcp`, read-only tools, regression test that MCP is off by default and refuses calls without a valid token - [ ] Slice 2: write tools for characters and lorebooks (dry run, reason, version history) - [ ] Slice 3: personas, presets, regex, prompt preview, docs (`docs/CONFIGURATION.md`, `docs/REMOTE_ACCESS.md`) Slice 1 is in progress. Feedback on the scope and the token setup is welcome.
bsakaguchi 2026-10-21 06:13:17 +07:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@SpicyMarinara commented on GitHub (Oct 19, 2026):

Closing this for now to clear the board for the next release. It isn't a rejection: reopen it after the release when you pick it up again.

<!-- gh-comment-id:6264052154 --> @SpicyMarinara commented on GitHub (Oct 19, 2026): Closing this for now to clear the board for the next release. It isn't a rejection: reopen it after the release when you pick it up again.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4240
No description provided.