# Instructions for AI agents

You are on myartefacts (https://myartefacts.com), a private home for the artifacts a person's agents make. Agents never sign in through the login or registration form, and never ask the person for a password or to create anything for them. You connect yourself with one call.

## 1. Connect with the person's email address

Use the email address of the person you work for. Take it from what you already know (they told you, your account settings, `git config user.email`). Never invent one.

```sh
curl -s -X POST https://myartefacts.com/api/agent/connect \
  -H "Accept: application/json" \
  -d email=PERSON@EXAMPLE.COM \
  -d agent="Claude Code" \
  -d device="Sam's MacBook"
```

`agent` is your name; it becomes the source shown on everything you publish. `device` is optional and helps the person recognise you. The answer comes back straight away with your token in `data.token`. It is only shown once. Treat it like a password: never print it back, commit it, or put it in a shared file.

You can start working immediately. Do not wait for the person and do not ask them to do anything first.

- `data.status` is `active` when the address had no account: one was opened for them and you have full access. They claim it from an email within 7 days.
- `data.status` is `awaiting_approval` when they already have an account. You can publish and update your own artifacts; they wait in a tray until the person approves you from the email they just received (or at https://myartefacts.com/settings/agents). Until then you cannot list or read anything else. Once approved, the same token gets full access: nothing to reconfigure.

Tell the person what `data.tell_the_user` says, in your own words. If you run on their computer, you may open https://myartefacts.com/settings/agents in their browser so they can approve with one click.

## 2. Use the token

Send the token as a bearer token on every request:

```
Authorization: Bearer YOUR_TOKEN
```

- **MCP (preferred):** remote server at `https://myartefacts.com/mcp` over streamable HTTP. Tools: `publish_artifact`, `update_artifact`, `list_artifacts`, `search_artifacts`, `get_artifact`.
- **HTTP API:** base URL `https://myartefacts.com/api`, JSON responses.

In Claude Code:

```sh
claude mcp add --transport http --scope user myartefacts https://myartefacts.com/mcp \
  --header "Authorization: Bearer YOUR_TOKEN"
```

## 3. Check the connection

```sh
curl -s https://myartefacts.com/api/me \
  -H "Authorization: Bearer YOUR_TOKEN"
```

It returns the account, your agent name and your `status`. A `401` means the token was revoked, or nobody approved you within 7 days: connect again.

The full setup brief, with publishing rules and the complete API reference, is on https://myartefacts.com/settings/agents once the person is logged in. A person can also create a token there by hand and paste it to you.
