+
Cursor + Wayfern
Cursor's Agent knows your code. It does not know what a library's docs say this week, or how your production site looks to a visitor.
With Wayfern in mcp.json, the Agent calls scrape_page, search_web and capture_screenshot. Each call runs in an anti-detect browser in Wayfern's cloud and returns markdown, JSON or an image URL.
lib›checkout.ts›checkout
1 import { Pay } from '@northwind/pay';
2
3 const pay = new Pay(env.NW_KEY);
4
5 export function checkout(cart: Cart) {
6 return pay.createCheckout({
7 amount: cart.total, items: cart.lines,
8 currency: 'usd',
9 returnUrl: SITE + '/done', successUrl: SITE + '/done',
10 });
11 }
12
13 export function refund(id: string) {
14 return pay.refunds.create({ id });
15 }
Fix lib/checkout.ts to match the createCheckout docs.
Thinking…
scrape_page wayfern
url: docs.northwind.dev/sdk/v4/checkout
## createCheckout(options)
- items (was amount)
- successUrl (was returnUrl)
markdown · credits_charged: 1
checkout.ts +2 -2
The v4 docs renamed two options. Both lines now match.
Setup
Put it in ~/.cursor/mcp.json for all projects, or in .cursor/mcp.json to share it with the team.
~/.cursor/mcp.json
{
"mcpServers": {
"wayfern": { "url": "https://api.wayfern.com/mcp" }
}
}Cursor starts the OAuth sign-in. Sign in on wayfern.com and click Allow.
Open Customize, MCPs. Wayfern shows its tools.
prompt
Read the current docs for the payments SDK's createCheckout call and fix our wrapper in lib/checkout.ts to match.Set WAYFERN_API_TOKEN to a token with the mcp scope in your shell startup file, for example ~/.zshrc.
~/.cursor/mcp.json
{
"mcpServers": {
"wayfern": {
"url": "https://api.wayfern.com/mcp",
"headers": { "Authorization": "Bearer ${env:WAYFERN_API_TOKEN}" }
}
}
}The agent command reads the same mcp.json.
bash
agent mcp login wayfern
agent -p --trust --approve-mcps "With Wayfern, read the changelog of our UI library and list the breaking changes"Cursor loads skills from ~/.cursor/skills and ~/.agents/skills, and also from ~/.claude/skills. The skill needs WAYFERN_API_TOKEN in the environment.
bash
mkdir -p ~/.cursor/skills/wayfern
curl -fsSL https://wayfern.com/skills/wayfern/SKILL.md -o ~/.cursor/skills/wayfern/SKILL.mdRoute
With MCP, the Agent calls Wayfern as a tool and needs no terminal approval or network access in the sandbox. One sign-in covers every tool.
mcp.json.wf_ token in headers, read from an environment variable.~/.cursor/skills/wayfern. The Agent runs curl in the terminal.api.wayfern.com/api/v1 directly.Example tasks
01
“Read the current docs for the payments SDK's createCheckout call and fix our wrapper in lib/checkout.ts to match.”
scrape_page at 1 credit a page.
02
“Capture https://example.com/pricing in dark mode at 390 pixels wide and tell me if the plan cards overflow.”
capture_screenshot costs 5 credits. width goes down to 320.
03
“Get the styleguide of stripe.com and write its colours and radii as Tailwind theme tokens.”
site_styleguide costs 10 credits for a site.
04
“Search Google and DuckDuckGo for this hydration error and list the causes that people confirm.”
search_web bills 2 credits for each provider page.
Tools
The same tools on every route, at the REST API rates. Every result reports credits_charged.
localhost on your computer. Use a public staging URL.Sign in once and the tools appear. Tool calls use the credits of your Wayfern plan, at the same rates as the API.