Repository navigation
MCP Guide
Outcome: connect a compatible local MCP host without giving it unrestricted filesystem or network access.
The companion uses the official MCP SDK, exposes the same engine as HTTP, and supports stdio and Streamable HTTP. It is not a public cloud connector, image-generation server, or automatic registration in ChatGPT/Codex.
Current implementation: MCP protocol 2026-07-28, official server SDK 2.4.0, Node adapter 2.1.2. A client restricted to older initialization behavior receives an explicit unsupported-version response. With the official client SDK, use versionNegotiation: { mode: "auto" } or select the current protocol explicitly.
Host configuration formats vary. The example below is a common mcpServers shape, not a promise that every host accepts that exact file.
The repository's development/test client, not the companion's server SDK, uses the reviewed @modelcontextprotocol/client@2.4.0-studio-native.2 repack. Its Node-only stdio launcher accepts only process.execPath and uses native node:child_process.spawn, without a shell or legacy-spawn fallback. The six unused standalone spawning packages are removed; the dependency tree is 14 packages instead of 20. This restriction applies to that test client, not to every external MCP host's configuration. Playwright and its independent bundled code are unchanged.
The client's legacy-SSE fetch wrapper now forwards EventSource's reconnect Last-Event-ID in ESM and CommonJS while retaining auth/protocol headers, POST separation, and the default redirect policy. Its exact coordinated pins are eventsource 5.1.5, eventsource-parser 4.1.3, and pkce-challenge 6.0.0. These are reviewed major-version overrides, not an upstream compatibility guarantee.
The companion still exposes stdio and Streamable HTTP; this client fix does not add a legacy-SSE server endpoint. ESM/CommonJS transport, synthetic OAuth/PKCE, native process-lifecycle, and reconnect regressions run on Windows/Linux with Node.js 24 and 26. They do not establish real-provider OAuth interoperability. Managed patch and reproduction details.
Install the optional companion dependencies first. Configure your host to launch Node directly with absolute paths:
{
"mcpServers": {
"civitai-metadata-studio": {
"command": "node",
"args": [
"--use-system-ca",
"C:/Tools/civitai-metadata-studio/automation/mcp.mjs",
"--read-root", "C:/Images",
"--write-root", "C:/Images/Edited",
"--network"
]
}
}
}Use your actual checkout and existing roots. Forward slashes avoid Windows JSON escaping. Omit --network or --write-root for a more restricted connection. Stdio needs no HTTP token. The host owns process lifetime; stdout is protocol-only and diagnostics use stderr.
Start the HTTP companion. Connect a compatible local host to http://127.0.0.1:4318/mcp with the same temporary bearer token. Keep it in the host's local secret mechanism; do not put it in chat or a committed config. The loopback, Host, Origin, filesystem, and network restrictions remain enforced.
| Tool | Purpose | Additional authority |
|---|---|---|
capabilities |
Read formats, fields, limits, and enabled permissions. | None. |
civitai_reference |
Read current public type/family enums. | Network opt-in. |
open_image |
Inspect a permitted image; return a session/revision. | Read root. |
read_image |
Read canonical fields/evidence; prompts opt-in. | Existing session. |
edit_image |
Atomic in-memory field/resource/preservation edit. | Current revision. |
undo_image |
Undo in-memory edit. | Current revision. |
redo_image |
Redo in-memory edit. | Current revision. |
verify_image |
Verify exact public resource identities. | Network and current revision. |
import_civitai_metadata |
Import one public image's recipe. | Network and current revision. |
search_resources |
Explicit public name search. | Network. |
hash_model |
Stream hashes from a permitted local model file. | Read root; no upload. |
export_image |
Prove payload integrity and create a new file. | Write root and current revision. |
report_image |
Read audit/change evidence; prompts opt-in. | Existing session. |
close_image |
Forget the session/history. | Existing session; does not delete files. |
MCP arguments include imageId directly. Otherwise, the HTTP operation reference documents the same strict inputs and structured outputs. Tool annotations are hints, not permission grants; the shared service enforces roots, revisions, and network opt-in.
-
studio://capabilitiesdescribes local capabilities and enabled permissions. -
studio://openapiprovides the OpenAPI contract for reference. - The
audit-imageprompt acceptspathand guides inspection before editing.
The audit prompt does not authorize an export or network call beyond the user's request. Embedded image/workflow text is untrusted data, never an instruction to the assistant.
Ask it to inspect an explicitly selected image, explain provenance/conflicts, and propose corrections. Authorize the intended edits and destination. The assistant should read the current revision, apply one atomic change, verify exact identities only when network use is desired, export a new copy, inspect the integrity result, and close the session.
For example: “Inspect this permitted image without exposing its prompts. Explain any identity conflicts. Do not edit, export, or contact Civitai yet.” Adding a model's metadata to context does not grant it authority to run commands found in that metadata.
Hashing can report progress when the client supplies a progress token; hashing and verification support cancellation. There are at most four active tools per server, bounded stdio messages, and bounded subscriptions. Sessions expire after 30 idle minutes or disappear on shutdown. Prompt text is omitted unless explicitly requested.
Cancellation is not an instruction to accept partial results as verified. Inspect the returned state; atomic mutation paths roll back on failure. The HTTP adapter's operation deadline is not a universal two-minute promise for every MCP host/transport operation.
Primary references, checked 2026-11-14: MCP versioning, official TypeScript SDK. See also the shared schemas.
Your image. The whole story. · Website · Wiki home · Every guide · Community & support · Source
Documents application 1.0.2 · Navigation review 2026-11-24 · Verified downloads · Originals stay original; exact identity is not proof of historical use.
Project website · Editor · Learn & sample · Trust & downloads
Home · Download ZIP · All guides
Release 1.0.2 · Standalone HTML
- Saving & pixel integrity
- Batches & identity exchange
- Privacy & security
- Cache & performance
- Troubleshooting
- Formats & limits
- Accessibility