Skip to content
Connect an agent

Connections

Approve a request to connect an agent

Verifies the signed authorization request the MCP server made, makes a hidden API key for the agent, and answers with a signed approval that carries the key sealed.

POST/user/mcp/approve

TL;DR

QuestionAnswer
What does it do?Approve a request to connect an agent.
What does it take?A JSON body of type ApproveConnectionBody.
What does it return?Status 200 with a body of type Approval.
What can go wrong?400 the request is malformed, has expired (mcp.request_expired), or was not signed by the MCP server (mcp.request_invalid); 401 not signed in; 403 the request came from an origin that may not make changes, you are a reader in the organisation (orgs.forbidden), the organisation requires single sign-on (orgs.sso_required), or an organisation asks that agents connect to it (mcp.org_connection_required); 404 no such organisation, or you are not a member of it; 409 the sign-in link was already approved or denied (mcp.request_used); 429 too many requests; 503 connecting an agent is not set up on this server. Every failure uses the one error envelope.

What it does

Verifies the signed authorization request the MCP server made, makes a hidden API key for the agent, and answers with a signed approval that carries the key sealed. The browser then goes to redirectTo. With organisation, the key belongs to that organisation and acts as you, with your role's diagram permissions; a reader may not. Connecting the same agent install again replaces its key. Each sign-in link is answered once: approving or denying it again is 409 mcp.request_used.

Request body

The body has the type ApproveConnectionBody.

FieldTypeRequiredDescription
requeststringyesThe signed authorization request, exactly as the MCP server put it in the address. at least 1 character; at most 6144 characters.
organisationstringnoConnect the agent to this organisation, by its id, instead of your own account. Any role but reader may. The agent then works in the organisation's library as you, with the diagram permissions your role has and nothing more, and its calls count toward your own daily allowance.

Responses

StatusMeaningBody
200Approved.Approval
400The request is malformed, has expired (mcp.request_expired), or was not signed by the MCP server (mcp.request_invalid).ErrorResponse
401Not signed in.ErrorResponse
403The request came from an origin that may not make changes, you are a reader in the organisation (orgs.forbidden), the organisation requires single sign-on (orgs.sso_required), or an organisation asks that agents connect to it (mcp.org_connection_required).ErrorResponse
404No such organisation, or you are not a member of it.ErrorResponse
409The sign-in link was already approved or denied (mcp.request_used).ErrorResponse
429Too many requests.ErrorResponse
503Connecting an agent is not set up on this server.ErrorResponse

Response body

A 200 answer has the type Approval.

FieldTypeRequiredDescription
approvalstringyesThe signed approval. It carries the connection key sealed, so it is safe in an address.
expiresInintegeryesSeconds the approval stays usable.
redirectTostringyesWhere to send the browser: the MCP server callback with the request and the approval already attached.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools