# Headless & automation

Read EstateCanvas's installation guides from a terminal, script, or CI job. The documentation MCP is public and stateless, so it does not need a browser login or an EstateCanvas API key.

## Pick a client

| Client | Use it for |
| --- | --- |
| Codex CLI | Ask an assistant to turn the guides into an installation plan or website change. |
| Node.js MCP SDK | Fetch structured tool results from your own script without a model. |
| Raw HTTP | Inspect the MCP protocol or integrate with an HTTP-only environment. |

Use **Set up agent → Headless & automation** for copyable examples for each client.

## Codex CLI

Merge the following into the Codex configuration used by your runner:

```toml
[mcp_servers.estatecanvasDocs]
url = "https://docs.estatecanvas.ca/mcp"
enabled_tools = ["search_docs", "get_doc", "get_embed_example"]
required = true
```

Then run a read-only task from your trusted website project:

```sh
codex exec --sandbox read-only --json \
  "Use estatecanvasDocs to read the Squarespace guide and produce an installation checklist. Do not change files."
```

`--json` returns JSON Lines events. `required = true` stops the run if the docs server cannot initialize. Codex still uses its own authentication and normal tool permissions; the EstateCanvas docs server needs no credentials. Project-scoped configuration must be trusted by Codex. For file changes, choose appropriate workspace permissions and review the result before publishing.

[Download the headless TOML entry](/downloads/estatecanvas-codex-headless.toml). See the official [non-interactive Codex guide](https://developers.openai.com/codex/noninteractive/) for runner authentication, output formats, and permissions.

## Node.js MCP SDK

Use Node.js 22 or newer. In your script's project:

```sh
npm install @modelcontextprotocol/sdk
```

Download [estatecanvas-headless.mjs](/downloads/estatecanvas-headless.mjs) into that project and run:

```sh
node estatecanvas-headless.mjs
```

The example connects with `StreamableHTTPClientTransport`, calls `get_doc` with `slug: "squarespace"`, prints the Markdown response, and closes the client. It makes no changes and requires no model account.

To generate your own embed, call `get_embed_example` with your public `pk_ec_` key and one of `wordpress`, `squarespace`, `wix`, `webflow`, `framer`, `hugo`, or `html`. The result includes a snippet, embed URL, provider guide, and next steps. `verified: false` means the tool has not checked publication or the domain allowlist.

## Raw HTTP

[Download the curl example](/downloads/estatecanvas-headless.sh). Read it, then run it with `sh` in an environment with curl installed. It initializes MCP using protocol version `2025-03-26`, sends the initialized notification, and calls `get_doc`.

Every request goes to `https://docs.estatecanvas.ca/mcp` with `Content-Type: application/json` and `Accept: application/json, text/event-stream`. Requests after initialization include the negotiated `MCP-Protocol-Version`. This server does not issue a session ID or require an authorization header.

Use `tools/list` to discover the tools and `resources/list` to enumerate the Markdown guides. Treat a JSON-RPC `error` or a tool result with `isError: true` as a failed request, even if the HTTP response is successful. Handle network timeouts in your runner and use bounded retries for these read-only requests.

## Scope of automation

This endpoint supplies documentation and installation examples. It cannot create a workspace, configure a domain, publish a flow, fetch client records, or submit an intake. An assistant can edit website files through tools you separately provide. A firm owner configures the intake in [the main app](https://platform.estatecanvas.ca/firm); a client completes it through the authenticated widget.

For a plain-text workflow, fetch [llms-full.txt](/llms-full.txt) or an individual guide's Markdown and pass that content to your existing automation.
