Connect an agent
1. Discover
Read https://doingwork.work/.well-known/mcp/server-card.json for the MCP endpoint, or https://doingwork.work/openapi.json for REST. The API sends a 401 with WWW-Authenticate: Bearer resource_metadata=... when you need to sign in.
2. Register your client
Dynamic client registration (RFC 7591). Public clients only, no secret. Redirect URIs must be https or loopback.
POST https://doingwork.work/v1/oauth/register
content-type: application/json
{"client_name": "My shop assistant", "redirect_uris": ["http://127.0.0.1:8976/callback"]}3. The person approves you
Send the person to the authorization_endpoint from OAuth server metadata with client_id, redirect_uri, code_challenge (S256), state, and resource=https://doingwork.work/mcp. They sign in with an email link and approve. You get a one-time code at your redirect.
4. Get a token
POST https://doingwork.work/v1/oauth/token
content-type: application/json
{"grant_type": "authorization_code", "client_id": "...", "code": "...", "code_verifier": "...", "redirect_uri": "http://127.0.0.1:8976/callback", "resource": "https://doingwork.work/mcp"}Access tokens are short-lived. Refresh tokens rotate: each works once, and reusing one revokes the whole chain. Store the new one every time. Use this OAuth path only when the client can open a browser and store the refresh token securely. Do not also call agents.register.
Scope omitted is agent. On a person grant with no shop_id, that can create a shop. Add read_only to look without changes. read_only cannot create a shop. Add no_money to block charges and refunds. agent is required. read_only and no_money only narrow a new grant. Store the refresh token yourself. Doing Work stores only a hash of the key and cannot show it again. Call me.get before you say you are connected. shown_once and persistence not_proven are not a substitute for a fresh session that still returns me.get.
5. Call tools
MCP: streamable HTTP at https://doingwork.work/mcp, Authorization: Bearer <token>. Tool names are operation ids with dots as underscores, for example quotes_create. Hosted-page and person-only operations are not listed as tools.
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"jobs_list","arguments":{"shop_id":"..."},"_meta":{"idempotencyKey":"..."}}}REST: the same operations under https://doingwork.work/v1. GET operations take query parameters; POST operations take a JSON body. See conventions.
Other ways in
For setup, use only one way. OAuth and agents.register never run for the same setup. If the app already shows a Doing Work connector, use that and do not also register. In Muse, use the native OAuth connector. Do not paste a key into a chat to get around that. The claim response rules are on Onboard a shop and in auth.md.
- Named agent key. The shop owner makes a key for you with their own sign-in (keys.create). It starts with
dwk_, is shown once, works in one shop, and can be narrowed toread_onlyorno_money. It works on REST, MCP and A2A. Do not ask the owner to paste the key into a chat. An agent that only keeps it in a session file does not have ongoing access. Muse has no documented way to import an existing key. Use the native connector OAuth storage. - Register and get claimed. Use this when the client cannot open a browser and store a refresh token. Ask for the owner's email, then call agents.register once with
typeset toservice_authandlogin_hintset to that email. Leavescopeoff. The key joins the shop the owner picks and cannot create a shop. Read the short fields first, as Onboard a shop describes. Do not register again. - A2A.
POST https://doingwork.work/a2a(A2A 1.0 JSON-RPC) with a named agent key. SendSendMessagewith one data part,{"op": "<op id>", "input": {...}}. There's no model behind it: the op runs exactly as on REST and MCP. A write the owner must approve comes back as an input required task. Card: agent-card.json.
6. Start with who you are
Call me.get to confirm the connection, then me.start for the shops this connection can use and the next tasks. me.shops lists the shops too. If a shop already exists, use it. Do not create another. Then follow Onboard a shop or Job to paid.