WebLLMRelay

WebLLMRelay

Enables AI agents to access web-based large language models through a unified MCP interface, reusing existing web logins to perform text conversations and image generation without API keys or fees.

Category
Visit Server

README

WebLLMRelay — 网页大模型分发 MCP

给智能体接入网页大模型:通过统一 MCP 接口,复用网页登录态,调用各平台大模型的对话与生图能力——不需要 API key、不产生 API 费用。如果说网页搜索是让智能体"查资料",这里则是让智能体"问专家"——把任务分发给擅长它的网页大模型。

快速开始

环境要求:**Python 3.10 + **

  1. 安装依赖

    python -m pip install -r requirements.txt
    
  2. 下载内置浏览器(必须下载到项目 browsers/ 目录,应用只认这个位置)

    set PLAYWRIGHT_BROWSERS_PATH=D:\path\to\WebLLMRelay\browsers
    python -m playwright install chromium
    

    ⚠️ 不设置 PLAYWRIGHT_BROWSERS_PATH 会把浏览器下载到系统缓存,启动时报「Executable doesn't exist」。国内网络可加镜像:set PLAYWRIGHT_DOWNLOAD_HOST=https://npmmirror.com/mirrors/playwright/

  3. 启动服务:start_webllmrelay.bat(已运行会自动打开页面;未运行会启动服务并打开页面),或 python -m webllmrelay.webui_server --port 8787

  4. 登录平台:在 WebUI 中对目标平台点「网页登陆」→ 内置浏览器窗口登录 → 关闭窗口,登录态自动检测并保存

  5. 验证平台:点「测试对话」验证文本问答,点「测试生图」验证生图(成功后自动标记该平台为已验证)

  6. 接入 MCP 客户端:客户端连 http://127.0.0.1:8787/mcp(HTTP),或填 command 启动(stdio)。具体配置见 WebUI 页面的「MCP 客户端接入」,点「复制」即用。

MCP 工具

接入后三个工具自动暴露给智能体。一般无需手动调用——直接对助手说人话,它会自动选择工具;想强制用工具,消息前加 >;想禁用工具,加 !。

用户:「用豆包查一下:Python 3.13 的新特性有哪些?」 助手:调用 ask_web_llm(platform="doubao", prompt="Python 3.13 的新特性有哪些?")

ask_web_llm — 文本问答 / 任务分发

参数 说明
platform doubao / deepseek / kimi / qwen / zhipu / yuanbao
prompt 问题或任务(提问、写作、总结、翻译、写代码等)
conversation_id 可选;留空 = 新会话,传入 = 续聊(保留上下文)

返回 {"answer", "conversation_id"}。

ask_web_llm_image — 生图

参数 说明
platform doubao / qwen / zhipu / yuanbao 支持生图(deepseek / kimi 暂不支持)
prompt 图片描述提示词
conversation_id 可选;传了可基于原图续调

返回 {"images": [{"url", "path"}], "conversation_id"}:

  • url:本机服务提供的图片地址,可直接下载 / 展示 / 打开;
  • path:图片在本地磁盘的绝对路径,智能体可本地直接读取。

图片由 MCP 在浏览器会话内自动下载到 generated_images/(原图防盗链已在内部处理),缓存超过 100 张自动清理最旧的。

list_web_llms — 列出平台

无参数,返回 [{"platform", "name", "supports_image", "verified"}],platform 即提问工具的取值。

架构

webllmrelay/
├── config.py        # ProviderSpec(每平台知识)+ 平台/登录态持久化
├── browser.py       # BrowserManager:会话式浏览器生命周期、死浏览器自动恢复
├── lock.py          # 持久化浏览器 profile 互斥锁
├── adapters.py      # PlatformAdapter 接口 + CssAdapter 默认实现 + 注册表
├── providers.py     # ask_web_llm / ask_web_llm_image / list_web_llms
├── mcp.py           # MCP server 定义与工具注册
├── activity_log.py  # 活动日志(登录 / 测试 / 调用)
├── login_worker.py  # 登录窗口子进程
├── probe.py         # 平台适配诊断 CLI(接入新平台用)
├── webui.py         # FastAPI:平台管理 / 测试 / 日志
├── webui_server.py  # WebUI 启动入口
└── webui_static/    # WebUI 前端页面

需求边界

  • 单模型调用:智能体自己决定问哪个模型,不做"多模型对比"。
  • 回答格式:网页返回啥就是啥,不做格式化处理。
  • 登录:由用户手动完成(WebUI「网页登陆」打开浏览器窗口);登录状态基于每平台登录指示元素真实检测,在登录窗口关闭后自动检测、卡片「检测」按钮手动检测。
  • 浏览器:Release版本默认内置 Chromium(随应用打包,免系统依赖),WebUI 设置卡可切换为系统 Edge,两种浏览器的登录数据相互独立。默认可见运行,可开启「智能体调用时隐藏浏览器」静默。

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured