Skip to main content
Glama
web-data-server
by ai-suntzu
README.md
<p align="center">
  <img src="assets/social-preview.png" alt="open-firecrawl: the open-source Firecrawl alternative for AI agents" width="100%">
</p>

# open-firecrawl

**The open-source Firecrawl alternative: a small, self-hosted MCP server that gives AI agents web search, page scraping and site mapping, with no API keys.**

open-firecrawl (formerly web-data-server) is a self-hosted web scraping MCP server for Claude and other AI agents. It lets an agent search the web, scrape pages into clean markdown and list a site's URLs without API credits, as a small MIT-licensed alternative to Firecrawl for people who only need those three basics.

<p align="center">
  <img src="assets/demo-scrape.png" alt="Real output of the scrape tool on example.com: a title line, then the page text between UNTRUSTED-WEB-CONTENT markers" width="80%"><br>
  <sub>Real output of the <code>scrape</code> tool on example.com, shortened. Page text always arrives wrapped in UNTRUSTED-WEB-CONTENT markers.</sub>
</p>

## Why I built this

I got tired of constantly running into API credit limits on paid scraping services. I built open-firecrawl to give my AI agents search, scrape and map tools without those limits. I made it when Claude Fable first came out, because I wanted to test what it could do. I build AI agent workflows and I am learning applied AI.

Built with AI assistance (Claude).

## What it does

