Skip to content

MCP address and domain ​

20 operations. Paths are relative to https://api.frege.io.

Get the project's custom domain ​

GET/v1/projects/{id}/domain

The domain the project holds, verified or not. 404 when it holds none — the state every project starts in.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Claim a custom domain for the project ​

POST/v1/projects/{id}/domain

Records a hostname the project's owner intends to prove they control, and mints a DNS TXT challenge for it. Once verified (see the /verify endpoint), the project's live MCP server answers at https://<domain>/mcp and its staging MCP server at https://<domain>/staging/mcp — getting HTTPS traffic for the hostname onto this process still depends on a certificate and TLS termination provisioned outside this repository. A project holds at most one domain at a time; adding a second is refused until the first is deleted. The same hostname cannot be claimed by two different projects.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.addCustomDomainRequest.

FieldTypeDescription
domainstring

Responses

StatusDescriptionBody
201Createddata
404Not Founderror envelope
409Conflicterror envelope
422Unprocessable Entityerror envelope

Remove the project's custom domain ​

DELETE/v1/projects/{id}/domain

Releases the hostname so it can be claimed again — by this project or another. 404 if the project holds none.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
204No Content
404Not Founderror envelope

Check the project's domain DNS challenge ​

POST/v1/projects/{id}/domain/verify

Looks up the _frege-challenge.<domain> TXT record and compares it against the token this project was given. ALWAYS returns 200 — even when the record is missing or wrong — because "not verified yet" is the expected state while someone is still editing their DNS zone, not a caller error. Read verified and last_check_error in the response body to see the outcome. Once verified, re-running this is a no-op that reports the existing state without a new DNS lookup: a later missing record does not revoke a domain that already proved ownership once, since there is no periodic re-verification in this version. A verified domain with no icon_url also has its main site's icon read in the background, so icon_url fills in after this call returns; GET the domain to see it. The icon is looked for on the registrable domain, then each subdomain above the custom domain (sukoon.uz, www.sukoon.uz, then shop.sukoon.uz for mcp.shop.sukoon.uz), as the page's declared icon or /favicon.ico, PNG, JPEG, WebP, GIF or ICO under 64KB. It is then served at https://<domain>/icon and advertised in the MCP server's serverInfo.icons. A site with no usable icon leaves icon_url empty and does not affect verified; it is tried again every hour.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Hide Frege on the project's custom domain ​

PUT/v1/projects/{id}/domain/white-label

Makes the project's verified custom domain hide Frege from its customers, or show it again. With enabled, the domain is an OAuth authorization server of its own: its MCP doors name https://<domain> as their issuer, and the sign-in, consent and token endpoints are served there. google_client_id and google_client_secret are the project's own Google OAuth app, which docs readers prove they are people with, so Google's consent screen names the project's app, not Frege; its redirect URI is https://<domain>/oauth/docs/complete. Leaving them out keeps what is stored; an empty google_client_id removes the app, and Frege's is used. The secret is never answered, only whether one is kept. 409 domain_not_verified until the domain is verified. Apps connected before a change sign in again. Organization admin or project manager only.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.whiteLabelRequest.

FieldTypeDescription
enabledbooleanEnabled makes the domain an issuer of its own, with no Frege on its pages.
google_client_idstringGoogleAppID is the project's own Google OAuth app; "" removes it, nil keeps it.
google_client_secretstringGoogleAppSecret is the app's secret, never answered; nil keeps it.

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope
409Conflicterror envelope
422Unprocessable Entityerror envelope

Publish the project's MCP address ​

POST/v1/projects/{id}/mcp/publish

Opens the door at /mcp/{stage id} and returns the project with mcp_url populated. Republishing an already published project is a no-op, but publishing the LIVE environment always needs the body to carry confirm (the phrase from POST /mcp/publish-code) and the emailed code — staging needs neither. Organization admin or project manager only.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.specChangeConfirmation.

FieldTypeDescription
codestring
confirmstring

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope
404Not Founderror envelope
409Conflicterror envelope
422Unprocessable Entityerror envelope

Email a code for opening or closing Production's MCP address ​

POST/v1/projects/{id}/mcp/publish-code

Sends a six-digit code to the signed-in operator, needed by both POST /mcp/publish and POST /mcp/unpublish on the live environment. action only words the email for what is about to happen — the code itself is not bound to one of them, since an environment holds at most one outstanding code. Only meaningful for the live environment — 422 for staging, which needs no confirmation either way. Rate limited to one code a minute. The response carries the exact confirm phrase the follow-up call must send alongside the code. Requesting one invalidates any outstanding code for changing Production's spec on this stage, and vice versa.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
actionquerystringWhich door change the email should describe: 'publish' (default) or 'unpublish' One of: publish, unpublish.

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope
404Not Founderror envelope
422Unprocessable Entityerror envelope
429Too Many Requestserror envelope

Unpublish the project's MCP address ​

POST/v1/projects/{id}/mcp/unpublish

