# Set up Superblog

You are an AI agent setting up Superblog for your user. Superblog is a managed blogging platform. Follow these steps in order.

## Steps

1. **Check that the user has a Superblog account.** Ask them. If they do not have one, ask them to sign up at https://write.superblog.ai (7-day free trial, no credit card required). Do not try to sign up for them. Wait until they confirm they have an account.

2. **Add the Superblog MCP server.** The server URL is `https://write.superblog.ai/api/mcp` (Streamable HTTP). Detect which client you are running in and use its method below. Sign-in is OAuth, so do not add an Authorization header when the client supports OAuth.
   - **Claude Code:** run this in the terminal:
     ```bash
     claude mcp add --transport http superblog https://write.superblog.ai/api/mcp
     ```
     Then ask the user to open Claude Code and ask `show my superblogs`. Claude guides them through sign-in if needed.
   - **Claude (claude.ai and Claude Desktop):** you cannot add a connector yourself. Give the user these steps:
     1. Open **Settings > Connectors**.
     2. Click **Add custom connector**.
     3. Enter a name (for example `Superblog`) and paste `https://write.superblog.ai/api/mcp`.
     4. Click **Add**, then click **Connect** and complete the sign-in in the browser.
     Then start a new chat and ask `show my superblogs`.
   - **ChatGPT:** you cannot add a plugin yourself. Give the user these steps, on chatgpt.com in a browser (not the desktop or mobile app):
     1. Open https://chatgpt.com/plugins.
     2. Click the **plus button**, then **Add custom MCP server**.
     3. Enter a name (for example `Superblog`) and, under **Connection**, paste `https://write.superblog.ai/api/mcp`.
     4. Choose **OAuth**, click **I understand and want to continue**, then **Create as a plugin**.
     5. Install the plugin, click **Connect**, and complete the sign-in in the browser.
     Then type `@` in a new chat, pick Superblog and ask `show my superblogs`. Tell the user: full access needs a ChatGPT Business, Enterprise or Edu workspace, Pro is read-only, and OpenAI does not list custom MCP servers for Free and Plus. If their plan cannot connect, suggest Claude or Codex.
   - **Codex CLI:** run these in the terminal:
     ```bash
     codex mcp add superblog --url https://write.superblog.ai/api/mcp
     codex mcp login superblog
     ```
     Then start Codex with `codex`. Inside Codex, `/mcp` checks the connection. Then ask `show my superblogs`.
   - **Codex Desktop:** give the user these steps:
     1. Open **Settings > MCP servers**.
     2. Add a new MCP server and paste `https://write.superblog.ai/api/mcp`.
     3. Click **Authenticate** and complete the sign-in in the browser.
     When it shows "Authentication complete", start a new chat and ask `show my superblogs`.
   - **Any other MCP client:** add a remote MCP server with the URL `https://write.superblog.ai/api/mcp`. Use OAuth if the client supports it. If the client only accepts an API key, see "API key instead of OAuth" below.

3. **Let the user sign in.** The user signs in to Superblog in their browser. The consent screen lists which Superblog sites the connection can reach. The user can revoke the connection later from their client's connector settings.

4. **Verify the connection.**
   1. Call `list_my_sites` to see which Superblog sites the user has access to.
   2. Call `select_site` with the supername of the site the user wants to manage. If there is more than one site, ask the user which one.

5. **Report back to the user.** Tell them which sites are connected and which one is selected. Then suggest two or three first tasks, for example:
   - Draft a new post (`create_post`).
   - Find internal links for an existing post (`get_internal_link_suggestions`).
   - Add FAQs to a post for FAQ rich results (`create_faqs`).
   After you change content, ask the user before you call `deploy`. Use `get_deploy_status` to check when the changes are live.

## API key instead of OAuth

Use this only when the MCP client does not support OAuth.

1. Ask the user to create an API key in **Dashboard > Data > API keys**, with **Manage this blog** access.
2. Send it as a bearer token: `Authorization: Bearer <api-key>`.
3. An API key belongs to one blog, and `list_my_sites` works only with OAuth.

## No MCP support

If your client cannot connect to an MCP server, use the REST API.

1. **Base URL:** `https://write.superblog.ai/api/v2`
2. **Spec:** https://write.superblog.ai/api/v2/openapi.json. Read it before making calls.
3. **Authentication:** a bearer API key: `Authorization: Bearer <api-key>`. The user creates it in **Dashboard > Data > API keys**. The key is shown only once.
4. **Access levels.** Ask the user to pick the least access the task needs:
   - **Read published content:** reads published posts, pages, categories, tags and authors. Nothing else.
   - **Manage this blog:** posts, pages, settings, team and deploys. Use this for content work.
   - **Owner access:** everything the owner can do, including billing, API keys, blog transfer and the custom domain. Only for scripts that need those.
5. **Keep the key secret.** Store it in an environment variable or in a `.env` file that is listed in `.gitignore`. Never print the key, log it, or commit it.
6. **Paths** use the blog's supername, for example `GET /sites/yourblog/posts`. After content changes, deploy with `POST /sites/yourblog/deploy`.

## References

- MCP docs: https://superblog.ai/docs/ai/mcp
- API docs: https://superblog.ai/docs/developers/api
- API keys: https://superblog.ai/docs/developers/api-keys
- CLI docs: https://superblog.ai/docs/developers/cli
- OpenAPI spec: https://write.superblog.ai/api/v2/openapi.json
- Superblog docs for AI agents: https://superblog.ai/docs/llms.txt
- Superblog blog for AI agents: https://superblog.ai/blog/llms.txt
