Use Mojimoto with Claude Code
Coding agents are good at building front ends and bad at guessing content models. One command gives your agent the real model, the rules for reading and writing content, and a live connection to your project, so it can build pages against actual fields and fill them with content.
Start with llms.txt
Everything an agent needs to know about Mojimoto is in one plain-text file at https://mojimoto.com/llms.txt: how to model content, the write format for every field type, the Write API, assets and the MCP tools. Any agent can read it, with or without the setup below, so it is the first thing to point it at.
Read https://mojimoto.com/llms.txt before you model or write any Mojimoto content.
1. Create the tokens
On your project's API keys page, create two tokens: a read token for downloading the content model, and a write token for the agent to use over MCP. Limit the write token to what the agent should do, for example drafts only, on the content types it is working on. The public site token cannot be used with MCP, so it can never be used to read drafts.
2. Run init in your front end repo
npx @mojimoto/cli init --project your-project --token mjmt_your_read_token
It writes:
- .claude/skills/mojimoto/SKILL.md - how to read, write and model content in Mojimoto.
- .claude/skills/mojimoto/reference/content-model.md - your project's actual content types and fields.
- A short note in CLAUDE.md and AGENTS.md pointing the agent at the skill.
- .mcp.json and .cursor/mcp.json - the project's MCP server, added next to any servers you already have.
- .cursor/rules/mojimoto.mdc - the same guidance for Cursor.
Pick agents with --agent claude,cursor (the default is all). Re-running refreshes the content model and keeps your edits to the skill unless you pass --force.
3. Give the agent the write token
The MCP config reads MOJIMOTO_WRITE_TOKEN from your environment, so nothing secret is committed. Export it in the shell you start Claude Code from:
export MOJIMOTO_WRITE_TOKEN=mjmt_your_write_token claude
Prefer to set it up by hand? Add the server directly:
claude mcp add --transport http mojimoto https://mojimoto.com/mcp/your-project \ --header "Authorization: Bearer $MOJIMOTO_WRITE_TOKEN"
What the agent can do
The MCP server exposes the content model as the mojimoto://content-model resource and these tools, filtered to what the token allows:
- Read: list-content-types-tool, list-documents-tool.
- Content: create-document-tool, update-document-tool, publish-document-tool, unpublish-document-tool, delete-document-tool, upload-asset-tool.
- Model: create-content-type-tool, update-content-type-tool, add-field-tool, update-field-tool, remove-field-tool.
A read token gets the read tools only. Model changes are made one field at a time, so adding a field never overwrites the ones a person has already set up, and every write is attributed to the token and kept in the project's audit log.
Try it
Build the home page from the page entry with uid "home". Render each block in its sections field with its own component, and add a quote block with a testimonial from our about page.
Re-run init after changing your content model so the skill's reference stays current. The MCP resource is always live, so agents that read it never see a stale model.
Give a page a Blocks field so editors add, reorder and remove typed sections inside the entry, then render each block by its type.
Download TypeScript types for your content model so your editor autocompletes fields and your build catches mismatches.
Use a preview token and ?ref=preview to render unpublished drafts on a staging site, while production only ever sees published content.