unblock
Bypass bot detection and anti-scraping mechanisms to extract web content, capture screenshots, and automate browser tasks with enhanced stealth and ad-blocking options.
Instructions
Bypass bot detection and anti-scraping measures
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockAds | No | ||
| content | No | ||
| headers | No | ||
| screenshot | No | ||
| stealth | No | ||
| url | Yes |
Implementation Reference
- src/client.ts:198-212 (handler)Core handler implementation in BrowserlessClient that proxies the unblock request via HTTP POST to the Browserless server's /unblock endpoint./** * Bypass bot detection and anti-scraping measures */ async unblock(request: UnblockRequest): Promise<BrowserlessResponse<UnblockResponse>> { try { const response: AxiosResponse<UnblockResponse> = await this.httpClient.post('/unblock', request); return { success: true, data: response.data, }; } catch (error) { return this.handleError(error); } }
- src/index.ts:458-488 (handler)MCP server dispatch handler for the 'unblock' tool, which invokes the client.unblock method and formats the response as MCP content (text and potential binary screenshot).case 'unblock': { if (!args) throw new Error('Arguments are required'); const result = await this.client!.unblock(args as any); if (result.success && result.data) { const content = [ { type: 'text', text: 'Unblock operation completed successfully.', }, ]; if (result.data.content) { content.push({ type: 'text', text: result.data.content, }); } if (result.data.screenshot) { content.push({ type: 'binary', mimeType: 'image/png', data: result.data.screenshot.toString('base64'), } as any); } return { content }; } else { throw new Error(result.error || 'Failed to unblock'); } }
- src/index.ts:190-205 (registration)Registration of the 'unblock' tool in the MCP ListTools response, including name, description, and input schema.{ name: 'unblock', description: 'Bypass bot detection and anti-scraping measures', inputSchema: { type: 'object', properties: { url: { type: 'string' }, content: { type: 'boolean' }, screenshot: { type: 'boolean' }, stealth: { type: 'boolean' }, blockAds: { type: 'boolean' }, headers: { type: 'object' }, }, required: ['url'], }, },
- src/types.ts:210-223 (schema)Zod schema and TypeScript type definition for UnblockRequest input validation.// Unblock request schema export const UnblockRequestSchema = z.object({ url: z.string(), browserWSEndpoint: z.boolean().optional(), cookies: z.boolean().optional(), content: z.boolean().optional(), screenshot: z.boolean().optional(), ttl: z.number().optional(), stealth: z.boolean().optional(), blockAds: z.boolean().optional(), headers: z.record(z.string()).optional(), }); export type UnblockRequest = z.infer<typeof UnblockRequestSchema>;
- src/types.ts:298-303 (schema)TypeScript interface for UnblockResponse output type.export interface UnblockResponse { content?: string; screenshot?: Buffer; cookies?: Cookie[]; browserWSEndpoint?: string; }