How to Add a CMS to a Claude Code Website: A Step-by-Step Guide
Let Claude Code build the frontend while a CMS holds the content. Connect Garchi over MCP, have Claude Code draft your first post, and render only published content with a server-side API key.
Aditya Kadam
Garchi CMS
Claude Code will build you a website in an evening. Components, routes, forms, the lot. Ask it to change the hero headline the next morning and it will do that too: open the file, edit the string, and wait for you to review and deploy.
That second request is where the trouble starts. Your marketing copy now has the same workflow as a database migration. Every typo fix is a diff, every new blog post is a pull request, and nobody without repository access can touch the words on your own site.
This guide splits the work in two. Claude Code keeps building and maintaining the frontend. A CMS holds the content that changes after launch. Claude Code connects to that CMS as an agent to draft content, and your deployed site reads only what a person has published. The example uses Garchi CMS, which we build, and a blog, because that's usually the first content people need to move.
What Claude Code should own, and what it shouldn't
| Claude Code owns | The CMS owns |
|---|---|
| Components, layout and styling | Blog posts, FAQs, testimonials |
| Routes, data fetching and caching | Page copy and headlines |
| Auth, payments and app logic | SEO titles and descriptions |
| The code that renders content | The decision to publish it |
A quick test for anything on your site: if a non-developer will want to change it more than once a quarter, it belongs on the right-hand side.
Step 1: Pick one content area
Start small. Choose the blog, the FAQ or the testimonials, and write down the fields it needs. For a blog post that's usually title, slug, summary, body, author, publish date and a cover image.
Decide on the content shape too. Garchi stores repeated records, such as posts and FAQs, as data items in a category. It stores one-off designed screens, such as a homepage, as pages made of reusable sections. A blog is a collection, so each post becomes a data item.
Keep application data out of the CMS. Users, orders, account balances and anything your app acts on stay in your database.
Step 2: Create a space and a Blog category
Sign up for a free Sandbox account and create a space for your site. A space holds one site's content. Add a category called Blog. Every post you create goes into it, and your app will fetch posts by this category.
You can do this in the dashboard in two minutes. Doing it by hand also lets you check the structure before an agent starts adding to it.
Step 3: Connect Claude Code to Garchi over MCP
Garchi runs an MCP server at https://garchi.co.uk/mcp-oauth. MCP is the open standard that lets AI tools use other software through a defined set of actions. (Plain-English explanation here.)
In your terminal, run:
claude mcp add --transport http "Garchi CMS" https://garchi.co.uk/mcp-oauth
Then open Claude Code, run /mcp, and sign in to Garchi when the browser opens. The connection uses OAuth, so you never paste an API key into Claude Code. You can review and revoke connected clients from your Garchi dashboard at any time.
Check it worked with a read-only request:
List my Garchi spaces and the categories in my Website space.
Next, install the Garchi agent skills. They teach Claude Code the content model and the rendering patterns, so it stops guessing at field names:
npx skills add lumenharbor/garchi-cms-skills
Step 4: Ask for one draft
Give Claude Code a narrow, checkable request:
In my Website space on Garchi, create a draft blog post in the Blog category titled "How we work". Write a one-line summary under 160 characters and three short sections. Add author and published_date as extra details. Don't publish it. Tell me the item you created.
Open the Garchi dashboard and look at what arrived. Check the category, the slug, the summary and the extra details. Then run git status. Your repository hasn't changed.
This step proves one thing: your content now lands in a structured, reviewable place instead of a component file.
By default the agent can only save drafts. If you later want Claude Code to publish for you, the space owner can switch on Allow AI agents to publish in Space settings. The agent then shows you what will change and publishes only that reviewed version when you ask. Leave it off until you trust your workflow.
Step 5: Render published content in your app
Rendering uses a separate credential. In the Garchi dashboard, click your profile icon, open API keys and generate a key. Store it as a server-side environment variable, for example GARCHI_API_KEY.
Two rules for that key:
- Never expose it in client-side code. In Next.js, that means no
NEXT_PUBLIC_prefix. - Call the Garchi API from your server, route handlers or server components, never from the visitor's browser.
Now ask Claude Code to build the blog:
Add a blog to this app using Garchi CMS. Use the @garchicms/garchi-node-sdk package on the server with GARCHI_API_KEY. Fetch published data items from the Blog category for /blog, and one item by slug for /blog/[slug]. Sanitise the post HTML before rendering. Return a real 404 for unknown slugs. Set the page title and description from the post. Don't hardcode any post content.
Starting a new project instead? npx @lumenharbor/garchi-starter-kit -k next scaffolds a Next.js app with the SDK and client already wired. Nuxt and Laravel starters exist too, and any other stack can call the REST API.
Review the diff like any other code change. Look for the API key staying server-side, HTML sanitisation and a sensible cache setting.
Step 6: Prove the editing loop
Publish your draft from the Garchi dashboard. Open /blog and click through to the post. If it's missing, check you published it before you debug anything: the API serves published items only, so drafts never reach your visitors.
Now change one sentence in the dashboard and publish again. Time how long your site takes to show it. That gap is your cache setting, and you control it in code.
Last test: ask a colleague with no repository access to write the next post. When they publish it without asking you for anything, you've separated content work from software work.
Why two credentials?
The MCP connection and the API key do different jobs:
Claude Code → Garchi MCP (OAuth) → drafts → a person publishes
Your site → Garchi API (API key) → published content only
OAuth lets the agent act for you inside Garchi's set of content actions. The API key lets your server read what you've published. Neither one gives the other's access.
What changes after setup
Claude Code goes back to engineering work: new components, performance, features. Copy changes happen in the dashboard, and new posts start as agent drafts that someone on your team approves. Once the blog works, move the FAQ and testimonials the same way. For one-off screens like the homepage, read the guide to editable landing pages with reusable sections.
Not sure a CMS is the right move yet? Start with how to choose a CMS for an AI-built website.
Enjoyed this article?
Get the next one in your inbox, with new Garchi features and practical ideas for running content operations with your team and AI agents. No spam, and you can unsubscribe at any time.