# How to Publish Blog Posts From Claude Code

Source: https://blog.lots.blog/publish-blog-posts-from-claude-code
Published: 2026-10-10T02:27:31.83+00:00

To publish blog posts from Claude Code, add the LotsBlog MCP server with one command, sign in through your browser, and ask Claude Code to write the article and save it as a draft:

```bash
claude mcp add --transport http lotsblog https://api.lots.blog/mcp
```

Then run `/mcp` inside Claude Code and finish the sign-in. There's no API key to paste. Claude Code saves drafts, uploads the cover image and reads back what it saved, and nothing goes live until you tell it to publish or schedule.

This guide covers the connection, what Claude Code does on a real article from draft to live, the errors I hit while running it, and how to keep your blog's voice and rules out of the chat. The Claude Code commands come from [Anthropic's Claude Code documentation](https://code.claude.com/docs/en/mcp), which I opened on 10 October 2026. The LotsBlog side I ran today in Claude Code, end to end through the LotsBlog MCP server, saving a real draft with a cover image to a blog.

## What you need

- **A LotsBlog account and a blog.** Create the blog in the [LotsBlog dashboard](https://lots.blog). New accounts get 10,000 free credits, valid 90 days, with no card.
- **Claude Code** with the `claude` command available in your terminal.

Claude Code does the writing on your own Claude plan. LotsBlog stores, schedules, publishes and hosts the article.

## Step 1: Add the LotsBlog MCP server

Run this in your terminal:

```bash
claude mcp add --transport http lotsblog https://api.lots.blog/mcp
```

`lotsblog` is just the name you'll see in Claude Code, so you can choose another. Claude Code stores the server per project by default (the `local` scope, kept in `~/.claude.json`). Add `--scope user` if you want the blog tools in every project, or `--scope project` to write a `.mcp.json` file you can commit for your team.

## Step 2: Sign in

Start Claude Code, then run:

```text
/mcp
```

Pick `lotsblog` and follow the browser steps to sign in to LotsBlog and approve the connection. Claude Code stores the token and refreshes it for you. You never copy a key into the terminal or the chat.

To check it worked, run `claude mcp list` in your terminal or `/mcp` inside Claude Code. To remove it later, run `claude mcp remove lotsblog`, which also deletes the stored sign-in.

## Step 3: Ask for a draft

Here's the kind of prompt I use. Replace the blog name and topic:

> Use LotsBlog. Read the blog guide for my "Acme" blog, then write an article answering "how do I back up a Postgres database to S3". Save it as a draft in the Guides topic with a meta description under 160 characters. Don't publish or schedule it. Give me the preview link.

Claude Code reads the blog, writes the article and saves it. The tool calls, in the order I watched them run on a real article today:

| Step | Tool | What it does |
|---|---|---|
| 1 | `list_blogs` | Lists the blogs you can manage, with each blog's ID and public URL. If you have several, Claude Code asks which one |
| 2 | `get_blog` | Reads the blog and its private `blog_guide`: audience, voice, facts and rules |
| 3 | `list_topics`, `list_blog_posts` | Checks your topics and existing posts so it picks a topic and doesn't duplicate an article |
| 4 | `create_blog_post` | Saves the article as a private draft with title, slug, description, topic, meta description, keywords and FAQ schema. Returns a preview link |
| 5 | `create_image_upload`, a `curl` upload, `complete_image_upload` | Uploads a cover image from your machine and returns a public URL for it |
| 6 | `update_blog_post` | Adds the cover as the featured image, or fixes anything you ask for |
| 7 | `get_blog_post` | Reads the saved draft back to check what was stored |

A new article is a private draft until you say otherwise. The preview link works for people who are signed in to the blog's account, so you can read the real page before it goes out.

## Step 4: Add the cover image

Claude Code uploads local images in three moves, so the image bytes never pass through the chat:

1. `create_image_upload` takes the file name, exact size in bytes and type (JPEG, PNG, WebP or GIF, up to 25 MB) and returns a 15-minute upload URL.
2. Claude Code sends the file to that URL with `curl`.
3. `complete_image_upload` checks the size and the file's real format, then returns a public image URL.

Claude Code then sets that URL as the article's `featured_image`. If the image is already at a public address, `upload_blog_image` takes the URL directly. Uploaded images are public even on a private blog, so don't upload anything confidential.

## Step 5: Review, then schedule or publish

Open the preview link. If you want changes, tell Claude Code in plain words, and it updates the same draft with `update_blog_post` rather than creating a copy.

When you're happy:

- **Publish now:** "Publish it." Claude Code calls `publish_post` and gives you the live URL.
- **Schedule:** "Schedule it for tomorrow 9 AM IST." Claude Code calls `schedule_post` with a time that includes the timezone, at least five minutes ahead. LotsBlog checks for scheduled posts every 15 minutes, so a post can go live a little after the exact minute. A "scheduled" response isn't proof it's live, so ask Claude Code to read the post back once the time has passed.
- **Pull it back:** `unpublish_post` returns a live or scheduled article to a private draft.

LotsBlog never publishes on its own. Claude Code only schedules or publishes when you ask.

## Errors I hit, and the fix

These came up while I ran the flow:

| What happened | Why | Fix |
|---|---|---|
| `Too big: expected string to have <=160 characters at meta_description` | The meta description limit is 160 characters | Shorten it. Tell Claude Code "meta description under 160 characters" in the prompt |
| Image upload returned 403 | Extra headers were sent with the upload | Send only the `Content-Type` header returned by `create_image_upload` |
| Saving fails because the slug exists | Slugs are unique within a blog | Update the existing post instead of creating a new one |
| Preview asks you to sign in | Draft previews are private to the blog's members | Sign in to LotsBlog with the account that owns the blog |
| A tool you expect isn't listed | The client kept an old list of tools | Reconnect the server from `/mcp` and try again |

## Keep your rules in the blog, not in the chat

Each blog has an optional private `blog_guide`: Markdown that holds your audience, voice, facts, links and writing rules. Claude Code reads it at the start of a session through `get_blog`, so you don't repeat your style every time. It's never shown on the public blog. To change it, tell Claude Code what the durable rule is, such as "never use em dashes" or "always link to our pricing page", and it updates the guide with `update_blog`.

## What it costs

LotsBlog costs $9 per blog per month with no subscription, or plans from $24 a month for 3 blogs ($69 for 10, $159 for 30). Posts, authors and page views are unlimited, and the MCP server and REST API are on every plan. The optional paid article quality check uses credits only when you ask for it. See the [LotsBlog pricing explained](/lotsblog-pricing-explained) for the full breakdown.

## Start from your agent

Give Claude Code this and let it set itself up:

> Read https://lots.blog/skill.md and help me connect LotsBlog for you.

Prefer code over chat? The same operations are available through the REST API, documented at `https://api.lots.blog/docs.md`. [See pricing](https://lots.blog/pricing).

## Common questions

### How do I connect Claude Code to a blog?

Run `claude mcp add --transport http lotsblog https://api.lots.blog/mcp`, then `/mcp` inside Claude Code to sign in through your browser. There's no key to paste.

### Will Claude Code publish my article without asking?

No. New articles are saved as private drafts. Claude Code publishes or schedules only when you tell it to, and `unpublish_post` returns an article to a draft.

### Can Claude Code upload images?

Yes. It uploads a local image in three steps and uses the public URL as the cover or inside the article. Uploaded images are public.

### Does the preview link work for other people?

Draft previews are protected: you sign in with an account that's a member of the blog.

### Can I schedule posts from Claude Code?

Yes. Give a time with a timezone, at least five minutes ahead. LotsBlog checks for scheduled posts every 15 minutes.

### Do I need an API key?

Not for Claude Code. It signs in with OAuth in your browser. API keys are for the REST API, if you want to publish from your own scripts.

### Does LotsBlog write the article?

No. Claude Code writes it on your Claude plan. LotsBlog stores the article and images, schedules and publishes it, and hosts the blog.

### Does it work with ChatGPT or Cursor too?

Yes. LotsBlog is a remote MCP server at `https://api.lots.blog/mcp`, so any agent that supports remote MCP servers can connect to it.

*Claude Code commands checked on 10 October 2026 from [Anthropic's Claude Code MCP documentation](https://code.claude.com/docs/en/mcp). LotsBlog details from [lots.blog/skill.md](https://lots.blog/skill.md), [api.lots.blog/docs.md](https://api.lots.blog/docs.md) and a real run through the LotsBlog MCP server on 10 October 2026. Features can change; check those pages for the latest.*
