# Connect Claude Code to your Sitesfare website

> One command adds Sitesfare to Claude Code with a Studio key (or sign in with /mcp); then edit, publish and undo from the terminal.

Web page: https://sitesfare.com/guides/connect-claude-code
Part of: https://sitesfare.com/guides

## Steps at a glance

1. **Add AI editor access in Sitesfare.** Dashboard → AI editors → add access for the kind of website you have.
2. **Create a Studio key.** AI editors → Studio keys → name it (e.g. “Claude Code on my laptop”) → Create key → copy it.
3. **Add the server.** Run: claude mcp add --transport http sitesfare https://api.sitesfare.com/mcp --header "Authorization: Bearer <your key>"
4. **Use it.** Start claude, check /mcp, then ask for changes; say “publish” when ready.

Claude Code can edit, publish and undo changes on your Sitesfare website from the terminal. One command adds the server.

## Before you start

- In your Sitesfare dashboard open **AI editors** and add **AI editor access** for the kind of website you have. See [how Sitesfare Connect works](/guides/connect-ai-editors).
- Create a **Studio key**: AI editors → **Studio keys** → name it (for example "Claude Code on my laptop") → **Create key** → copy it. It is shown once.

## 1. Add the server

```bash
claude mcp add --transport http sitesfare https://api.sitesfare.com/mcp \
  --header "Authorization: Bearer <your Studio key>"
```

Claude Code confirms: *Added HTTP MCP server sitesfare…*. The key is stored in Claude Code's own config on your computer.

**Prefer signing in instead of a key?** Add the server without the header, start `claude`, type `/mcp`, choose **sitesfare** and follow the sign-in — you approve on the Sitesfare page and come back connected.

```bash
claude mcp add --transport http sitesfare https://api.sitesfare.com/mcp
```

## 2. Use it

```text
$ claude
> /mcp                     # sitesfare · connected
> Show me my Sitesfare websites and hide the testimonials on ira
```

Claude Code calls the Sitesfare tools (`account_sites`, `section_hide`…), saves the change as a draft and tells you. Say **"publish"** to put it live. Every change is in the site's **History** in the dashboard with one-click undo — or just say "undo that".

Things to try:

- "Replace the hero photo with ./hero.jpg" — it uploads the file to your media library and sets the field.
- "Here's a screenshot of the section — change the heading to 'Selected work'."
- "Change the display font to Syne and the accent to #1F6F4A, then publish."
- "Start a new photography site called studio-ira from the Darkroom template."

## Sharing with a team

Add the server with `--scope project`: the server URL goes into `.mcp.json` in the repository (without any key), and each person signs in with `/mcp` or sets their own header.

## Troubleshooting

- **401 / unauthorized** — the key was pasted incompletely (it starts with `sfk_` and is 47 characters) or was revoked. Create a new one and run `claude mcp remove sitesfare` then add it again.
- **"This account does not hold AI editor access…"** — add the add-on for that kind of website under AI editors; the message says which one.
- **The server shows as failed** — check you used `--transport http` (not sse or stdio) and the exact URL `https://api.sitesfare.com/mcp`.

## Questions

**Can I sign in instead of using a key?**
Yes. Run claude mcp add --transport http sitesfare https://api.sitesfare.com/mcp without the header, then type /mcp inside Claude Code and choose Sitesfare to sign in with your account.

**Where is the key stored?**
In Claude Code’s local config on your computer (user scope by default). Revoke the key from AI editors if the computer changes hands.

**Can my team use it from a shared repo?**
Add the server with --scope project; the URL goes into .mcp.json without the key, and each person signs in with /mcp or sets their own header.
