Skip to documentation
Browse documentation

Build with LinkDevi

View Markdown ↗

Remote MCP and OAuth pilot

Connect a pre-registered public OAuth client to workspace-bound campaign tools, with explicit consent and revocation.

English · Updated 2026-11-28

Register before connecting

This pilot is separate from the published local stdio package. It requires an MCP client that lets you configure a pre-registered public OAuth client ID and an exact callback URL. Do not assume every AI product exposes those settings or supports this pilot. Browser-direct RPC, dynamic registration and client metadata document fetching are not supported. The local connector remains available.

  • As an Owner or Admin, open AI Connections in the workspace you want to connect.
  • Register an app name and up to three exact HTTPS callback URLs, or HTTP IP-loopback callbacks such as http://127.0.0.1:PORT/callback. Wildcards, credentials, localhost names and fragments are rejected. App names are supplied by the registrant and do not establish provider verification.
  • Configure the client with MCP URL https://linkdevi.com/mcp, its registered client ID and that exact callback. Token authentication method is none; there is no client secret.
  • Request links:read initially. Include links:write only when you need campaign creation. Follow the sign-in and explicit consent screen, checking the workspace, app and return address.
  • Use capabilities, preview, and user-authorized create. Preserve the requestId and exact payload across retries. The same stored-link quota and workspace API request budget apply.

Discovery and protocol contract

EndpointPurpose
GET /.well-known/oauth-protected-resource/mcpResource metadata; root alias is also available
GET /.well-known/oauth-authorization-serverIssuer, authorize/token/revoke endpoints and S256 support
GET /api/oauth/authorizeValidated authorization request; no access granted by visiting
POST /api/oauth/tokenForm-encoded authorization_code or refresh_token exchange
POST /api/oauth/revokeRevoke the connection for a token and matching client ID
POST /mcpStateless Streamable HTTP with JSON responses

The canonical issuer is https://linkdevi.com and the resource is https://linkdevi.com/mcp. Both authorization and token requests must include resource. Authorization requires response_type=code, state, code_challenge_method=S256 and a 43-character SHA256 base64url challenge. Callback matching is exact, including a loopback port. Token exchange requires the original redirect_uri and a 43–128 character PKCE verifier. Unsupported parameters and duplicate parameters are rejected.

The transport supports protocol versions 2025-11-25, 2025-06-18 and 2025-03-26. It is not an implementation of the newer 2026 transport revision. Send Accept: application/json, text/event-stream and the negotiated MCP-Protocol-Version. No server session or GET event stream is created. Unsupported versions return 400; authenticated GET/DELETE return 405. Missing/invalid OAuth access tokens return 401 with a resource_metadata challenge. Ordinary API keys are not accepted at /mcp; OAuth tokens are not accepted by the separate REST API.

Available tools use the same campaign service as REST: capabilities, preview_campaign, list_campaigns, campaign_stats and link_qr; create_campaign is listed only with links:write. Insufficient write access returns HTTP 403 with a scope challenge. Inputs are bounded to 16 KiB. No hosted model is included. Dated reports, print packs and audits keep their separate REST contracts.

Consent, expiry and recovery

Consent is workspace-bound and requires a current, unsuspended Owner or Admin. A connection expires within 30 days; access tokens last at most ten minutes and rotating refresh tokens at most seven days or the connection's remaining life. Authorization codes expire in two minutes and are single use. Tokens and codes are stored as SHA256 hashes. Reuse of a consumed valid code or refresh token revokes its entire connection. Serialize refresh requests; after an ambiguous refresh response, restart authorization instead of retrying the old refresh token.

Revoke a connection or disable its app in AI Connections. Revocation, expiry, suspension and loss of Owner/Admin membership are checked on subsequent requests, and campaign mutations recheck the grant in the write transaction. Existing saved links remain. Up to twenty active registered apps and one hundred active connections per workspace are supported. Rate limits fail closed when admission is unavailable; follow Retry-After rather than automatic creation retries.

This pilot allows server/native MCP clients. An Origin header must match the LinkDevi origin; cross-origin browser RPC and cross-origin browser token exchange are not enabled. Do not expose refresh/access tokens in browser scripts, URLs, source control or tool output. Store them in your client's secure credential store. Provider-specific end-to-end compatibility must be tested separately before claiming support for a named AI product.