MCP Server · 19 Tools · Open Source · MIT

Hook into any port.
Expose. Test. Done.

One MCP server that combines Cloudflare Tunnels with Firecrawl. Expose localhost publicly, launch browser sandboxes, deploy autonomous QA agents, all from your AI assistant.

How it works

The full loop, in one conversation

Tell your AI assistant to expose a port. It tunnels it, grabs the URL, launches a browser sandbox, runs an agent, and tears it all down. Zero friction.

1

tunnel_start

Expose a local port. Auto-patches Vite configs.

tunnel_start(port: 5173)
2

Public URL

Cloudflare edge routes traffic. Instant HTTPS.

→ https://abc.trycloudflare.com
3

QA it

Scrape, screenshot, crawl, flow test with JS.

qa_flow_test(url, steps)
4

Browser & Agent

Persistent sessions or autonomous AI agent.

browser_execute(code)
5

tunnel_stop

Tear down. Vite config auto-reverts.

tunnel_stop(label: "app")
AI Assistant / Agent Mode
$ "Tunnel my Vite app on 5173, run a browser session to test login, then extract pricing with the agent"
tunnel_start(port: 5173, label: "app")
Public URL: https://threaded-fathers-explore.trycloudflare.com
Vite detected (PID 12345). Patched vite.config.ts with allowedHosts: true
browser_create(ttl: 300)
Session: abc-123 · Live View: browser.firecrawl.dev/live/abc-123
browser_execute(code: "await page.goto(url); await page.fill('#email', ...)...")
Result: "Dashboard - My App"
qa_agent(prompt: "Find pricing page, extract plan details")
Agent completed. Credits: 12 · {"plans": [{"name": "Free", "price": "$0/mo"}, ...]}
tunnel_stop(label: "app")
Tunnel stopped. Vite config reverted.
Highlights

Browser sandbox, AI agents, Vite auto-detection

Persistent browser sessions, autonomous navigation agents, and zero-config Vite tunneling. Powered by Firecrawl.

Vite Auto-Detection

Tunneling a Vite dev server? Porthook MCP detects it, patches allowedHosts: true into your config, and reverts on stop. No more 403 errors.

tunnel_start(port: 5173)
# Vite detected (PID 12345)
# Patched vite.config.ts
...
tunnel_stop(label: "app")
# Config reverted automatically

Browser Sandbox

Persistent browser sessions with live-view URLs and a pre-initialized Playwright page object. Navigate, fill forms, screenshot. All stateful.

browser_create(ttl: 300)
# Session: abc-123
browser_execute(code: `
await page.goto(url);
await page.fill('#email', ...);
`)
# Result: "Dashboard"

Autonomous Agent

Give it a prompt and optional JSON schema. The agent navigates, clicks, fills forms, and returns structured data autonomously.

qa_agent(
prompt: "Extract pricing",
urls: ["https://..."],
schema: { plans: [...] }
)
# {"plans": [...]}
19 tools

Everything you need, nothing you don't

Tunnel tools powered by cloudflared. QA, browser sandbox, and agent tools powered by Firecrawl. All in one MCP interface.

Tunnel Tools

Powered by cloudflared

9 tools
cloudflared_status Check install status, version, active tunnels
cloudflared_install Install via Homebrew or npm
tunnel_start Expose a port · auto-patches Vite configs
tunnel_stop Stop a running tunnel · reverts Vite
tunnel_stop_all Stop all running tunnels at once
tunnel_list List named tunnels on your CF account
tunnel_create Create a persistent named tunnel
tunnel_run Run a named tunnel (with credentials)
tunnel_delete Delete a named tunnel permanently

QA Tools

Powered by Firecrawl

5 tools
qa_scrape Scrape to markdown · verify content
qa_screenshot Visual QA · layout check · before/after
qa_crawl Crawl site · find broken links, check routes
qa_check HTTP status, title, links. Instant
qa_flow_test Multi-step UI flows with JS · pass/fail

Agent

Autonomous AI

1 tool
qa_agent Navigate, interact, extract structured data

All QA, browser, and agent tools work with any public URL, not just tunnel URLs.

Browser Sandbox

Persistent sessions

4 tools
browser_create Create session, get live-view URL
browser_execute Run code with Playwright page object
browser_list List active browser sessions
browser_close Close session, see credits billed
Get started

Install in under 60 seconds

Drop into any MCP-compatible AI assistant.

Prerequisites

Node.js ≥ 18

Required runtime

cloudflared

Auto-installable via tool

Firecrawl API key

Free tier: 500 credits

Let your AI install it

Paste this into Cursor, Claude Code, or any agent. It will clone, build, and wire up the config automatically.

"Clone https://github.com/kwestradotcom/Porthook_MCP.git, then cd into the repo, run npm install && npm run build inside mcp-servers/cloudflared, and add porthook as an MCP server pointing to the built dist/index.js with my FIRECRAWL_API_KEY env var."

1. Clone the repo

git clone https://github.com/kwestradotcom/Porthook_MCP.git

2. Build the server

cd Porthook_MCP/mcp-servers/cloudflared && npm install && npm run build

3. Add to your MCP config

.cursor/mcp.json

{
  "mcpServers": {
    "porthook": {
      "command": "node",
      "args": ["/path/to/mcp-servers/cloudflared/dist/index.js"],
      "env": { "FIRECRAWL_API_KEY": "fc-..." }
    }
  }
}

4. Restart your editor and try it

"Tunnel my Vite app on port 5173, take a screenshot, and scrape the homepage"

