Tutorial

How to Convert API Docs to Markdown for Cursor

Fetch any API doc site as clean LLM-ready markdown inside Cursor using the Scavio MCP endpoint. No nav, no cookies, token-efficient.

Cursor's context window is precious. Raw doc sites load with nav, cookie banners, and footers that waste 40 to 60% of the window. Scavio's structured content fetcher plus MCP integration strips chrome and returns LLM-ready markdown, so the agent reads more of what matters.

Prerequisites

  • Cursor IDE latest
  • A Scavio API key
  • Node.js 20+

Walkthrough

Step 1: Open Cursor MCP settings

Cursor reads MCP servers from ~/.cursor/mcp.json.

Bash
code ~/.cursor/mcp.json

Step 2: Register the Scavio MCP

One config block adds scavio_fetch and scavio_search tools.

JSON
{
  "mcpServers": {
    "scavio": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.scavio.dev/mcp"],
      "env": { "SCAVIO_API_KEY": "${SCAVIO_API_KEY}" }
    }
  }
}

Step 3: Reload Cursor

Restart the IDE to discover MCP tools.

Text
# Cmd+Shift+P then Reload Window

Step 4: Fetch a doc page in chat

Ask Cursor to pull and summarize a doc URL.

Text
@scavio fetch https://docs.prisma.io/orm/prisma-migrate and summarize the breaking changes in v6.

Step 5: Verify token savings

Check the input-token count versus a raw paste.

Text
# Before: ~8,000 tokens of raw HTML
# After:  ~2,500 tokens of structured markdown

Python Example

Python
# Cursor uses the MCP directly; no Python code required.
# Direct API call for parity:
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']
r = requests.post('https://api.scavio.dev/api/v1/extract',
    headers={'x-api-key': API_KEY},
    json={'url': 'https://docs.prisma.io/orm/prisma-migrate', 'format': 'markdown'})
print(r.json().get('markdown', '')[:500])

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
const r = await fetch('https://api.scavio.dev/api/v1/extract', {
  method: 'POST',
  headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({ url: 'https://docs.prisma.io/orm/prisma-migrate', format: 'markdown' })
});
console.log(((await r.json()).markdown || '').slice(0, 500));

Expected Output

JSON
Clean markdown representation of the doc page, stripped of nav and cookies. Cursor's context fills with content instead of chrome.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Cursor IDE latest. A Scavio API key. Node.js 20+. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Fetch any API doc site as clean LLM-ready markdown inside Cursor using the Scavio MCP endpoint. No nav, no cookies, token-efficient.