browser_file_upload
Upload files to web applications through automated browser sessions managed by a dynamic pool system.
Instructions
Upload files
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | No |
Implementation Reference
- index.js:452-458 (registration)Registration of the 'browser_file_upload' tool in the MCP server. It uses proxyToolCall to delegate the execution to a browser instance.
server.tool('browser_file_upload', 'Upload files', { paths: z.array(z.string()).optional() }, async (args) => { const check = requireActivePage(); if (check) return check; return proxyToolCall('browser_file_upload', args); }); - index.js:209-225 (helper)The helper function responsible for proxying the tool call to the active browser instance via the MCP client.
async function proxyToolCall(toolName, args) { log(`[proxyToolCall] ${toolName} with args: ${JSON.stringify(args)}`); const { client } = await getOrCreateInstance(); log(`[proxyToolCall] got client for port ${assignedPort}`); // Update last used if (assignedPort && instances.has(assignedPort)) { instances.get(assignedPort).lastUsed = Date.now(); } try { log(`[proxyToolCall] Calling client.callTool...`); const result = await client.callTool({ name: toolName, arguments: args || {} }); log(`[proxyToolCall] Result type: ${typeof result}`); log(`[proxyToolCall] Result: ${JSON.stringify(result).slice(0, 500)}`); // The SDK returns { content: [...], isError?: boolean }