Commune
AgentAPI

Build your website with your agent

Your newsletter deserves a home that looks like you wrote it, not like a template chose for you. Describe it to your agent and it writes the pages: plain HTML, CSS and JavaScript you own outright, hosted by Commune on your own domain, with your articles, your archive and your subscribe button already wired in. There is no editor and no builder, which also means there is no undo, so keep the site in a repository of your own.

Before you start

Commune keeps the page you last wrote and nothing else. There is no version history and no operation that returns a previous page, so keep your site in a git repository and write pages out of it. That repository is the only history there is, and it is what turns an overwrite from a loss into a diff.

Connect your agent once, then describe the site. It reads Commune's own reference for the page kinds and the URL grammar before it writes anything, so the first attempt is a working site rather than a round of refusals, and it writes every page as a draft you can look at before it goes live.

Connect once

Add Commune's MCP server to your agent, then approve the consent screen and pick your newsletter. Nothing else to install.

terminal
claude mcp add --transport http commune https://api.usecommune.com/mcp
Step by step for each client

Ask

One prompt does the whole job. Paste it as it is, or change the parts that are yours.

prompt

Build a website for my Commune newsletter, in a new git repo in this folder.

Three pages: an article list at /, an article page at /posts/:article, and an about page at /about. Quiet and typographic, one column, serif headings, works on a phone. Use my newsletter's own articles, not placeholders.

Put them up as drafts first and give me the preview links. Once I say yes, publish them and point blog.example.org at the site. Commit after each page.

What it uses

Your agent picks these of Commune's tools to answer. You do not name them; they are here so you know where every part of the answer comes from.

  • build_my_website

    Writes one page: its kind, its path and its whole document. newsletter is the article list, article is a URL pattern that serves every issue, and page is any fixed path. It answers with a signed preview_url for a draft, which is the only way to look at one.

  • what_is_on_my_website

    Everything the site is made of: each page's kind, path, state and weight, plus every hostname with its verification, its routing and which Commune origin answers for it. The tool for "is it live" and for "my domain is not loading", which are the same question from two ends.

  • commune_write

    Everything build_my_website does not: publishing and unpublishing a page, editing one with the whole new document, minting the publishable key the page reads data with, and pointing a hostname at the site with mode set to site.

  • commune_read

    Reads a page's HTML back, for an agent that has lost its local copy, and reads your articles so the pages it writes talk about real issues.

What comes back

Your site is up. Three pages, all published:

PageAddressServes
Article listhttps://blog.example.orgyour 42 issues, newest first
Article/posts/:articleevery issue, including future ones
About/aboutone page
  • blog.example.org is verified, routing and in site mode, so the name and avatar in Commune now link here.
  • I minted a publishable key (cmn_pk_7Qa2Lk9x…) and put it in the article list's script tag. It is read-only and safe in page source.
  • Committed as a1c93f0. If you want yesterday's homepage back, that is git revert and one more write.

An example. Yours comes from your own newsletter.

Worth asking next

  • Add a page for my paid archive, linking only the issues that are public.
  • The article page is too wide on a phone. Make the measure 34rem and bump the line height.
  • Which page is bringing in the most subscribers?

Tips

  • Ask for drafts first. A draft has no public address at all: the signed preview link is the only way in, so nothing half-finished is ever reachable, and publishing is one more call.
  • Keep the site in a repository and tell your agent to commit after every page. Commune stores no history, so the repository is the history, and an agent that overwrote the wrong page can put the previous commit back.
  • Say what you want it to feel like, not what elements to use. There is no template to fight: the agent writes the markup and the CSS, so "quiet, typographic, one column" is a more useful instruction than a list of divs.

Next use cases

See all