# Fantoma

> Fantoma is an open-source MCP server for browser automation. Stealth browser MCP that reads pages through the accessibility tree for small models. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted, Linux, macOS
- **Repository:** https://github.com/huzy85/fantoma
- **MCP Registry name:** io.github.Huzy85/fantoma
- **Categories:** [browser automation](https://ai-powered.com/categories/browser-automation)
- **Listing updated:** 2026-11-18

## About

Fantoma sees a page the way a screen reader does: as structured text, not screenshots. The README says a step costs about 500 tokens against 1,000 to 5,000 for a screenshot, which is what makes a small local model practical. It reports results from a 31-site run where a 35B local model scored 30 of 31 on reading, and is frank that multi-step interaction on small models is weaker.

Much of the work is done by code rather than a model: reading a URL as Markdown with hidden text removed, filling logins, searching, selecting options and adding items to a cart, with checks after each step. Camoufox (Firefox) is the default browser and Patchright (Chromium) is optional. Page text is fenced and domain allow and block lists are available as guards against instructions embedded in pages.

Five MCP tools run a built-in browser with `pip install "fantoma[mcp]"`. Two of them need an OpenAI-compatible LLM such as Ollama. It needs Python 3.10+ on Linux or macOS.

## Features

- **Accessibility-tree reading:** Pages as compact structured text, about 500 tokens a step.
- **Model-free reading and login:** fantoma_read and fantoma_login need no LLM.
- **Local model support:** Works with Ollama, llama.cpp, vLLM or a cloud API.
- **Page-injection guards:** Hidden-text removal, fenced page text and domain lists.
- **Block detection:** Reports bot challenges and login walls.
- **Skill file:** Includes an Agent Skills file for coding agents.

## Good for

- Read a page as Markdown without calling a model
- Log in to a site and carry the session into later reads
- Extract structured data from a page against a schema
- Run a short browsing task on a local model
- Drive a browser from your own agent loop

## Install

### Claude Code (Terminal)

```sh
claude mcp add fantoma -- uvx fantoma
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "fantoma": {
      "command": "uvx",
      "args": [
        "fantoma"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "fantoma": {
      "command": "uvx",
      "args": [
        "fantoma"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "fantoma": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "fantoma"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "fantoma": {
      "command": "uvx",
      "args": [
        "fantoma"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "fantoma": {
      "command": "uvx",
      "args": [
        "fantoma"
      ]
    }
  }
}
```

## Tools

- `fantoma_read`: Open a URL and return clean Markdown and links, flagging bot checks or login walls; no LLM.
- `fantoma_login`: Fill and submit a login form with code alone.
- `fantoma_extract`: Open a page and extract data, optionally as JSON matching a schema.
- `fantoma_run`: Run a plain-English browsing task to completion.
- `fantoma_health`: Report mode and whether an LLM and browsers are reachable.

## FAQ

### Which tools need an LLM?

fantoma_extract and fantoma_run. Read, login and health do not.

### What do I need to run it?

Python 3.10 or newer on Linux or macOS; Windows via WSL.

### How well do small models handle interaction?

The README says a local 35B model finished 1 of 6 login and form flows in one test; later versions handle common steps in code.

### How do I add it to Claude Code?

pip install "fantoma[mcp]", then claude mcp add fantoma -- fantoma-mcp.

### Is Fantoma free?

Yes. Fantoma is open source, so you can use and self-host it for free.

### How do I add Fantoma to Claude Code?

Run this command in your terminal: claude mcp add fantoma -- uvx fantoma

### What are the best alternatives to Fantoma?

The closest alternatives to Fantoma are Browser Use, Scrapling MCP Server, Chrome DevTools MCP, Oya Browser and playwright_mcp.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Browser Use](https://ai-powered.com/mcp/browser-use): Browser Use is a freemium MCP server for browser automation.
- [Scrapling MCP Server](https://ai-powered.com/mcp/scrapling-mcp-server): Scrapling MCP Server is an open-source MCP server for web search and scraping.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Oya Browser](https://ai-powered.com/mcp/oya-browser): Oya Browser is a freemium MCP server for browser automation.
- [playwright_mcp](https://ai-powered.com/mcp/playwright-mcp-3): playwright_mcp is an open-source MCP server for browser automation.
- [browsentic](https://ai-powered.com/mcp/browsentic-2): browsentic is an open-source MCP server for browser automation.
- [Turbo-Browser-MCP](https://ai-powered.com/mcp/turbo-browser-mcp): Turbo-Browser-MCP is an open-source MCP server for browser automation.
- [Mantis](https://ai-powered.com/mcp/mantis-2): Mantis is an open-source MCP server for browser automation.

---
Source: https://ai-powered.com/mcp/fantoma
