Endpoint
The server sends instructions at
initialize, and each tool describes its own input. MCP SDK clients read both automatically.
Authentication
The server is an OAuth 2.1 protected resource. Adclear sign-in is the authorization server. Every token acts as the user who signed in, with that user’s role and permissions.- Client: use the client ID that your Adclear account manager gives you. The client is public, so there is no client secret. Adclear does not support dynamic client registration.
- Flow: authorization code with PKCE.
- Resource: send
resource=https://mcp.adclear.ai/mcpon the authorization request and the token request. Adclear rejects a token issued for a different resource. - Scopes:
openid profile email offline_access user:org:read. Theuser:org:readscope puts the organisation in the token. - Organisation: the user chooses one organisation on the consent screen. To use a different organisation, the user signs in again.
- Refresh tokens:
offline_accessgives a refresh token. Refresh the access token when it expires. Do not ask the user to sign in again.
Authorization: Bearer <token>.
Authentication errors
When Adclear rejects a request, theWWW-Authenticate header tells the client what to do.
Workspaces
Each request uses one workspace. Adclear chooses it in this order:- The
X-Adclear-Workspace-Idrequest header, if you send it. - The workspace the user chose with
selectWorkspace, if the user can still use it. - The organisation’s default workspace, if the user can use it.
- The first workspace the user can use, by name.
Upload a local file
An agent can create a promotion from a publichttps link with sourceUrls on createPromotion. To upload a local file, use three steps.
1
Declare the file
Call
createUpload with the file name, MIME type and exact size in bytes. The result has an uploadId, an uploadUrl on https://files.adclear.ai, the headers to send and a curlExample you can run.2
Send the bytes
Send the file to
uploadUrl with HTTP PUT. Send Content-Type and Content-Range headers. A file of 50 MB or less goes in one request. A larger file goes in the chunks listed in chunks. Each chunk is 50 MB or less, and each chunk except the last is a multiple of 256 KiB. The link works for 2 hours and only for this upload.3
Complete the upload
Call
completeUpload with the uploadId. Adclear checks that the file content matches the declared type. Then pass the uploadId in uploadIds to createPromotion or createPromotionVersion.
If the agent runs in a sandbox with a network allowlist, the allowlist must include
files.adclear.ai. The agent never needs access to any other storage domain.
Retries and idempotency
createPromotion, createPromotionVersion, submitPromotion and precheckPromotion accept an idempotencyKey. Send a new key for each new action. Send the same key when you retry. A retry with the same key returns the first result and does not create a duplicate. Adclear keeps each key for 24 hours.
If a tool times out or loses its connection, the result says that the outcome is unknown and whether a retry is safe.
Paging
List tools returnhasMore. While hasMore is true, call the tool again with the nextPage or nextOffset value from the result.
Rate limits
When a request goes over a limit, the server returns
429 with a Retry-After header in seconds. Wait for that time, then retry.
Errors and support
Every response has anX-Correlation-ID header. A failed tool result includes a correlationId. A protocol error has it in error.data.correlationId. Give this ID to Adclear support when you report a problem.