# Use BlogFactory as your content operations work layer.

> Self-host BlogFactory, then connect to its authenticated, site-scoped MCP endpoint to inspect content, prepare drafts, review changes, and deliver approved work to a CMS as a draft.

## Connect

- Endpoint model: `https://<instance-origin>/mcp`
- Transport: Streamable HTTP
- Authentication: OAuth is recommended. Add the endpoint to a compatible client and follow protected-resource discovery.
- Account setup: follow the [self-hosted MCP guide](/docs/mcp/), then open Control → MCP Connections on your instance and approve one site.
- Personal tokens are an advanced fallback. Create them inside BlogFactory, store them only in the client environment, and never paste them into a prompt.

### Codex

```bash
codex mcp add blogfactory --url https://content.example.com/mcp
codex mcp login blogfactory
```

## First session

`whoami` → `list_sites` → `get_workspace_digest` → `list_action_items`

Discover the current tool catalog through authenticated MCP initialization and `tools/list`. Do not assume a fixed tool count.

## Workflows

### Create caller-authored content

`create_draft` → `get_post` → `review_post`

Use create_draft when the caller already supplied the Markdown. Read the saved post before revising it.

### Generate with a connected provider

`generate_draft` → `get_job` → `review_post`

Generation is asynchronous. Poll get_job until the draft is ready, then review the exact result.

### Revise without overwriting work

`get_post` → `update_draft` → `review_post`

Pass the current expected_updated_at value to update_draft. On conflict, reread instead of forcing the write.

### Deliver an approved CMS draft

`review_post` → `list_publish_targets` → `push_to_cms_draft`

Resolve blockers, obtain explicit approval, and select a destination before delivery. Repeating the same version and destination is idempotent.

### Search growth

Read Search Console dashboard, insight, analytics, URL inspection, and sitemap evidence before proposing a reviewed content action. Do not infer automatic publishing or guaranteed results.

## Hard boundaries

- Never live-publish or delete content.
- Never administer accounts or perform arbitrary bulk mutation.
- Never request, reveal, or return CMS, provider, or MCP credentials.
- Keep every read and write inside the authenticated user's approved site scope.
- Stop CMS delivery at a draft and preserve optimistic locking and idempotency.

## Recovery

- **401:** Start the OAuth flow advertised by the protected-resource metadata.
- **403:** Ask for the required approved scope; do not attempt to bypass authorization.
- **conflict:** Reread the post and retry only with the current version.
- **generation pending:** Poll get_job; do not start a duplicate generation run.
- **preflight blocker:** Reread review_post and resolve the blocker before delivery.
