Prompt to migrate an exported site to Next.js with the Firecrawl MCP server
This prompt asks Claude Code or Cursor to rebuild a WebExport download as a Next.js App Router project, one page at a time. The Firecrawl MCP server is used only to read the live page when the export is unclear, never to replace it. Each page is checked against the original before the next one starts.
Last reviewed
Key facts
- The export is the source of truth. The live page is a reference for rendered text and links.
- The Firecrawl MCP server can run keyless for search and scrape, or with an API key for the full tool set.
- The prompt migrates one page at a time and stops after each, so errors do not pile up.
- Test status: not run end to end. The MCP setup commands come from the Firecrawl docs read on 2026-11-29 and were not executed here, and no export was migrated with this exact prompt. The plain Next.js conversion prompts on this site were tested on a real export.
The prompt
Paste this into Claude Code, Cursor, Codex or another AI coding assistant with your project folder open, and replace everything in square brackets first. See how to run it in each tool.
You are migrating a static export to a Next.js App Router project. The export is in [EXPORT_FOLDER]. The live site is [LIVE_URL]. The new project goes in [NEXT_FOLDER: ./next-app]. The Firecrawl MCP server may be connected. Check your tool list before you start.
HOW TO USE FIRECRAWL
- Use firecrawl_scrape on a page of [LIVE_URL] only when the exported HTML is unclear: text drawn by JavaScript, a collapsed tab, or a link you cannot resolve. Compare the markdown it returns with the exported file.
- Use firecrawl_map once on [LIVE_URL] to get the page list. Compare it with the HTML files in [EXPORT_FOLDER].
- If the Firecrawl tools are not available, continue with the export alone and say so.
STEP 1: PLAN
Write MIGRATION-PLAN.md: the page list, the routes each page becomes, shared parts (header, footer), images and fonts, and anything that needs a decision (forms, CMS lists, scripts). Wait for my approval.
STEP 2: SCAFFOLD
Create the Next.js project in [NEXT_FOLDER] with the App Router. Move fonts and images into public/. Rewrite asset paths to local ones. Build the shared layout from the export's header and footer.
STEP 3: ONE PAGE AT A TIME
Rebuild the pages in this order: [PAGE_ORDER: home, then the others from the plan]. Keep the text, headings, alt text and link targets exactly as in the export. After each page, run the build, open the page, and compare its text with the export. Stop and report after each page.
STEP 4: PARITY
When all pages exist, list every route in the new project against the page list and report differences in title, h1 and word count.
RULES
- Do not change the text, the meaning or the URL of any page.
- Do not use Firecrawl to replace the export. Do not copy markdown from it into pages unless the export lacks that text, and say when you do.
- Never write the Firecrawl API key into a file, a commit or a message. Use environment variables only.
- Do not modify [EXPORT_FOLDER] or anything on the live site.
- Do not add dependencies I have not approved.How to run it
- Export the site with WebExport, unzip it, and open the folder in Claude Code or Cursor.
- Connect the Firecrawl MCP server with one of the commands below, or skip it and let the prompt work from the export.
- Send the prompt and approve the plan before the assistant writes code.
- Review each page as it is finished. Run the parity step and fix the differences before you deploy.
Connect the Firecrawl MCP server
Firecrawl documents three ways to connect. The commands below come from its MCP server docs, local server page and keyless page, read on 2026-11-29. Confirm them there before you use them.
| Way | Setup | What you get |
|---|---|---|
| Hosted, no key | claude mcp add --transport http firecrawl https://mcp.firecrawl.dev/v2/mcp | Search, scrape and parse tools, rate limited per IP address per day |
| Hosted, with a key | Add the same URL with an Authorization header of Bearer and your key, using the JSON config in the docs | The full tool set your plan allows |
| Local server | env FIRECRAWL_API_KEY=your-key npx -y firecrawl-mcp@3.40.0 (needs Node.js 22 or newer) | The open-source MCP server, which can also point at a self-hosted Firecrawl API |
The docs list these tools for the full server, among others: firecrawl_scrape, firecrawl_map, firecrawl_search, firecrawl_crawl and firecrawl_check_crawl_status. The keyless server offers only search, scrape and parse, so firecrawl_map from the prompt needs a key. If a tool is missing, the prompt tells the assistant to carry on from the export.
claude mcp add --transport http firecrawl https://mcp.firecrawl.dev/v2/mcp
claude mcp listWhen to reach for the live page
| Situation in the export | What to ask Firecrawl for | Then |
|---|---|---|
| Text is missing from a section that shows on the live page | firecrawl_scrape of that page as markdown | Check whether a script draws it, and decide how to rebuild it |
| A tab, accordion or slider hides content in the HTML | A scrape of the live page | Keep all panels in the new markup |
| A link target looks wrong | The page list from firecrawl_map | Point it at the matching route |
| Nothing is unclear | Nothing | Do not call it |
The plain conversion prompts, such as Webflow to Next.js or Framer to Next.js, carry the cleanup that each platform needs. Run those steps alongside this one.
Verify the result
Build the project, start it and compare it with the export.
cd next-app && npm run build
npm run start &
sleep 5
curl -s -o /dev/null -w "%{http_code}\n" http://localhost:3000/
grep -rn "FIRECRAWL" . --include="*.ts" --include="*.tsx" --include="*.json" --include="*.md" --exclude-dir=node_modules | head
kill %1- The build finishes with no errors and every route in MIGRATION-PLAN.md returns 200.
- The grep prints nothing, so no key was written to the project.
- Titles, h1 tags and word counts match the export, which is the output of the parity step.
What can go wrong
- The assistant pastes live markdown into pages instead of rebuilding from the export. The rules forbid it, but check the diff for long text blocks.
- An API key in an MCP config file can be committed by accident. Keep it in an environment variable and check git status.
- Large pages make the assistant lose track late in a session. The one-page-at-a-time rule keeps each step small.
Frequently asked questions
Do I need Firecrawl to migrate to Next.js?
No. The export has the HTML, CSS, scripts, images and fonts. Firecrawl helps only when you need to read a live page that the export leaves unclear.
What does the MCP server add?
It lets the assistant call Firecrawl tools such as scrape and map from inside the session, so it can read a live page without you copying text in.
Is the keyless server enough?
For scrape and search, per the docs. The map tool needs a key, and so do larger jobs. The free plan on the billing page lists 1,000 credits a month.
Which AI assistant should I use?
Claude Code, Cursor and Codex can all run the prompt. The how to run prompts guide covers setup in each.
Official documentation
Free tools for this job
- No-Code Platform DetectorInstantly detect if a site is built with Webflow, Framer, Squarespace, Wix, or Shopify.
- Webflow Code Cleanliness AuditAudit Webflow HTML for bloated interaction scripts, proprietary attributes, and form locks.
- No-Code Asset Path NormalizerRewrite CDN URLs to local relative paths for offline and self-hosted deployments.
- Website Asset Size AnalyzerAnalyze all images, JS, and CSS weights to find performance bottlenecks.
- Static Hosting PickerAnswer 5 questions and get the best hosting recommendation for your exported site.
Start with the files
Prompts work best on a WebExport download of your site. Paste your public URL into the export form and get a ZIP. The Free plan covers 1 site, 5 exports a month, 15 pages and 20 MB per export. Professional is a $9.99 one-time purchase with unlimited pages.