Appearance
MCP servers and sign-in
Every environment of a project is an MCP server with your API's tools. Any MCP client can connect: Claude (web, desktop, mobile, Claude Code), ChatGPT, Cursor, or a client you write. Each person who connects signs in to your product, and their tool calls run as them.
Addresses
| Address | Environment |
|---|---|
https://<project id>.mcp.frege.io/mcp | Production |
https://<project id>.mcp.frege.io/staging/mcp | Staging |
https://<your domain>/mcp, https://<your domain>/staging/mcp | With a verified custom domain |
https://mcp.frege.io/mcp/<environment id> | The older form; it keeps working |
- Production answers only once it is published (
POST /v1/projects/{id}/mcp/publish, confirmed with an emailed code). Staging needs no publishing. - The transport is MCP's Streamable HTTP, stateless. There is no SSE endpoint.
- The doors answer browsers too (CORS): any origin, methods
GET,POST,DELETE,OPTIONS. - The same address serves your documentation: someone who is not your customer, when the environment's public docs are open, gets a
search_docstool over the documents you published.
GET /v1/projects/{id} shows the environment's current address as mcp_url.
Connecting a client
Claude
- In claude.ai or Claude Desktop, open Settings → Connectors and choose Add custom connector.
- Paste the address and name it.
- Claude opens a sign-in window: the customer signs in with their account in your product, then allows the connection.
In Claude Code:
bash
claude mcp add --transport http shop https://<project id>.mcp.frege.io/mcpThen run /mcp and choose the server to sign in.
Other clients
Any client that supports remote MCP servers over HTTP with OAuth works the same way: add the address and sign in when asked. Clients discover the sign-in from the server; there is nothing to configure. A project API key does not open an MCP server.
How sign-in works
The MCP servers use OAuth 2.1 with discovery, so a client finds everything from the address alone:
- The client calls the address with no token. The server answers
401withWWW-Authenticate: Bearer realm="mcp", resource_metadata="<url>". - The protected resource metadata (RFC 9728) at
<url>names the authorization server. Forhttps://<project id>.mcp.frege.io/mcpit is athttps://<project id>.mcp.frege.io/.well-known/oauth-protected-resource/mcp. - The authorization server's metadata is at
<issuer>/.well-known/oauth-authorization-server(also/.well-known/openid-configuration). The issuer ishttps://mcp.frege.io, or your own domain when it hides Frege. - The client registers itself (RFC 7591) at
POST <issuer>/oauth/register, then sends the person to<issuer>/oauth2/authwith PKCE. - The person signs in through your sign-in recipe and allows the connection.
- The client exchanges the code at
POST <issuer>/oauth2/token.
| Setting | Value |
|---|---|
| Grant types | authorization_code, refresh_token |
| PKCE | required, S256 |
| Client authentication | none (a public client), client_secret_basic (the default) or client_secret_post |
| Redirect URIs | 1 to 10; https, http only to localhost, or a custom scheme |
| Scopes | openid profile email offline_access |
| Access token | an ES256 JWT, valid for one hour |
| Refresh token | 30 days, rotated on every use; with offline_access |
Every sign-in makes the person a customer of the environment, listed by GET /v1/projects/{id}/clients.
What a connected client may do
- Write policy. Writes run, are refused, or (
ask) wait for a person. An MCP client that can show a form puts the approval in front of the person; elsewhere a write underaskis refused. - Scopes. A customer's grants (
PUT /v1/projects/{id}/clients/{clientID}/grants) narrow the tools they get. - Redaction. Sensitive data is removed from answers before the model sees them.
- Audit. Every call is in the audit log.
Errors
The server answers at the HTTP level before MCP starts:
| Status | Body | When |
|---|---|---|
401 | {"error": "unauthorized", "hint": "..."} | No token, or one that does not verify. Follow WWW-Authenticate. |
402 | billing_suspended | The organization's billing is suspended. |
403 | {"error": "connect_required", "connect_url": "...", ...} | The person signed in but has not connected their account in your product, or it expired and cannot be renewed. |
404 | No such address, or Production is not published. | |
429 | too many requests | Too many requests; wait and try again. |
A tool that fails answers as a tool result with isError: true, not as a JSON-RPC error. Its text is JSON with an error_class, a reason and a hint, and retry_after_seconds when waiting helps:
error_class | What happened |
|---|---|
invalid_arguments | The arguments do not fit the tool's schema. |
denied | A rule of the environment refused the call, such as the write policy, a guardrail or the wallet. |
rate_limited | A limit refused it; see retry_after_seconds. |
busy | The environment's share of calls to your API is in use; try again shortly. |
upstream_unavailable | Your API keeps failing, so Frege stopped calling it for a short while. |
no_credential | The call has no usable credential: the customer must sign in again, or the sign-in setup is incomplete. |
transport | Any other failure of the call to your API. |
Other classes (missing_slots, photo_unavailable, injected_value, chain_refused, step_unusable) come from photos and intent tools.
Extensions
Besides tools, the servers advertise three MCP extensions: io.modelcontextprotocol/events (Events), io.modelcontextprotocol/tasks (long tool calls) and io.modelcontextprotocol/skills (the environment's skills).
Your own domain
Serve the MCP servers and the sign-in pages at a hostname you own:
bash
curl -X POST "https://api.frege.io/v1/projects/$PROJECT/domain" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"domain": "mcp.example.com"}'Then publish two DNS records:
| Type | Host | Value |
|---|---|---|
CNAME | mcp.example.com | domains.frege.io |
TXT | _frege-challenge.mcp.example.com | the token in the answer |
POST /v1/projects/{id}/domain/verify checks the TXT record; it always answers 200, so read verified and last_check_error. Once verified, the addresses move to https://mcp.example.com/mcp and /staging/mcp, and Frege gets the HTTPS certificate itself on the first connection. A project holds one domain at a time.
PUT /v1/projects/{id}/domain/white-label with {"enabled": true} hides Frege: the domain becomes an authorization server of its own (issuer https://mcp.example.com), and no Frege address appears in the sign-in. Add google_client_id and google_client_secret to have Google's screen name your app for docs readers; its redirect URI is https://mcp.example.com/oauth/docs/complete. Clients connected before a change sign in again.