
Product
Socket Now Protects the Firefox Extension Ecosystem
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.
@mtop-devtools/cloud-client
Advanced tools
Cloud client SDK for Mtop DevTools — communicate with local browser via cloud server
云端客户端 SDK,用于在云端环境中调用本地浏览器能力。
npm install @mtop-devtools/cloud-client
# 或
pnpm add @mtop-devtools/cloud-client
import { invoke } from '@mtop-devtools/cloud-client';
// 设置环境变量
process.env.MTOP_DEVTOOLS_SERVER_URL = 'ws://your-server.com/ws?token=xxx';
// 调用浏览器能力
const requests = await invoke('get_requests', { count: 5 });
console.log(requests);
// 获取截图
const screenshot = await invoke('get_screenshot', {});
import { CloudClient } from '@mtop-devtools/cloud-client';
const client = new CloudClient({
serverUrl: 'wss://your-server.com/ws?token=xxx',
connectTimeoutSec: 30,
requestTimeoutSec: 60,
});
// 一次性使用
try {
const logs = await client.invoke('get_logs', { limit: 10 });
console.log(logs);
} finally {
client.disconnect();
}
// 长连接复用
await client.invoke('tab_open', { url: 'https://example.com' });
await client.invoke('page_click', { selector: 'button' });
await client.invoke('get_screenshot', {});
client.disconnect();
mtop-devtools-cloud <action> [options]
示例:
# 获取请求
mtop-devtools get_requests --payload '{"count": 5}'
# 获取截图并保存
mtop-devtools get_screenshot --output screenshot.png
# 使用自定义服务器
mtop-devtools get_logs --server "ws://localhost:8080/ws?token=xxx" --payload '{"limit": 10}'
环境变量:
MTOP_DEVTOOLS_SERVER_URL - WebSocket Server 地址(包含 token)与本地 @mtop-devtools/client 完全一致,包括:
get_requests - 获取网络请求get_logs - 获取控制台日志get_events - 获取埋点事件get_api_schema - 获取 API Schemaset_mock - 设置 Mockget_mocks - 获取 Mock 列表add_rule - 添加请求规则proxy_request - 代理 HTTP 请求tab_open / tab_close / tab_list - 标签页管理page_click / page_type / page_scroll / page_press - 页面交互page_eval / page_navigate / page_wait - 页面控制page_upload - 文件上传get_screenshot - 获取截图get_selected_element - 获取选中元素page_snapshot - 获取页面快照详细参数说明请参考 SKILL.md
云端 Agent
↓
@mtop-devtools/cloud-client (本进程)
↓ (WebSocket)
@mtop-devtools/cloud-server
↓ (WebSocket)
@mtop-devtools/cloud-connector (本地)
↓ (Unix Socket)
@mtop-devtools/native-host
↓
Chrome Extension / CDP
try {
const result = await client.invoke('get_requests', { count: 5 });
} catch (error) {
if (error.message.includes('Connection timeout')) {
// 连接超时
} else if (error.message.includes('Connection closed')) {
// 连接断开
} else if (error.message.includes('Request timeout')) {
// 请求超时
} else {
// 其他错误
}
}
@mtop-devtools/cloud-connectorCloudClient 实例,避免频繁连接disconnect() 释放资源FAQs
Cloud client SDK for Mtop DevTools — communicate with local browser via cloud server
The npm package @mtop-devtools/cloud-client receives a total of 42 weekly downloads. As such, @mtop-devtools/cloud-client popularity was classified as not popular.
We found that @mtop-devtools/cloud-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.

Research
/Security News
Socket uncovered 77 linked Firefox extensions, including 40 that steal wallet secrets or credentials and 37 deceptive sports-score shells.