HTTP桥接服务

GoLogin Puppet MCP Bridge是一个HTTP桥接服务,用于将GoLogin Puppet MCP服务器暴露给远程Flowise实例,实现远程调用浏览器自动化工具。

  • by blademarketing
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 blademarketing/gologin-puppet-mcp-client

使用说明

GoLogin木偶MCP桥

用于将GoLogin Puppet MCP服务器暴露给远程Flowise实例的HTTP桥。

建筑

┌─────────────────┐
│ Flowise (Docker)│ <- Remote server
│  on Server B    │
└────────┬────────┘
         │ HTTP
         ↓
┌─────────────────┐
│  HTTP Bridge    │ <- This server (94.237.49.107:3001)
│   (Express)     │
└────────┬────────┘
         │ stdio
         ↓
┌─────────────────┐
│  GoLogin Puppet │ <- Local MCP server
│   MCP Server    │
└─────────────────┘

快速开始

1.安装依赖项

cd /tools/dev/gologin-puppet-mcp-bridge
npm install

2.启动网桥服务器

npm start

或者在后台运行:

nohup npm start > bridge.log 2>&1 &

或者使用PM2:

pm2 start server.js --name gologin-mcp-bridge
pm2 save

3.测试桥梁

# Check health
curl http://localhost:3001/health

# List available tools
curl http://localhost:3001/tools

# Call a tool (example)
curl -X POST http://localhost:3001/tools/call \
  -H "Content-Type: application/json" \
  -d '{
    "name": "list_sessions",
    "arguments": {}
  }'

与Flowise一起使用

选项1:直接HTTP API(自定义集成)

在Flowise流中,使用自定义工具或API节点调用:

列出工具:

GET http://94.237.49.107:3001/tools

呼叫工具:

POST http://94.237.49.107:3001/tools/call
Body: {
  "name": "start_browser",
  "arguments": {
    "apiKey": "your-api-key",
    "profileId": "your-profile-id"
  }
}

选项2:MCP客户端包装器(推荐)

如果您的Flowise服务器可以通过HTTP访问此计算机,则可以使用附带的客户端包装器。

在Flowise服务器上,在CustomMCP节点中创建此配置:

{
  "command": "npx",
  "args": ["-y", "mcp-remote-proxy@latest"],
  "env": {
    "BRIDGE_URL": "http://94.237.49.107:3001"
  }
}

或者,如果你想在flowise服务器上安装flowise-client.js:

# On Flowise server
curl -o /tmp/flowise-mcp-client.js http://94.237.49.107:3001/client.js

# Then in Flowise CustomMCP:
{
  "command": "node",
  "args": ["/tmp/flowise-mcp-client.js"],
  "env": {
    "BRIDGE_URL": "http://94.237.49.107:3001"
  }
}

选项3:提供客户端脚本

将此端点添加到server.js以提供客户端脚本:

app.get('/client.js', (req, res) => {
    res.sendFile(__dirname + '/flowise-client.js');
});

然后Flowise可以下载并执行它。

配置

环境变量

  • PORT -网桥服务器端口(默认:3001)
  • BRIDGE_URL -对于客户端脚本(默认值:http://94.237.49.107:3001)

防火墙

确保端口3001可从Flowise服务器访问:

# Check if port is open
sudo ufw allow 3001/tcp

# Or with iptables
sudo iptables -A INPUT -p tcp --dport 3001 -j ACCEPT

Flowise中的工作流示例

  1. 添加自定义MCP节点 具有桥接配置
  2. 选择工具 你想要的(启动浏览器、导航、截图等)
  3. 连接到代理 (ReAct代理、OpenAI功能代理等)
  4. 添加聊天模式 (ChatOpenAI、ChatAnthropic等)
  5. 带提示的测试:
Use the GoLogin browser tools to:
1. Start a browser session with my credentials
2. Navigate to https://example.com
3. Get the page title
4. Take a screenshot
5. Close the browser

监控

# View logs
tail -f bridge.log

# Or with PM2
pm2 logs gologin-mcp-bridge

# Check status
pm2 status

故障排除

大桥无法启动

  • 检查端口3001是否已在使用中: lsof -i :3001
  • 检查MCP服务器路径是否正确
  • 检查日志是否有错误

Flowise无法连接

  • 使用Flowise服务器的curl进行测试: curl http://94.237.49.107:3001/health
  • 检查防火墙规则
  • 检查桥架是否运行: pm2 status

工具未加载

  • 检查桥梁日志: pm2 logs gologin-mcp-bridge
  • 测试工具端点: curl http://localhost:3001/tools
  • 重新启动网桥: pm2 restart gologin-mcp-bridge

安全说明

⚠️ 此网桥没有身份验证!

对于生产用途,添加:

  • API密钥验证
  • 速率限制
  • IP白名单
  • HTTPS/TLS

基本身份验证示例:

app.use((req, res, next) => {
    const apiKey = req.headers['x-api-key'];
    if (apiKey !== process.env.API_KEY) {
        return res.status(401).json({ error: 'Unauthorized' });
    }
    next();
});