๐ฆ Camoufox MCP
Anti-detection browser automation for AI agents
MCP server for browser automation using Camoufox - an anti-detection Firefox browser.
Installation
npx camoufox-mcp
Claude Desktop Configuration
Add to claude_desktop_config.json:
Basic:
{
"mcpServers": {
"camoufox": {
"command": "npx",
"args": ["camoufox-mcp"]
}
}
}
With Proxy (via env vars):
{
"mcpServers": {
"camoufox": {
"command": "npx",
"args": ["camoufox-mcp"],
"env": {
"PROXY_SERVER": "http://1.2.3.4:8080",
"PROXY_USER": "username",
"PROXY_PASS": "password"
}
}
}
}
Then in ~/.config/camoufox-mcp/settings.json:
{
"proxy": {
"enabled": true,
"server": "${PROXY_SERVER}",
"username": "${PROXY_USER}",
"password": "${PROXY_PASS}",
"geoip": true
}
}
Why Camoufox MCP?
Tools
Session Management
Sessions provide isolated browser contexts โ each session has its own cookies, localStorage, and cache. Use sessions to run multiple authenticated profiles simultaneously.
Page Management
Navigation & Interaction
Inspection
Context Injection
Monitoring
Utility
Sessions
Sessions enable running multiple authenticated profiles in parallel. Each session is an isolated browser context with its own cookies and localStorage.
Browser (single Camoufox instance)
โโโ Session "github" (cookies from github.json)
โ โโโ Page: github.com
โ โโโ Page: github.com/repo
โโโ Session "linkedin" (cookies from linkedin.json)
โ โโโ Page: linkedin.com/feed
โโโ Session "default" (no pre-loaded state)
โโโ Page: example.com
Usage Examples
Create a session with pre-loaded authentication:
create_sessionwithcontextPath: "github-cookies.json"โ returns asessionIdnew_pagewithurl: "https://github.com"and thesessionIdโ opens GitHub already logged in
Run two accounts simultaneously:
create_sessionwithcontextPath: "account1.json"โ session Acreate_sessionwithcontextPath: "account2.json"โ session Bnew_pagein session A โ logged in as account 1new_pagein session B โ logged in as account 2
Save session state for later:
- Log in manually in a session
save_sessionwithoutputPath: "my-session.json"โ exports cookies + localStorage- Next time,
create_sessionwithcontextPath: "my-session.json"โ restored
Context File Format
Context files use Playwright's storageState format:
{
"cookies": [
{
"name": "session_id",
"value": "abc123",
"domain": ".example.com",
"path": "/",
"expires": 1735689600,
"httpOnly": true,
"secure": true,
"sameSite": "Lax"
}
],
"origins": [
{
"origin": "https://example.com",
"localStorage": [
{ "name": "token", "value": "xyz789" }
]
}
]
}
Registering Context Files in Settings
Add context file paths to settings.json to make them discoverable via list_context_files. Sessions are created lazily on demand โ no memory is used until the agent calls create_session:
{
"contextPaths": [
"/path/to/github-cookies.json",
"/path/to/linkedin-cookies.json"
]
}
The agent can then call list_context_files to see what's available, and create_session with the desired contextPath to load it when needed.
Settings
Create ~/.config/camoufox-mcp/settings.json:
{
"browser": {
"headless": false,
"viewport": [1280, 1080],
"timeout": 30000,
"humanize": 0.5
},
"proxy": {
"enabled": true,
"server": "http://proxy.example.com:8080",
"username": "user",
"password": "pass",
"geoip": true
},
"contextPaths": []
}
Proxy Examples
HTTP/HTTPS Proxy:
{ "proxy": { "enabled": true, "server": "http://1.2.3.4:8080" } }
SOCKS5 Proxy:
{ "proxy": { "enabled": true, "server": "socks5://1.2.3.4:1080" } }
With Authentication (using env vars):
{
"proxy": {
"enabled": true,
"server": "${PROXY_SERVER}",
"username": "${PROXY_USER}",
"password": "${PROXY_PASS}",
"geoip": true
}
}
geoip: trueauto-adjusts browser timezone/locale based on proxy IP location.
See More
- Camoufox - The anti-detection Firefox browser
- camoufox-js - JavaScript/TypeScript bindings
License
MIT