---
name: docswrite-setup
description: Connect Docswrite to this agent. Docswrite is the publishing API for AI agents - one API and MCP server that publish to WordPress, Webflow, Shopify, Ghost, Contentful, Medium, Dev.to, Hashnode, GitHub, X and LinkedIn. Adds the MCP server, verifies the connection and publishes a first draft.
user-invocable: true
allowed-tools: Bash, Read, Write
---

# Set up Docswrite

Docswrite is the publishing API for AI agents: one REST API and one MCP server that publish to every blog, CMS and social network a workspace has connected: WordPress, Webflow, Shopify, Ghost, Contentful, Medium, Dev.to, Hashnode, GitHub, X, LinkedIn and a hosted Docswrite blog. Overview for agents: https://docswrite.com/llms.txt. Human guide: https://docswrite.com/developers.

Follow the steps in order. Never print, guess or invent a key or token.

## Step 1: Connect the MCP server

The product MCP is streamable HTTP at `https://api.docswrite.com/mcp` and signs in with OAuth 2.1 (PKCE). No key to copy. What it does compared with a self-hosted WordPress MCP plugin: https://docswrite.com/product/wordpress-mcp

Claude Code:

```bash
claude mcp add --transport http docswrite https://api.docswrite.com/mcp
```

Any other MCP client:

```json
{"mcpServers":{"docswrite":{"url":"https://api.docswrite.com/mcp"}}}
```

The first call opens Docswrite's consent screen: the user signs in with Google, picks the workspace and approves. Prefer the docs MCP (`https://docs.docswrite.com/mcp`) for questions about Docswrite itself.

## Step 2 (servers and scripts): use an org API key instead

```bash
echo "${DOCSWRITE_API_KEY:-missing}"
```

If it prints `missing`, ask the user to create a key at https://docswrite.com/dashboard/api-keys (it starts with `dw_live_` and is shown once) and export it as `DOCSWRITE_API_KEY`.

## Step 3: Verify

List the workspace's destinations (MCP `list_connections`, or):

```bash
curl -s https://api.docswrite.com/api/connections -H "Authorization: Bearer $DOCSWRITE_API_KEY"
```

No connections yet? Send the user to https://docswrite.com/dashboard/connections to connect a blog or social account (OAuth for most destinations, a few fields for the rest).

## Step 4: Publish a first draft

```bash
curl -s -X POST https://api.docswrite.com/api/v1/posts \
  -H "Authorization: Bearer $DOCSWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: first-draft-1" \
  -d '{"connection_ids": [CONNECTION_ID], "title": "First draft", "content": "Hello from my agent.", "status": "draft"}'
```

Follow each result with `GET https://api.docswrite.com/api/v1/posts/RESULT_ID` (MCP: `get_post_status`), then give the user the draft URL.

## Reference

- Auth, scopes, rate limits and errors: https://docswrite.com/auth.md
- OpenAPI: https://api.docswrite.com/openapi.json
- Pricing: https://docswrite.com/pricing.md
- Skills: https://docswrite.com/.well-known/agent-skills/index.json
