# MCP server

> Connect Claude, Cursor or any MCP client. Agents read, draft and edit posts and pages next to your team, under your rules.

Quillhive runs a [Model Context Protocol](https://modelcontextprotocol.io) server. Connect an AI assistant to it and the assistant can work on your blog with you: draft new posts, make targeted edits, retag and, when you ask, publish. Everything it does follows the same roles as people in the dashboard, and every change can be undone.

## Endpoint

```text
https://api.quillhive.com/api/mcp
```

Streamable HTTP, stateless. Authenticate with a bearer token:

```http
Authorization: Bearer blgg_pat_...
```

## Get started in two steps

1. Create a **personal access token** in the dashboard: open the user menu and choose **MCP server**. Pick read-only or read and write.
2. Add the server to your client. For Claude Code:

```bash
claude mcp add --transport http quillhive https://api.quillhive.com/api/mcp \
  --header "Authorization: Bearer blgg_pat_..."
```

Then ask something like *"List my drafts on Quillhive"* or *"Draft a post about our new pricing and leave it as a draft"*.

Other clients: see [Connect a client](/docs/mcp/clients).

## What agents can do

| Tools | Access |
| --- | --- |
| `list_sites`, `get_site`, `list_tags` | Read |
| `list_posts`, `get_post`, `list_pages`, `get_page` | Read |
| `list_post_revisions`, `list_page_revisions` | Read |
| `create_post`, `create_page` | Write |
| `update_post`, `update_page`, `edit_post`, `edit_page` | Write |
| `restore_post_revision`, `restore_page_revision` | Write |
| `trash_post`, `trash_page`, `restore_post_from_trash`, `restore_page_from_trash` | Write |

Write tools only appear for tokens and keys that can write. Full parameters are in [Tools](/docs/mcp/tools).

## How it stays safe

- **Your roles apply.** An agent acts as a person (or as an agent staff member) and has exactly their access. Authors only see their own posts.
- **Drafts by default.** New posts and pages are drafts unless the agent sets a status.
- **No overwrites.** Every write must name the revision it's based on. If someone saved since, the write is refused.
- **Risky changes need a person.** Unpublishing, changing a live slug, gutting a published post or dropping all its tags is refused until the user confirms.
- **Deletes go to the trash.** An agent can move a post or page to the trash, but only people can delete it for good. No bulk tools: one item per call.
- **Everything is undoable.** Each change keeps the version it replaced.

Read [Collaborating safely](/docs/mcp/safety) for how this works in practice.

## One server for all your sites

A personal access token reaches every blog you're staff on. Every tool takes an optional `site` (id or slug). Leave it out when the token reaches only one site.