"Open a browser sandbox, go to my staging URL, fill out the signup form, and check that it redirects to the dashboard"

"Run a flow test on the login page: enter test@example.com / password123 and assert the URL ends with /dashboard"

"Crawl my site and find any pages returning 4xx or 5xx errors"

"Use the agent to navigate to the pricing page and extract all plan names, prices, and features as JSON"

Documentation

Quick reference

Everything you need to use Porthook MCP effectively. Each tool is self-documented in the MCP interface. These are the key patterns.

Tunnel Workflow

Expose any local port as a public HTTPS URL. Quick tunnels need no auth. Named tunnels persist across sessions.

# Quick tunnel (no account needed)
tunnel_start(port: 3000, label: "api")
# → https://abc.trycloudflare.com
# When done:
tunnel_stop(label: "api")
# Named tunnel (requires CF login)
tunnel_create(name: "staging")
tunnel_run(name: "staging")

Browser Sandbox Workflow

Create a persistent browser with a Playwright page object. State persists between browser_execute calls. Sessions auto-expire after TTL.

browser_create(ttl: 300)
# → sessionId, liveViewUrl, cdpUrl
browser_execute(session_id: "...", code: `
await page.goto('https://...');
await page.fill('#email', 'test@...');
return await page.title();
`)
# Supports: node, python, bash
browser_close(session_id: "...")

QA Flow Tests

Multi-step browser automation with assertions. Click, type, press keys, execute JavaScript, and check results. Returns PASS/FAIL with evidence.

qa_flow_test(
url: "https://...",
steps: [
{ action: 'click', selector: '#email' },
{ action: 'type', text: 'user@test.com' },
{ action: 'click', selector: 'button' },
{ action: 'js', text: 'return localStorage...' },
],
pass_if: { url_contains: '/dashboard' }
)

Autonomous Agent

Give a natural-language prompt. The agent navigates, clicks, fills forms, and extracts data. Optionally provide a JSON schema for structured output.

qa_agent(
prompt: "Go to the pricing page and
extract all plan names and prices",
urls: ["https://example.com"],
schema: { plans: [{ name, price }] },
max_credits: 50
)
# Polls until done (max 120s)
# → { plans: [...] }

Vite Auto-Detection

When you tunnel_start a port running Vite 6+, Porthook MCP automatically detects the Vite process, finds the config file, and injects allowedHosts: true into the server block. Vite's file watcher picks up the change and restarts automatically. The config is reverted to its original state when the tunnel stops.

Agent Skill Claude Code

Install the Porthook MCP skill to teach your AI assistant decision trees, workflow patterns, and tool chaining sequences for all 19 tools. Includes the /porthook slash command.

FAQ

Frequently asked questions

Do I need a Cloudflare account?
No. Quick tunnels (tunnel_start) work without any account or login. They give you a temporary *.trycloudflare.com URL. Named (persistent) tunnels require cloudflared tunnel login.
Is the Firecrawl API key free?
Firecrawl offers a free tier with 500 credits. A scrape costs 1 credit, a screenshot 1 credit, browser sessions cost based on duration. Get your key at firecrawl.dev. Tunnel tools don't need Firecrawl.
What happens if my tunnel crashes or I quit my editor?
Porthook MCP registers SIGINT/SIGTERM handlers that kill all tunnels, revert Vite configs, and close browser sessions on exit. If the process is killed unexpectedly, cloudflared processes are orphaned (they'll timeout on their own). Browser sessions have TTL and auto-expire.
Why does my Vite tunnel return 403?
Vite 6+ blocks non-localhost Host headers by default. Porthook MCP automatically detects Vite and patches the config. If auto-detection doesn't work (e.g. custom Vite setup), manually add server: { allowedHosts: true } to your Vite config.
What's the difference between browser_execute and qa_flow_test?
browser_execute gives you a persistent browser session with full Playwright control. State persists between calls, you can do multi-step complex workflows, and you get a live-view URL.

qa_flow_test is a one-shot declarative test: define steps (click, type, JS) and assertions (page_contains, url_contains), and it returns PASS/FAIL. Best for automated regression testing.
Which MCP clients are supported?
Any client that implements the Model Context Protocol over stdio: Cursor, Claude Code, VS Code (Copilot), Windsurf, Claude Desktop, and any other MCP-compatible assistant. The server uses standard stdio transport.
Can I use QA tools without a tunnel?
Yes. All QA, browser, and agent tools accept any public URL. You can use them to test staging environments, production sites, or any URL reachable from Firecrawl's servers.

Zero-config tunnels

No Cloudflare account needed for quick tunnels. Instant HTTPS, globally distributed edge.

Clean lifecycle

Tunnels auto-terminate on server exit. No orphaned cloudflared processes littering your system.

AI-native interface

Designed for agent workflows. Natural language to tool call to structured result. No babysitting.

Works with any URL

QA tools are URL-agnostic. Scrape production, staging, or any public endpoint — not just tunnels.

Visual QA built in

Screenshot any URL via Firecrawl. Verify layout, catch regressions, compare before/after.

Open source, MIT

No SaaS overhead. Run it locally, fork it, own it. Free Firecrawl tier covers most workflows.

Kwestra A Kwestra open-source project

Built for teams building with AI

Porthook MCP is one piece of the AI-native dev toolkit we're building at Kwestra. We help engineering teams design, build, and operate AI-powered workflows, from agentic tooling to production automation.

19
MCP tools
3
integrations
MIT
licensed