Closes the door: /mcp/{stage id} starts 404ing. The address itself does not move — it is the stage's own id, minted once and never reissued — so reopening later serves the same URL. Closing the LIVE environment always needs the body to carry confirm (the phrase from POST /mcp/publish-code?action=unpublish) and the emailed code, exactly like publishing does — staging needs neither. Organization admin or project manager only.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.specChangeConfirmation.

FieldTypeDescription
codestring
confirmstring

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope
404Not Founderror envelope
422Unprocessable Entityerror envelope

List the OAuth applications this environment's MCP doors have seen ​

GET/v1/projects/{id}/oauth-apps

Each application an access token at this environment's MCP door was issued to, the most recently seen first, at most 100. An application that registered with a Client ID Metadata Document is verified: its id is the origin that serves the document (https://claude.ai), which the authorization server fetched. Any other (Dynamic Client Registration) is not: its id is its OAuth client_id, which anyone could have registered. What a client says of itself when it connects is never used. The last time is updated at most once a minute.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope

List this environment's open playground sessions ​

GET/v1/projects/{id}/playground/sessions

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata

Open a playground session against this environment's MCP server ​

POST/v1/projects/{id}/playground/sessions

Connects a real MCP client to the environment's own server as staff, as a connected customer, or as the anonymous public documentation door.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: agenthandlers.openPlaygroundSessionRequest.

FieldTypeDescription
client_idinteger
identitystring

Responses

StatusDescriptionBody
201Createddata: api.playgroundSessionResponse
400Bad Requesterror envelope
403Forbiddenerror envelope
404Not Founderror envelope
422Unprocessable Entityerror envelope

What the environment's MCP server said about itself ​

GET/v1/projects/{id}/playground/sessions/{sessionID}

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
sessionID (required)pathstringSession ID

Responses

StatusDescriptionBody
200OKdata

Close a playground session ​

DELETE/v1/projects/{id}/playground/sessions/{sessionID}

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
sessionID (required)pathstringSession ID

Responses

StatusDescriptionBody
204No Content

The prompts this session's server advertises ​

GET/v1/projects/{id}/playground/sessions/{sessionID}/prompts

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
sessionID (required)pathstringSession ID

Responses

StatusDescriptionBody
200OKdata

The resources this session's server advertises ​

GET/v1/projects/{id}/playground/sessions/{sessionID}/resources

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
sessionID (required)pathstringSession ID

Responses

StatusDescriptionBody
200OKdata

Read one resource through the MCP protocol ​

POST/v1/projects/{id}/playground/sessions/{sessionID}/resources/read

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
sessionID (required)pathstringSession ID

Request body (application/json)

Schema: api.readResourceRequest.

FieldTypeDescription
uristring

Responses

StatusDescriptionBody
200OKdata

The tools this session's server advertises ​

GET/v1/projects/{id}/playground/sessions/{sessionID}/tools

Exactly what the connected identity sees, after grants filtering — not the project's full tool list.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
sessionID (required)pathstringSession ID

Responses

StatusDescriptionBody
200OKdata

Call a tool through the MCP protocol ​

POST/v1/projects/{id}/playground/sessions/{sessionID}/tools/{toolName}/call

The raw CallToolResult is returned unchanged, including is_error, which is how a tool reports its own failure as distinct from a protocol failure. A result with result_type "input_required" is not an error: it is a question — most often, on an environment set to "ask", approval for a write — and input_requests names what it needs. Resend the same call with input_responses and request_state from that result to answer it.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
sessionID (required)pathstringSession ID
toolName (required)pathstringTool name

Request body (application/json)

Schema: api.callToolRequest.

FieldTypeDescription
argumentsobject (map)
input_responsesmcp.InputResponseMap
request_statestring

Responses

StatusDescriptionBody
200OKdata

Every JSON-RPC message this session has exchanged ​

GET/v1/projects/{id}/playground/sessions/{sessionID}/transcript

Poll with ?since= the last sequence number seen. Dropped counts messages that fell off the start of a bounded log.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
sessionID (required)pathstringSession ID
sincequeryintegerReturn entries after this sequence number

Responses

StatusDescriptionBody
200OKdata

Choose which documentation is public ​

PUT/v1/projects/{id}/public-docs

Opens or closes this environment's documentation to anyone who signs in at its MCP URL (the same mcp_url that serves the API tools; the older /mcp-docs/{stage} still works), behind a sign-in gate (Google) that only proves the caller is a real person, not that they belong to this project. Closed is the default. enabled opens it; with no tags every document in the environment is served, and with tags only documents carrying one of them are, so an internal runbook in the same environment can stay private. Leaving enabled out keeps the older behaviour: a non-empty tag list opens the door and an empty one closes it. Organization admin only.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.setPublicDocsRequest.

FieldTypeDescription
enabledboolean
tagsstring[]

Responses

StatusDescriptionBody
200OKdata
422Unprocessable Entityerror envelope