Connect an AI agent over MCP

Connect Claude, ChatGPT, Cursor or any MCP client to Wayfern. Sign in with OAuth in the browser or send an API token, then manage and revoke the connection.

Updated

Wayfern runs a remote MCP server. An agent that connects to it can search the web, scrape and crawl pages, extract data and take screenshots, and each call spends your account’s credits. This guide shows how to connect a client with OAuth or with an API token, how to revoke a connection, and what to do when a connection fails.

The server URL

Every client uses the same URL:

https://api.wayfern.com/mcp

The transport is Streamable HTTP. Your account needs an active plan or a positive credit balance before tool calls work.

Sign in with OAuth

Give your client the URL and nothing else. The first time the client connects, Wayfern answers that it needs a sign-in, and the client opens a Wayfern page in your browser. You do not copy a token.

In Claude Code:

claude mcp add --transport http wayfern https://api.wayfern.com/mcp

Then run /mcp in Claude Code, select wayfern and authenticate. In a client that reads a JSON config, such as Cursor, add the URL without headers:

{
  "mcpServers": {
    "wayfern": {
      "type": "http",
      "url": "https://api.wayfern.com/mcp"
    }
  }
}

In a chat app, such as Claude or ChatGPT, add a custom connector or remote MCP server with the same URL.

On the Wayfern page:

  1. If you are signed out, sign in with your email code. You come back to the same page.
  2. Check the app name, its host and where the browser returns to. An app that registered itself chose its own name, so Wayfern shows a warning. Allow it only if you started the sign-in from that app.
  3. Select Allow. The browser goes back to the app, and the app is connected. Select Deny to refuse.

The connection has the same tool access as an API token with the mcp scope. It never gets admin tools. Its access token lasts one hour, and the client renews it with a refresh token. The refresh token expires after 60 days without use.

Use an API token instead

Use a token when the client cannot open a browser, or for CI and scripts. Create a token with the mcp scope on the API tokens page, then send it in the Authorization header:

{
  "mcpServers": {
    "wayfern": {
      "type": "http",
      "url": "https://api.wayfern.com/mcp",
      "headers": {
        "Authorization": "Bearer ${WAYFERN_API_TOKEN}"
      }
    }
  }
}

Set WAYFERN_API_TOKEN in your client’s secret storage, and never commit the token. See API tokens and scopes.

Manage and revoke connections

The API tokens page lists each connected app under Connected apps, with its host, when it connected and when it was last used. Select Revoke to disconnect an app. Its next MCP call fails, and it can connect again only if you sign in again.

Each sign-in makes its own connection. If you connect the same app on two computers, you see two rows.

Tools and credits

The server has tools for search (search_web), single pages (scrape_page, capture_screenshot), whole sites (map_site, crawl_site), structured data (extract_data), design data (brand_profile, site_styleguide, site_fonts) and Operations. Each tool’s description states its price, and each paid result reports what it cost in credits_charged. The credits come from the same balance as the REST API.

get_usage is free. It returns your credit balance, plan, usage in this billing period, and open browser pages against your plan limit. Tell your agent to call it before a large batch. The MCP reference lists every tool, its inputs and its price.

Troubleshooting

  • The browser did not open: most clients also print the sign-in link. Open it in the browser where you are signed in to Wayfern.
  • The page says the sign-in request is not valid: start the sign-in again from the app. The app may have an old registration, or a return address that Wayfern does not accept.
  • You signed in with the wrong account: on the sign-in page, select Use another account.
  • Tool calls fail with HTTP 402: the account has no plan and no credits. Subscribe or add credits on the usage page.
  • The app worked and now gets HTTP 401: the connection was revoked, or it was not used for 60 days. Sign in again from the app. In Claude Code, run /mcp and authenticate again.
  • Your client does not support OAuth: use an API token in the header, as shown above.