Skip to content

Commit d9cc342

Browse files
authored
feat(browser-rendering): add quick-action tools for REST parity (#407)
* feat(browser-rendering): add quick-action tools for REST parity Adds MCP tools wrapping the remaining Browser Rendering REST quick actions so MCP-compatible agents no longer need to drop to raw HTTP: - get_url_pdf - get_url_snapshot - scrape_url_elements - get_url_json - get_url_links - start_crawl / get_crawl_result / cancel_crawl - list_browser_sessions / kill_browser_session BRAPI-1319, BRAPI-1320, BRAPI-1321 / RM-29118 * fix(browser-rendering): handle bare-array response from list_browser_sessions The /devtools/session endpoint returns a bare JSON array rather than the usual { success, result } envelope. Verified against the live REST API.
1 parent cb01861 commit d9cc342

3 files changed

Lines changed: 460 additions & 5 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'cloudflare-browser-mcp-server': minor
3+
---
4+
5+
Add MCP tools for the remaining Browser Rendering REST quick actions, bringing the Browser Run MCP server to parity with the REST API: `get_url_pdf`, `get_url_snapshot`, `scrape_url_elements`, `get_url_json`, `get_url_links`, `start_crawl`, `get_crawl_result`, `cancel_crawl`, `list_browser_sessions`, and `kill_browser_session`.

apps/browser-rendering/README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,21 @@ web pages, convert them to markdown, and take screenshots.
1010

1111
Currently available tools:
1212

13-
| **Tool** | **Description** |
14-
| ---------------------- | ---------------------------------------------------------------------------- |
15-
| `get_url_html_content` | Retrieves the HTML content of the specified URL. |
16-
| `get_url_markdown` | Fetches the webpage content and converts it into Markdown format. |
17-
| `get_url_screenshot` | Captures a screenshot of the webpage. Optionally, specify the viewport size. |
13+
| **Tool** | **Description** |
14+
| ----------------------- | ----------------------------------------------------------------------------------- |
15+
| `get_url_html_content` | Retrieves the HTML content of the specified URL. |
16+
| `get_url_markdown` | Fetches the webpage content and converts it into Markdown format. |
17+
| `get_url_screenshot` | Captures a screenshot of the webpage. Optionally, specify the viewport size. |
18+
| `get_url_pdf` | Renders the webpage to a PDF document. |
19+
| `get_url_snapshot` | Returns the page HTML content and a screenshot in a single call. |
20+
| `scrape_url_elements` | Scrapes elements from the page by CSS selector. |
21+
| `get_url_json` | Extracts structured JSON from the page using AI. Supports a prompt and JSON schema. |
22+
| `get_url_links` | Returns the list of links on the page. |
23+
| `start_crawl` | Starts an asynchronous crawl of a website and returns a `job_id`. |
24+
| `get_crawl_result` | Returns the status and records of a crawl job. |
25+
| `cancel_crawl` | Cancels a running crawl job. |
26+
| `list_browser_sessions` | Lists active Browser Rendering sessions for the account. |
27+
| `kill_browser_session` | Closes (kills) a Browser Rendering session by its session ID. |
1828

1929
**Note:** These tools are account-scoped. Single-account credentials (and account-scoped API tokens) are detected automatically. If your credentials can access multiple accounts, pass `account_id` to the tool, or set a `cf-account-id` request header in your MCP client config.
2030

@@ -25,6 +35,11 @@ This MCP server is still a work in progress, and we plan to add more tools in th
2535
- `Get the HTML content of https://example.com.`
2636
- `Convert https://example.com to Markdown.`
2737
- `Take a screenshot of https://example.com.`
38+
- `Render https://example.com to a PDF.`
39+
- `Extract the product name and price from https://example.com as JSON.`
40+
- `List all the links on https://example.com.`
41+
- `Crawl https://example.com two levels deep and give me the results.`
42+
- `List my active browser sessions and kill the oldest one.`
2843

2944
## Access the remote MCP server from any MCP Client
3045

0 commit comments

Comments
 (0)