ai newsSo., 18. Okt.
EilmeldungClaude Code 2.1.302 Flips Two claude -p Defaults: Permission Mode and Fork Subagents

Give Claude Code or Cursor a publish tool over MCP, and keep the same link when it edits the page

Disclosure: I build dochost, the service used in the examples. The setup steps are specific to it; the four rules in the second half apply to any "publish" tool you give an agent. Checked against the live server on October 18, 2026. Most of what an AI assistant writes for other people ends up as a

dev.toSonntag 13:47 · 18.10.4 Min. Lesezeit
Bild: dev.to

Posted on Oct 18 • Originally published at dochost.io

Disclosure: I build dochost, the service used in the examples. The setup steps are specific to it; the four rules in the second half apply to any "publish" tool you give an agent. Checked against the live server on October 18, 2026.

Most of what an AI assistant writes for other people ends up as a file: a Markdown report, an HTML quiz, a status page. Then someone has to put it somewhere with a URL. If the assistant can call a publish tool, that step goes away. You ask for the page, the assistant sends the content, and you get a link back in the same reply.

This is a short guide to wiring that up over the Model Context Protocol (MCP). It also covers the part people skip: what happens on the second request, when you ask the agent to fix a typo on a page someone already has open.

The server is a remote Streamable HTTP endpoint:

https://dochost.io/api/mcp Enter fullscreen mode Exit fullscreen mode tools/list answers without auth, so you can see what you're connecting to before you sign in. Tool calls need an account, and there are two ways to give one:

Both end up as the same account. Ownership, quota and plan limits come from the account, never from the tool arguments.

Claude Code (one line, then run /mcp inside Claude Code and approve in the browser):

claude mcp add --transport http dochost https://dochost.io/api/mcp Enter fullscreen mode Exit fullscreen mode Add --scope user if you want it in every project, not only the current one.

Cursor, VS Code, Windsurf, Claude Desktop config:

{ "mcpServers": { "dochost": { "type": "http", "url": "https://dochost.io/api/mcp" } } } Enter fullscreen mode Exit fullscreen mode Claude Desktop (UI): Settings → Connectors → Add custom connector, paste the URL, Connect.

ChatGPT: Settings → Connectors (developer mode), add a connector with the same URL. Custom MCP connectors have to be available on your ChatGPT plan.

Headless agents: create a key in Settings → API keys, store it as DOCHOST_API_KEY in the agent's environment (never in a repo), and send it as Authorization: Bearer …. Rotating a key kills the old one immediately, so a leaked key is a 30-second fix.

The server supports OAuth dynamic client registration, so clients that implement the MCP auth spec don't need a pre-registered client ID.

The first publish is easy. The trouble starts on revision two. Here's what to tell your agent, or put in your project's agent instructions file.

If the page already exists, the agent should call update_page, not publish. A second publish creates a second URL. The person you sent the first link to keeps seeing the old version and never finds out there's a new one. update_page keeps the URL, view count and expiry, and resending identical content does nothing.

A line that works in a CLAUDE.md or.cursorrules:

When revising a page you already published, call update_page with its slug. Only call publish for a new page.

update_page replaces the whole body. If the agent edits from memory (a new chat, a compacted context, or a page you tweaked by hand on the website), it silently drops whatever it can't see. So the rule is: unless the agent wrote the live content earlier in this conversation, call get_page_content first, edit that, then update.

"Make it private", "add a password", "stop search engines indexing it" are settings changes, not new pages. set_page_options changes them in place. Deleting and publishing again would change the link you already shared.

Free links expire after 7 days (3 days for private, link-only pages). Paid plans make links permanent and add custom slugs and passwords. If a page has to outlive next week, have the agent call get_account first and tell you, rather than handing over a link that dies on Friday. There's also a rate limit (20 publishes a minute, 300 an hour), which only matters if you script it.

For one document that a person needs to open today, and that you'll probably ask the agent to fix twice, a publish tool with an in-place update beats exporting a file every time.

Setup page with per-client snippets: dochost.io/mcp. The server source and stdio bridge are MIT-licensed at github.com/zyli5313/dochost-mcp.

This article was drafted with AI assistance and checked by hand against the live MCP server's tool list.

Quelle: dev.to (dev.to). Original öffnen