It runs on your own computer and talks to your AI client using [MCP](https://modelcontextprotocol.io) (Model Context Protocol, a standard way for an AI assistant to call tools). It exposes three tools:

| Tool | What it does | Inputs |
| --- | --- | --- |
| `search` | Returns title, URL and snippet for a query | `query`, `max_results` (1-20, default 10) |
| `scrape` | Opens a URL in headless Chromium and returns the main content as markdown | `url`, `raw`, `start_index` |
| `map` | Lists a site's URLs from its sitemap, or from links on the page | `url`, `max_urls` (1-500, default 100) |

Search uses your own [SearXNG](https://github.com/searxng/searxng) if you set one up. That is the recommended setup. Without it, search falls back to DuckDuckGo, which is best effort and can be rate-limited or blocked. Scrape uses Playwright. Map uses plain HTTP, no browser.

## Quickstart

You need Node.js and Git. Tested on Node 24 and Windows 11 only. Linux, macOS and other Node versions are untested.

```
git clone https://github.com/ai-suntzu/open-firecrawl.git
cd open-firecrawl
npm install
npx playwright install chromium
```

Try it with one call. This starts the server, scrapes example.com and prints the result:

```
node --input-type=module -e "import{Client}from'@modelcontextprotocol/sdk/client/index.js';import{StdioClientTransport}from'@modelcontextprotocol/sdk/client/stdio.js';const c=new Client({name:'try',version:'0'},{capabilities:{}});await c.connect(new StdioClientTransport({command:'node',args:['src/server.js']}));const r=await c.callTool({name:'scrape',arguments:{url:'https://example.com'}});console.log(r.content[0].text);await c.close()"
```

You should see a line starting `title: Example Domain`, then the page text between `UNTRUSTED-WEB-CONTENT` markers.

To check your setup, run `npm run probe`. It opens example.com in Chromium and checks your search backend. It prints `browser: OK` if the browser works and exits with an error only if it does not. The `search:` line says `OK`, or `WARNING` if DuckDuckGo is blocking you or your SearXNG is not reachable. A warning does not fail the probe, because search is optional, but `search` will return errors until you fix it (see Configuration).

## How do I use it with Claude?

Register it as an MCP server. In Claude Code:

```
claude mcp add --transport stdio open-firecrawl -- node /absolute/path/to/open-firecrawl/src/server.js
```

Everything after `--` is the command that starts the server. This is the form shown in the [Claude Code MCP docs](https://code.claude.com/docs/en/mcp) (`claude mcp add --transport stdio myserver -- python server.py`). The syntax follows those docs, but the command has not been run inside Claude Code itself. The server was started with the same `node .../src/server.js` command and called through the official MCP SDK client.

For a client that uses a JSON config file (for example Claude Desktop), add this to `mcpServers`:

```json
{
  "mcpServers": {
    "open-firecrawl": {
      "command": "node",
      "args": ["/absolute/path/to/open-firecrawl/src/server.js"]
    }
  }
}
```

Use the full path to `src/server.js` on your machine. Then ask Claude something like "scrape https://example.com" or "map the site https://modelcontextprotocol.io". The server speaks standard MCP over stdio, so other MCP clients should work too. It has only been tested with the official MCP SDK client.

## Does it need an API key?

No. There are no accounts, keys or credit limits. If you use SearXNG you run it yourself, and if you use the DuckDuckGo fallback you depend on DuckDuckGo not blocking you (see Limitations).

## How is this different from Firecrawl?

[Firecrawl](https://github.com/firecrawl/firecrawl) is an established project that is also open source and can also be self-hosted, so this is a small alternative, not a full clone. open-firecrawl does much less. The point is to be small and easy to read, with a permissive license.

| | open-firecrawl | Firecrawl |
| --- | --- | --- |
| License | MIT | AGPL-3.0 (SDKs and some UI components MIT) |
| Run it yourself | One Node process, optional SearXNG | Firecrawl Local (one binary), or the full server (Docker Compose with Redis, PostgreSQL and a browser service) |
| Hosted service | No | Yes, Firecrawl Cloud |
| What it does | search, scrape, map | Scraping, crawling and mapping when run locally. Cloud adds search, Alexandria, Interact and Agent |
| Scale | One scrape at a time | The full server has queues and workers |

The Firecrawl column comes from [Firecrawl's README](https://github.com/firecrawl/firecrawl), read on 2026-12-02. The other column comes from this repo's code. If you need crawling, more tools or scale, use Firecrawl or another mature tool.

## Features

- **SSRF guard.** SSRF (server-side request forgery) means tricking a server into fetching an internal address. Only http and https are allowed. Hostnames are lowercased and trailing dots are removed before any check. Blocked: `localhost` and `*.localhost`, `.local`, `.internal` and similar private names, known cloud-metadata hostnames (such as `metadata.google.internal`), single-word hostnames, and private, loopback, link-local, multicast and reserved IPs. IPv4 in hex, octal and integer forms and IPv6 forms (including IPv4-mapped) are decoded and checked. Any other hostname is looked up in DNS first, and refused if ANY address it resolves to is blocked (so names like `127.0.0.1.nip.io` are refused) or if the lookup fails.
- **Redirects are checked by hand.** `scrape` and `map` follow up to 5 redirects themselves and check every hop before requesting it. `scrape` then sends the browser straight to the final URL, checks the address of every request and WebSocket the browser starts, and checks the final URL again after loading.
- **Search fallback.** Tries SearXNG first. On an error, bad JSON or timeout it falls back to DuckDuckGo. If both fail you get a clear error with a link for a manual search.
- **Readable output.** Mozilla Readability and Turndown turn a page into markdown. A flag `extraction_suspect` is set when extraction keeps under 15% of a long page. Long pages can be continued with `start_index`.
- **Untrusted-content markers.** Scraped text is wrapped in `UNTRUSTED-WEB-CONTENT` markers so the model treats it as data, not instructions. This lowers prompt-injection risk. It does not remove it.
- **Usage log.** One JSON line per call (time, tool, ok, source, error code) in `logs/usage.jsonl`. It stores no queries and no page content.
- **Browser cleanup.** The Chromium process is closed after each scrape and killed on exit or interrupt.

```mermaid
flowchart TD
    C[Claude] -->|MCP over stdio| S[server.js]
    S --> SE[search.js]
    S --> SC[scrape.js]
    S --> M[map.js]
    SE -->|primary| X[SearXNG]
    SE -->|fallback| D[ddg.js: DuckDuckGo]
    SC --> G[ssrf.js: URL guard]
    M --> G
    SC --> B[Playwright Chromium]
    B --> MD[markdown.js: Readability + Turndown]
    S --> L[usagelog.js]
```

`server.js` only wires up MCP. Search, scrape and map are separate modules that receive the network, browser and logger as arguments, so tests run without a network or a real browser.

## Configuration

Everything is optional. To change a setting, copy `config.example.json` to `config.json` in the repo root (it is git-ignored) and edit it. `config.example.json` already holds the defaults, so there are no placeholders to replace. Any key you leave out keeps its default:

```json
{
  "searxng_url": null,
  "timeouts": { "scrape_ms": 30000, "search_ms": 10000 },
  "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) web-data-server/0.1",
  "max_markdown_chars": 80000
}
```

The values above are the defaults. To use your own SearXNG (recommended for reliable search), set `"searxng_url": "http://localhost:8888"`. A `docker-compose.yml` and `searxng-settings.yml` are included. Replace the placeholder `secret_key` in `searxng-settings.yml` (the file shows how), then run `docker compose up -d`. The compose file publishes SearXNG on `127.0.0.1:8888` only, so it is not open to your network. On 2026-12-02 this was tested by running `docker compose up -d` from this repo, then calling the `search` tool through the MCP SDK client with `searxng_url` set: it returned results with `source: searxng`.

Set the `WEB_DATA_LOG_DIR` environment variable to move the usage log.

## Tests

```
npm test
```

Result on 2026-12-02 (Node 24.15.0, Windows 11): **170 passing, 0 failing**, about 5 seconds, no network needed. They use saved HTML fixtures and fake browsers and cover the SSRF guard (including DNS lookups with a fake resolver), redirects, WebSockets, search fallback, markdown extraction, scrape errors, map, config and the MCP wiring. `npm audit` reported 0 known vulnerabilities in the locked dependencies on 2026-12-02 (that changes over time, so run it yourself).

`npm run test:smoke` runs live network tests. Set the environment variable `SMOKE=1` first. They were not run for this README, and they can fail if DuckDuckGo rate-limits you.

The test fixture `tests/fixtures/article.html` is a saved copy of the Wikipedia article "Markdown" (CC BY-SA 4.0). The DuckDuckGo fixtures are saved result pages.

## Limitations

- **The DuckDuckGo fallback is best effort.** It reads DuckDuckGo's web pages, which can change, and DuckDuckGo can rate-limit or block you. In a test on 2026-12-02 from one network it was rate-limited (HTTP 202) and `search` returned an error. Search worked with SearXNG, so SearXNG is the recommended setup. `scrape` and `map` do not need either.
- **DNS rebinding is not fully stopped.** The guard looks a name up and checks every address, but the connection (and the browser) looks the name up again by itself, and the connection is not pinned to the address that was checked. A DNS server that answers differently the second time could still point the request at a private address.
- **Redirects in `scrape` are checked in two layers.** A plain HTTP request finds and checks the redirect chain before the browser loads the page, and every browser request and WebSocket is checked by URL before it is sent. If a server redirects the browser differently from that plain request, or an image or script on the page redirects, a hop can be requested before it is checked. The final page URL is still checked after loading.
- **No `robots.txt` check before scraping.** `map` reads `robots.txt` only to find sitemaps. You are responsible for respecting a site's terms.
- **One scrape at a time, with a fresh browser each call.** Simple and safe, but slow under load. No proxies, no CAPTCHA handling, no crawling of a whole site.
- **`map` limits.** It skips gzip-compressed sitemaps and reads at most 5 child sitemaps. The link fallback only sees the page you gave it.
- **Tested on Windows only.** The extra process-kill step uses `taskkill`. On macOS and Linux that step does nothing, and those systems are untested.
- **No continuous integration yet.** Tests are run by hand.

## Roadmap

These are ideas, not promises.

1. Pin each connection to the address that was checked, to close the DNS-rebinding gap.
2. Test on Linux and macOS and replace the Windows-only kill step.
3. Reuse one browser across scrapes, and allow more than one at a time.

## Contributing

Issues and pull requests are welcome. Please run `npm test` first. This is a one-person project, so replies may be slow.

## License

[MIT](LICENSE).