mcp-ikaos-story
mcp-ikaos-story
Stdio MCP server for creating and modifying iKAOS Story prototype content with Codex or Claude Code.
The MCP talks to the authenticated iKAOS Story API. Users do not need to clone ikaos-content-studio-v2026 or configure a local repository path. Story content/layout JSON lives in Supabase, while fixed workflow documents and source metadata remain read-only behind the API.
Boundaries
get_story_contextreturns the current content revision and authoritativedocsLink.start_storyupdates the confirmed type, compatible template, source receipt, and start status through the authenticated API; completed Stories are protected.save_story_contentwrites onlycontent_data; source, docs, Story identity, and other production metadata cannot be changed.bulk_update_story_statuspreviews and confirms a status-only update for typed Stories. The API writes onlystatus: awaiting_review.reset_storyalways requires a preview token. Confirm archives the complete production row atomically, preserves Story/Sheet/DOCX identity, and clears generated type, template, content, images, route, and revision.A Story whose Sheet type/template is set, or whose production is completed/deployed, also requires the exact
RESET <story_id>confirmation returned by preview.Every content write and reset confirmation is revision-protected. A stale operation returns a conflict instead of overwriting newer content.
Image generation is out of scope. Designers can upload and replace supplied image files through DF Asset Hub.
Asset Hub does not currently expose list or delete APIs. Removing an image URL from Story content does not remove its R2 object.
No Supabase service key is distributed to MCP users.
Install
npm install
npm run buildConfigure the Story API:
export IKAOS_STORY_API_URL=https://ikaos-content-studio-v2026.vercel.app
export IKAOS_STORY_API_TOKEN=your-project-scoped-api-tokenImage uploads use these defaults, so users do not need a df-login token:
export DF_ASSET_UPLOAD_URL=https://df-asset-hub.vercel.app/api/review/figma-images/upload
export DF_ASSET_PROJECT_ID=ikaos-story-2026Both DF_ASSET_* values are optional overrides. Preview links use IKAOS_STORY_API_URL as their origin. Never commit the Story API token.
Codex
codex mcp add ikaos-story \
--env IKAOS_STORY_API_URL=https://ikaos-content-studio-v2026.vercel.app \
--env IKAOS_STORY_API_TOKEN=your-project-scoped-api-token \
-- node /absolute/path/to/mcp-ikaos-story/dist/src/index.jsThe default Asset Hub endpoint and project namespace need no extra Codex env values. Verify with codex mcp list or /mcp.
Claude Code
claude mcp add --transport stdio \
--env IKAOS_STORY_API_URL=https://ikaos-content-studio-v2026.vercel.app \
--env IKAOS_STORY_API_TOKEN=your-project-scoped-api-token \
ikaos-story -- node /absolute/path/to/mcp-ikaos-story/dist/src/index.jsThe default Asset Hub endpoint and project namespace need no extra Claude env values. Verify with claude mcp list or /mcp.
Tools
Tool | Effect |
| List Supabase-backed Story status, content revision, preview route, and docs link. |
| Read identity, authoritative document link, current content JSON, and revision. |
| Read fixed workflow, semantic, Quote, catalog, or producer rules through the API. |
| Start or refresh production after the user confirms a compatible Story type/template pair; locks the authoritative DOCX checksum. |
| Preview or confirm moving every typed Story to |
| Preview or confirm an archived, revision-protected reset to |
| Create or modify content/layout JSON with optimistic revision protection. |
| Validate the current Story identity and required content arrays. |
| Upload a local PNG/JPG/WebP file, up to 20MB. |
| Replace the file using the scoped image ID returned by upload. |
Content workflow
Call
get_story_context.Open
docsLinkand read the required fixed rules withget_story_rules.After the user confirms the type and matching template (
basic→B-*,immersive→I-*,narrative→N-*), callstart_storywith bothtypeandtemplate_id. Do not request a local Content Studio checkout.Modify only the returned
currentData.datacontent/layout object. Read-only fields may be omitted, but any supplied values must remain unchanged.Call
save_story_contentwith the unchanged Story ID and the latestcurrentData.revision. Usenullonly when the Story has no content yet.Call
validate_story, then check the returned preview URL at 390px and 1280px.
If another client saved first, fetch the latest context and merge intentionally. Do not retry with a replaced revision without reviewing the newer content.
Reset workflow
Call
reset_storywithmode: "preview"and the Story ID.Review
current,preserved,cleared,protectionReasons, andresult.Call
reset_storyagain withmode: "confirm"and the unexpiredpreview_token.If
protectedis true, also pass the exactrequiredConfirmationstring asconfirmation.A changed revision or production state invalidates the token. Preview again; never bypass the conflict.
Confirm creates an immutable archive before clearing generated fields in the same database transaction. It does not modify the Sheet or authoritative DOCX receipt and does not delete Asset Hub files.
Image workflow
Choose a valid
imageSlots[].slotIdfrom the Story content.Call
upload_story_imagewith an absolute local image path.Use the returned
imageUrlin the Story content and save it withsave_story_content.Call
update_story_imagewith the returnedimageIdto replace that Asset Hub image. Keep the same file format to reuse the exact R2 key.To stop using an image, remove its URL from Story content and save the new revision. The R2 object remains until Asset Hub adds a delete API.
Omit viewport for one responsive source. Pass the exact same viewport object to update when using separate mobile or desktop files.