The person's own MCP servers, with what each is to them now
The caller's own servers (ADR 0046), sorted by name, each with the URL they typed, the shape of its authentication (never a secret), its state, the status and reason the picker shows and the revision an edit sends back. Needs no permission of its own (tools.user.add gates changes, not reading what one added); another person's servers are not here, for any role. limit is the most one person holds (8) and kinds the kinds of authentication this deployment accepts: all four (none, bearer, api_key, oauth2) where it keeps credentials, and only none where it keeps none (it has no secrets section) (orch_app::user_tool_kinds, orchestrator/crates/app/src/user_tools.rs).
status is the definition's state and the deployment's rules, with the first of these that holds: unavailable / not_permitted when the caller's roles lack tools.user.add; unavailable / egress_refused when today's egress lists refuse the server's address; unavailable / broker_down when the server wants a credential and this deployment keeps none; otherwise ready for connected, and needs_auth for added (not_connected), needs_reauth (reauthorize) and revoked (disconnected). It asks the broker for nothing: no token is refreshed for a listing.
When a definition of the caller's does not read back, the store fails the listing as a whole: the answer is 200 with no servers and an error (unreadable), because the other servers are not lost and none of the deployment's depends on this. Each server can still be deleted by its id (deleteUserToolServer reads nothing of the row); the answer cannot name the damaged one, and the orchestrator's log does (one warning per damaged row, by its id). A store that is down is a 503. Never cached. 404 when the feature is off.
Client recipe: the person's own servers (what the web's "My tool servers" page does; a client needs nothing else, and the server enforces every step, so a client only offers what the server would accept).
- Whether to offer the screen.
getMeliststools.user.addfor a person whose roles hold it. It does not say whether the deployment has the feature on: a holder in a deployment with it off gets a 404 from this route, which the screen says in words ("this deployment does not let people add servers") and offers nothing under. A person without the permission still reads their servers here and deletes them (deleteUserToolServerneeds none); the screen says that their roles do not let them add or change one, and offers only Delete. - Add. Offer the
kindsof this answer and no others (a deployment that keeps no credentials lists onlynone).POST{name, url, auth}and, forbearerorapi_key,secret; anapi_keyalso names itsauth.header, anoauth2its optionalscopesandclientId. The answer is the server as listed: show itsstatus, and foroauth2(needs_auth,not_connected) the Connect step below. Hold at mostlimitservers: when the list is that long the client does not offer Add, and the server's 409too_many_serversis the race only. Thesecretis typed once, kept nowhere (not in storage, a URL or a log), cleared when the request is sent, and never filled in from an answer: no answer holds one. - Change.
PATCHtakes any non-empty combination ofname,url,authandsecret, and therevisionof the row as listed (orchestrator/crates/app/src/user_tools.rs,edit_user_tool_server; an edit that names none of the first four is a 400). A client sends only what differs from the row the person opened the form on, with that row'srevision(a form that is open while the list is read again keeps its own revision, so a stale edit is a 409 and never overwrites a newer change). What each does:name, or theheaderof anapi_key, is written and the credential kept;secretalone (the kind must bebearerorapi_key, else a 400) re-keys it and the server isconnected, which also brings aneeds_reauthorrevokedone back; a newurl, a newauth.kind, otherscopesor anotherclientIdforgets the credential first (the server isadded, orconnectedif the kind isnone), and asecretin the same request (kindbearerorapi_key) is then kept for the new definition and the server isconnected; any other combination is those effects together. A client says before it sends that a move forgets the credential. Delete:DELETEthe id; it takes no revision, and a 404 answering it means the server is already gone, which is what was asked. A 409stale_revisionis not to be retried: read the list again and let the person decide again. - Connect (an
oauth2server that isneeds_auth; and anoauth2server that is not, to authorize it again with another account or a wider scope, which the server allows):POST.../authorizewith no body. Show the person where they are being sent, before anything opens, and openauthorizeUrlonly when it parses, ishttps:(orhttp:on a loopback host, for a development authorization server) and has no user information;javascript:,data:, a relative or a malformed link is never opened, and the client says the server gave a link that cannot be opened. The orchestrator takes the authorization endpoint from the authorization server's own RFC 8414 metadata and judges its shape (https, a public host, no fragment:orchestrator/crates/credential-broker/src/discovery.rs,found_in), not that it is on the issuer's host, so the client shows the host ofauthorizeUrlitself as the destination and, when it differs from theissuer's, names both. Open it in a browser the client cannot lose control of: a link the person clicks (target="_blank", no opener, no referrer) on the web, the system browser on the desktop, an in-app tab on mobile. A client cannot know that a window it opened stayed open (a pop-up blocker returns the same as success), so it says "waiting for you to finish signing in", never that a window opened, and offers Check now and Open the sign-in page again (authorizeUserToolServeragain: a later call ends the earlier flow). It never logs or keeps the URL. The browser comes back tofinishUserToolAuthorization, which no client calls. The client learns the outcome by reading this list again: when the person returns to the app (the window regains focus; the web reads at most once in a quarter second, so a focus and a visibility change together are one read) and on the person's request.readyis done; anything else afterexpiresAtis "not finished; connect again". A 429rate_limitedcarriesRetry-After. - Attach. The picker is
listToolServers: the person's own servers haveown: true. Offer areadyone like any other and send the whole set withputThreadTools. One that is notreadyis not offered for attaching:needs_authsays what to do (give a key, or Connect, on the screen above:ToolServerdoes not say which, so a client takes the kind from this list'sauth.kindby id),unavailablesays itsreason. A 422tool_server_needs_authortool_server_unavailablefromputThreadToolsis the race only. - Errors, by
code(a client chooses its words from the status and thecode, and showsdetailonly where it is a person's own words: a 400's, which never quotes a value): 400url_refused(the address is refused:detailsays why for a person); 403forbidden(the permission is gone) orno_access; 404 (the server is gone, or the feature is off: read the list); 409too_many_servers,stale_revision; 422credentials_not_kept(add, change and authorize),egress_refusedandoauth_not_configured(authorizeUserToolServeronly: add and change answer a refused address as the 400url_refused,orchestrator/crates/app/src/user_tools/authorize.rs); 429rate_limited; 503broker_down,authorization_unavailable, or nocode(the server is being changed: waitRetry-Afterand try again). After any failed write whose outcome is unknown (a 500, a 503, a lost connection) the client reads this list again: a write runs to its end on the server whether or not the client waits.
Authorizations
A JWT signed by the configured issuer (RS256, RS384, ES256 or EdDSA), with the configured audience. Read when auth.mode is jwt or jwt_or_proxy_header. A missing or refused token gets 401 with WWW-Authenticate: Bearer; an issuer whose keys cannot be fetched gets 503.
A JWT as bearerToken, bound to the key of the client (cnf.jkt, RFC 7638), sent as Authorization: DPoP <token> with one DPoP header holding a proof signed by that key (RFC 9449, ADR 0054). Read only when auth.dpop is configured. A bad proof gets 401 with WWW-Authenticate: DPoP error="invalid_dpop_proof", algs="ES256 EdDSA", a bad or unbound token error="invalid_token".
Set by oauth2-proxy after OIDC login; requests without it get 401. Read when auth.mode is proxy_header (the default) or jwt_or_proxy_header without a bearer token.
Responses
The person's servers