Skip to content

Commit 998d27b

Browse files
b (#162)
* init browser * Bump firecrawl and update session API Upgrade @mendable/firecrawl-js to 4.13.0-beta.3 and update the session API: rename TTL parameters (ttlTotal -> ttl, ttlWithoutActivity -> activityTtl), adjust documentation and zod schemas/types accordingly, and change the execute-language options by replacing 'js' with 'node' and adding 'bash' (including examples and types). * Add npm tag logic; update browser execute docs CI: Change publish workflow to run on pushes to main when package.json changes and keep manual dispatch. Add a step to determine npm tag (beta if version contains "beta", otherwise latest) and pass that tag to pnpm publish. Only run MCP publisher install/login/publish steps when the tag is "latest" to avoid publishing prereleases to the MCP registry. Code: Update firecrawl_browser_execute docs and parameter ordering in src/index.ts. The description now recommends using bash agent-browser commands by default (with examples and command reference), provides a Python example for Playwright scripting, and adjusts the language enum/default ordering accordingly. These docs clarify usage and preferred workflows for browser automation. * revert beta release ci back * update readme * Update package.json --------- Co-authored-by: Nicolas <20311743+nickscamara@users.noreply.github.com>
1 parent 0159dda commit 998d27b

File tree

4 files changed

+297
-14
lines changed

4 files changed

+297
-14
lines changed

README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ A Model Context Protocol (MCP) server implementation that integrates with [Firec
1717
- Web scraping, crawling, and discovery
1818
- Search and content extraction
1919
- Deep research and batch scraping
20+
- Cloud browser sessions with agent-browser automation
2021
- Automatic retries and rate limiting
2122
- Cloud and self-hosted support
2223
- SSE support
@@ -316,6 +317,7 @@ Use this guide to select the right tool for your task:
316317
- **If you want to search the web for info:** use **search**
317318
- **If you need complex research across multiple unknown sources:** use **agent**
318319
- **If you want to analyze a whole site or section:** use **crawl** (with limits!)
320+
- **If you need interactive browser automation** (click, type, navigate): use **browser**
319321

320322
### Quick Reference Table
321323

@@ -327,6 +329,7 @@ Use this guide to select the right tool for your task:
327329
| crawl | Multi-page extraction (with limits) | markdown/html[] |
328330
| search | Web search for info | results[] |
329331
| agent | Complex multi-source research | JSON (structured data) |
332+
| browser | Interactive multi-step automation | Session with live browser |
330333

331334
### Format Selection Guide
332335

@@ -813,6 +816,105 @@ Check the status of an agent job and retrieve results when complete. Use this to
813816
- `completed`: Research finished - response includes the extracted data
814817
- `failed`: An error occurred
815818

819+
### 11. Browser Create (`firecrawl_browser_create`)
820+
821+
Create a persistent cloud browser session for interactive automation.
822+
823+
**Best for:**
824+
825+
- Multi-step browser automation (navigate, click, fill forms, extract data)
826+
- Interactive workflows that require maintaining state across actions
827+
- Testing and debugging web pages in a live browser
828+
829+
**Arguments:**
830+
831+
- `ttl`: Total session lifetime in seconds (30-3600, optional)
832+
- `activityTtl`: Idle timeout in seconds (10-3600, optional)
833+
- `streamWebView`: Whether to enable live view streaming (optional)
834+
835+
**Usage Example:**
836+
837+
```json
838+
{
839+
"name": "firecrawl_browser_create",
840+
"arguments": {
841+
"ttl": 600
842+
}
843+
}
844+
```
845+
846+
**Returns:**
847+
848+
- Session ID, CDP URL, and live view URL
849+
850+
### 12. Browser Execute (`firecrawl_browser_execute`)
851+
852+
Execute code in a browser session. Supports agent-browser commands (bash), Python, or JavaScript.
853+
854+
**Recommended: Use bash with agent-browser commands** (pre-installed in every sandbox):
855+
856+
```json
857+
{
858+
"name": "firecrawl_browser_execute",
859+
"arguments": {
860+
"sessionId": "session-id-here",
861+
"code": "agent-browser open https://example.com",
862+
"language": "bash"
863+
}
864+
}
865+
```
866+
867+
**Common agent-browser commands:**
868+
869+
| Command | Description |
870+
|---------|-------------|
871+
| `agent-browser open <url>` | Navigate to URL |
872+
| `agent-browser snapshot` | Accessibility tree with clickable refs |
873+
| `agent-browser click @e5` | Click element by ref from snapshot |
874+
| `agent-browser type @e3 "text"` | Type into element |
875+
| `agent-browser get title` | Get page title |
876+
| `agent-browser screenshot` | Take screenshot |
877+
| `agent-browser --help` | Full command reference |
878+
879+
**For Playwright scripting, use Python:**
880+
881+
```json
882+
{
883+
"name": "firecrawl_browser_execute",
884+
"arguments": {
885+
"sessionId": "session-id-here",
886+
"code": "await page.goto('https://example.com')\ntitle = await page.title()\nprint(title)",
887+
"language": "python"
888+
}
889+
}
890+
```
891+
892+
### 13. Browser List (`firecrawl_browser_list`)
893+
894+
List browser sessions, optionally filtered by status.
895+
896+
```json
897+
{
898+
"name": "firecrawl_browser_list",
899+
"arguments": {
900+
"status": "active"
901+
}
902+
}
903+
```
904+
905+
### 14. Browser Delete (`firecrawl_browser_delete`)
906+
907+
Destroy a browser session.
908+
909+
```json
910+
{
911+
"name": "firecrawl_browser_delete",
912+
"arguments": {
913+
"sessionId": "session-id-here"
914+
}
915+
}
916+
```
917+
816918
## Logging System
817919

818920
The server includes comprehensive logging:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"license": "MIT",
3030
"dependencies": {
31-
"@mendable/firecrawl-js": "^4.9.3",
31+
"@mendable/firecrawl-js": "4.13.0",
3232
"dotenv": "^17.2.2",
3333
"firecrawl-fastmcp": "^1.0.4",
3434
"typescript": "^5.9.2",

pnpm-lock.yaml

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)