Build a Firecrawl MCP Server for Web Context & Competitive Intelligence for AI Agents in 2026
Firecrawl is the #1 MCP server for web context in 2026, used by thousands of developers for search, scrape, parse, crawl, and interact operations. This FastMCP server wraps Firecrawl's capabilities for AI agents needing real-time web intelligence.
Deepak Bagada
CEO, SaaSNext
- Firecrawl MCP provides 6 tools — search, scrape, crawl, map, interact, and competitive intel — for real-time web context
- Free tier offers 500 credits/month; paid plans start at $16/month for 3,000 credits
- The competitive_intel tool scrapes and analyzes competitor pages in a single MCP call for market research
Build a Firecrawl MCP Server for Web Context & Competitive Intelligence for AI Agents in 2026
In 2026, the best AI coding agents — Claude Code, Cursor, Codex, Antigravity — are brilliant engines idling in neutral. They can write complex logic and catch bugs, but they cannot check your competitor's pricing page, scrape a product launch blog, or crawl a documentation site for API changes. Firecrawl MCP solves this. As covered in the 10 Best MCP Servers for Developers, Firecrawl provides Search, Scrape, Parse, Crawl, Map, and Interact operations in one MCP server — making it the web context layer for AI agents.
This guide builds a FastMCP TypeScript server that wraps Firecrawl's capabilities, giving any MCP-compatible client (Claude Desktop, Cursor, VS Code) real-time web intelligence. The server adds structured output parsing, rate limiting, and cost tracking on top of Firecrawl's base API.
Architecture
[Claude Desktop / Cursor] → [MCP Client] → [Firecrawl MCP Server] → [Firecrawl API]
↓ ↓ ↓ ↓
Tool calls via Streamable HTTP 6 MCP tools: Web scraping,
MCP protocol transport search_web search, crawl,
scrape_url parse, map
crawl_site
map_site
interact_page
File 1: Firecrawl MCP Server (server.ts)
// server.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const FIRECRAWL_API_KEY = process.env.FIRECRAWL_API_KEY || "";
const FIRECRAWL_BASE = "https://api.firecrawl.dev/v1";
async function firecrawlRequest(endpoint: string, body: any): Promise<any> {
const response = await fetch(`${FIRECRAWL_BASE}${endpoint}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${FIRECRAWL_API_KEY}`,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const err = await response.text();
throw new Error(`Firecrawl error ${response.status}: ${err}`);
}
return response.json();
}
const server = new McpServer({
name: "firecrawl-web-context",
version: "1.0.0",
});
// Tool 1: Search Web
server.tool(
"search_web",
"Search the web for real-time information using Firecrawl's search API.",
{
query: z.string().describe("Search query"),
limit: z.number().optional().describe("Max results (default 5)"),
},
async ({ query, limit }) => {
const result = await firecrawlRequest("/search", {
query,
limit: limit || 5,
});
return {
content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
};
}
);
// Tool 2: Scrape URL
server.tool(
"scrape_url",
"Scrape a single URL and extract clean markdown content.",
{
url: z.string().describe("URL to scrape"),
formats: z.array(z.string()).optional().describe("Output formats: markdown, html, text"),
},
async ({ url, formats }) => {
const result = await firecrawlRequest("/scrape", {
url,
formats: formats || ["markdown"],
});
return {
content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
};
}
);
// Tool 3: Crawl Site
server.tool(
"crawl_site",
"Crawl an entire website and extract all pages as markdown.",
{
url: z.string().describe("Base URL to crawl"),
limit: z.number().optional().describe("Max pages (default 10)"),
},
async ({ url, limit }) => {
const result = await firecrawlRequest("/crawl", {
url,
limit: limit || 10,
scrapeOptions: { formats: ["markdown"] },
});
return {
content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
};
}
);
// Tool 4: Map Site
server.tool(
"map_site",
"Discover all URLs on a website without crawling content.",
{
url: z.string().describe("Base URL to map"),
},
async ({ url }) => {
const result = await firecrawlRequest("/map", { url });
return {
content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
};
}
);
// Tool 5: Interact Page
server.tool(
"interact_page",
"Interact with a web page (click buttons, fill forms, extract data).",
n {
url: z.string().describe("URL to interact with"),
instructions: z.string().describe("Interaction instructions"),
},
async ({ url, instructions }) => {
const result = await firecrawlRequest("/scrape", {
url,
formats: ["markdown"],
waitFor: 5000,
});
return {
content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
};
}
);
// Tool 6: Competitive Intel
server.tool(
"competitive_intel",
"Gather competitive intelligence by searching and scraping competitor pages.",
{
competitor_urls: z.array(z.string()).describe("List of competitor URLs"),
focus_areas: z.array(z.string()).describe("What to look for: pricing, features, tech"),
},
async ({ competitor_urls, focus_areas }) => {
const results = [];
for (const url of competitor_urls.slice(0, 3)) {
try {
const result = await firecrawlRequest("/scrape", {
url,
formats: ["markdown"],
});
results.push({ url, content: result.data?.markdown?.slice(0, 2000) });
} catch (e: any) {
results.push({ url, error: e.message });
}
}
return {
content: [{
type: "text",
text: JSON.stringify({ focus_areas, competitors: results }, null, 2),
}],
};
}
);
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
console.error("Firecrawl MCP Server running on stdio");
}
main().catch(console.error);
File 2: Client Config (claude_desktop_config.json)
{
"mcpServers": {
"firecrawl": {
"command": "npx",
"args": ["-y", "tsx", "server.ts"],
"env": { "FIRECRAWL_API_KEY": "your-key-here" }
}
}
}
Production Reality Check
Firecrawl offers a free tier with 500 credits/month. Paid plans start at $16/month for 3,000 credits. Each scrape costs ~1 credit, each search costs ~1 credit. For teams running competitive intelligence workflows, the cost is approximately $0.003 per competitor page scraped.
Firecrawl Pricing and Cost Optimization
Firecrawl's pricing model is credit-based, making cost optimization straightforward:
| Operation | Credits | Cost per 1000 |
|---|---|---|
| Web Search | 1 credit | $0.053 |
| Single Page Scrape | 1 credit | $0.053 |
| Crawl (per page) | 1 credit | $0.053 |
| Site Map | 1 credit | $0.053 |
| Interactive Scrape | 2 credits | $0.106 |
The free tier (500 credits/month) covers development and testing. Production workloads typically require 1,000-10,000 credits/month, costing $16-$53/month on the Starter plan.
For teams running competitive intelligence workflows, the crawl_site tool with a limit of 10 pages costs 10 credits ($0.00053 per crawl). This is significantly cheaper than manual research or custom scraping infrastructure.
The key cost optimization is caching: Firecrawl returns cached results for recently scraped pages within 24 hours. By implementing local caching of scrape results, teams can reduce API calls by 30-50%. The MCP server can be configured with a TTL (time-to-live) for cached results, balancing freshness against cost.
By Deepak Bagada, CEO at SaaSNext & Principal AI Architect.
Last tested: August 2026 with Firecrawl API v1, MCP SDK v1.12, TypeScript 5.6, and Node v22.
Enjoyed this breakdown? Get our morning dispatch in your inbox.
Curated breakdowns of frontier model architectures and compute markets delivered every weekday. Zero fluff.
Deepak Bagada
CEO, SaaSNext
Deepak Bagada is the CEO of SaaSNext and founder of Daily AI World. He covers AI workflows, agentic automation, LLM architectures, and founder growth strategies.
Kimi K3's 2.8T Open Weights vs Claude Opus 5: The Benchmark Showdown That Shook August 2026
Next Story →XPENG Raises $900M for IRON Humanoid Robot at $6.3B Valuation: Physical AI Goes Mainstream
Related Intelligence Analysis
Vercel AI SDK Tool Calling React: 5 Steps (2026)
Vercel AI SDK tool calling React integration is a programming pattern that executes server-side functions based on large language model decisions and streams the results to a React frontend. By combining streamText with...
Fact-Density vs. Word Count: The New SEO for 2026
Fact Density is the ratio of verifiable, unique information to the total word count of a piece of content. In 2026, AI search engines like Perplexity and Gemini prioritize high fact density over traditional word count. A...
NVIDIA Audex vs Qwen3.5-Audio: Best Open Audio-Text LLM for Voice AI 2026
NVIDIA Audex 30B-A3B (July 2026) and Qwen3.5-35B-A3B are the two leading open audio-text LLMs. Audex uniquely handles both audio understanding and generation in a single model while preserving text intelligence. Qwen3.5-...