Hatch

Set up Hatch with an agent

On this page

This page is for AI agents setting Hatch up for someone: Claude Code, Codex, Cursor or any other. If you're a person, copy the prompt below into your agent.

Set up Hatch for me. Follow https://hatch-docs.pages.dev/get-started/set-up-hatch-with-an-agent.md and read the pages it links before you run anything.

Rules for agents

  • Don't set Hatch up from memory. Package names, commands and options change between versions. Run the commands on this page, and read the linked pages as Markdown before you use anything they describe.
  • Every page is Markdown. Add .md to any page's address. The list of pages is at https://hatch-docs.pages.dev/llms.txt, and every page in one file is at https://hatch-docs.pages.dev/llms-full.txt.
  • The vault is the person's. Never rewrite or reformat a note you weren't asked to change, and keep any field you don't understand. Read the vault's own AGENTS.md before filing anything.
  • Ask before anything public. Deploying a site or publishing a package puts it on the internet. Check with the person first.

Pick what the person wants

They want toDo this
Give you their notesConnect the MCP server (below)
Use the appRun it from the repo, see Quickstart
Publish a folder as a siteBuild it with hatch-site, see Site templates and style or Docs sites
Move a docs site to HatchRun hatch-migrate, then follow Moving a docs site to Hatch
Add Hatch to their own appInstall the packages, see React hooks, Agent memory with the AI SDK or Hatch's shadcn registry

Connect the MCP server

Ask which folder is their vault, then add the server. For Claude Code:

claude mcp add hatch -- npx -y @hatchmd/mcp /path/to/vault

Connect an agent has the setup for Codex, Cursor and Claude Desktop. Once it's connected, call vault_guide first. It returns the vault's folders, tags, properties, templates and filing rules. Search before you create a note, and link notes with [[Note]].

If the vault has no AGENTS.md yet, offer to write one with the person: where meetings, people and projects go, which tags to use, and what not to touch.

Build a site

npx -y -p @hatchmd/publish hatch-site build /path/to/vault --out site

The vault needs a .hatch/site.json first. The app writes it from Settings, Publish, along with a JSON schema beside it (site.schema.json). By hand, the smallest one names the site, its kind (blog, docs or portfolio) and the folders it publishes:

{ "title": "Notes", "kind": "blog", "folders": ["Blog"] }

npx -y -p @hatchmd/publish hatch-site preview /path/to/vault serves the site on localhost and rebuilds on every change. Check the site in light and dark, at desktop and phone width, before you tell the person it's done.

Check your work

  • After connecting the server, call vault_guide and tell the person what it found.
  • After building a site, open the home page and one inner page, and check that the build printed no problems.
  • After installing a package, run the project's own type check and build.