# Build an agent · on Xale

Xale has no separate API: an agent uses the same MCP server as Claude and ChatGPT. Here is what you get, who can connect, and the loop a well-behaved agent follows.

Checked 2026-12-05 · https://xale.app/docs/ai/build-an-agent-on-xale

## What you get

|  |  |
| --- | --- |
| Endpoint | One MCP endpoint, `/api/mcp`: Streamable HTTP, stateless, one JSON-RPC message per POST |
| Protocol | `2025-11-25` or `2025-06-18` |
| Sign-in | OAuth 2.1 with dynamic client registration and PKCE `S256`; public clients only |
| Tools | 71, filtered by the scopes the person grants |
| Prompts | 5 |
| Resources | The format guides and AI instructions, plus the [Mindmap drawing guide and HTML viewer](https://xale.app/docs/ai/draw-a-mindmap-as-an-image) with Pro |
| Tool-only drawings | [`xale_render_mindmap`](https://xale.app/docs/ai/tools/xale_render_mindmap) returns SVG or HTML via `tools/call` |
| Briefing | `instructions` on every `initialize`, with the person's saved preferences |

Details: [MCP server · address and transport](https://xale.app/docs/ai/mcp-server-address-and-transport).

## Who can connect

Xale sends authorization codes only to the published callbacks of Claude, ChatGPT, Grok and Google's relay, and to loopback (`127.0.0.1`, `localhost`, `[::1]`) on the person's own computer.

- **A local agent** with a loopback callback can register and connect. Any port works.
- The allow page names a loopback app as "An app on this computer", with the name it gave itself in quotes, so the person knows it isn't a verified brand.

The person needs Xale Pro. See [Other MCP clients · generic setup](https://xale.app/docs/ai/other-mcp-clients-generic-setup).

## The loop

1. `initialize`, and keep `instructions` in the model's context for the whole chat.
2. `tools/list`. Use only what's listed: it reflects the person's scopes.
3. Read first: [`xale_read_today`](https://xale.app/docs/ai/tools/xale_read_today), and the item you'd add to.
4. Propose in the chat: what and where.
5. Wait for the person's yes.
6. Write, one call per item, each create with a new `requestId`.
7. Give the person the `href` from each result.

## Keep the person in the loop

Removals need the person's words in the chat, and Xale refuses them during unattended runs. Design for a person who is there for anything destructive.

## Work while the person is away

Register a check-in with [`xale_take_on_check_in`](https://xale.app/docs/ai/tools/xale_take_on_check_in), start each run with [`xale_begin_run`](https://xale.app/docs/ai/tools/xale_begin_run) and `attended: false`, and suggest with [`xale_propose`](https://xale.app/docs/ai/tools/xale_propose) rather than creating. "Nothing is created until they accept." A run starts when your agent starts it, so have your agent wake itself.

## Read next

[Conduct · the whole guide](https://xale.app/docs/ai/conduct-the-whole-guide), then the recipes in [Recipes](https://xale.app/docs/ai/recipes).

## Related

- For people: [How do I connect Claude to Xale?](https://xale.app/help/connect-claude-web-and-desktop)
- Tools: [xale_read_today](https://xale.app/docs/ai/tools/xale_read_today)
- Tools: [xale_begin_run](https://xale.app/docs/ai/tools/xale_begin_run)
- Tools: [xale_propose](https://xale.app/docs/ai/tools/xale_propose)
- Read next: [MCP server · address and transport](https://xale.app/docs/ai/mcp-server-address-and-transport)
- Read next: [Other MCP clients · generic setup](https://xale.app/docs/ai/other-mcp-clients-generic-setup)
- Read next: [Conduct · the whole guide](https://xale.app/docs/ai/conduct-the-whole-guide)
- Read next: [Draw a Mindmap · as an image](https://xale.app/docs/ai/draw-a-mindmap-as-an-image)
