Skip to main content
Glama
bracketcoder

bracketcoder-blog

Official
by bracketcoder
README.md
# Bracket Coder — Blog MCP (AI blog writer)

An MCP server that lets Claude (Claude Code or Claude Desktop) **research, write,
illustrate and publish** SEO blog posts straight to `bracketcoder.com/admin/blogs`.

Claude gets tools to read the **style guide**, list categories/tags/posts (for
context + internal linking), **generate on-brand images** (Gemini → Bunny CDN),
and **create/update posts** with full SEO fields — following `style_guide.md`
(long-form, table/graph when the topic needs it, 2–3 images, internal + external
links, meta/slug/tags, E-E-A-T).

Auth is a **browser login** (loopback, like `gh auth login`): you sign in as
admin once, a scoped, revocable token is issued and cached locally — nothing to
copy by hand.

---

## Setup

### 1. Clone & install
```bash
git clone https://github.com/bracketcoder/blog-mcp.git
cd blog-mcp
python3 -m venv .venv
source .venv/bin/activate           # Windows: .venv\Scripts\activate
pip install -r requirements.txt
```

### 2. Log in (browser)
```bash
python login.py
```
Your browser opens the Bracket Coder authorize page → sign in as admin → click
**Authorize**. The token is captured on `127.0.0.1` and cached at
`~/.config/bracketcoder-blog/token`. You will not see or paste a token.

### 3. Connect Claude

**Claude Code:**
```bash
claude mcp add bracketcoder-blog -- "$(pwd)/.venv/bin/python" "$(pwd)/server.py"
```

**Claude Desktop** — add to `claude_desktop_config.json`:
```json
{
  "mcpServers": {
    "bracketcoder-blog": {
      "command": "/ABSOLUTE/PATH/blog-mcp/.venv/bin/python",
      "args": ["/ABSOLUTE/PATH/blog-mcp/server.py"]
    }
  }
}
```
Restart Claude — the `bracketcoder-blog` tools appear.

---

## Use it (example prompts)

- **New post:** *"Write a Bracket Coder blog post on 'how to reduce SaaS churn in
  2026'. Follow the style guide, add a table and a graph, 3 images, internal +
  external links, save as a draft."*
- **Rewrite:** *"Rewrite the post at /insights/how-much-does-it-cost-to-build-a-custom-web-app-in-2026 —
  longer, add a cost table, a budget graph and 2 images, then update it."*
- **Publish:** add *"…and publish it."*

Claude will read the style guide → pick a category + tags + internal links →
draft SEO HTML with a table/graph → generate 2–3 images → create/update the post
→ return the live `/insights/<slug>` URL.

---

## Tools
`get_style_guide`, `list_categories`, `list_tags`, `list_posts`, `get_post`,
`generate_image`, `create_post`, `update_post`.

## Security
- `.env` and the cached token are gitignored / local-only — never commit them.
- The login token is **scoped to blog content only** and **revocable** by an
  admin (Django admin → MCP Tokens). Run `login.py` again to get a fresh one.