MCPcopy Index your code
hub / github.com/clark-maybe/mole-extension

github.com/clark-maybe/mole-extension @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,161 symbols 3,068 edges 158 files 114 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MoleClaw Logo

MoleClaw

你的 AI 挖宝助手 — 像鼹鼠一样,在互联网的地下为你挖掘宝藏。

中文 | English

License


提问之后,Mole 会像鼹鼠钻入地下一样,潜入后台默默挖掘——调用工具、搜索网页、解析数据、跨站点采集信息。找到宝藏后,它会重新浮出地面,把结果呈现给你。整个过程悄无声息,不打扰你正在做的事。

特性

  • AI 原生对话 — 悬浮球随时唤起,自然语言交互,流式响应
  • 原位执行 — 在你的真实浏览器中工作,复用已有登录态。无需迁移 Cookie,无需重新登录,已登录的站点直接操作
  • 36+ 内置工具 — 页面操作、CDP 深度控制(10 域)、请求拦截、DOM/CSS/存储操作、导航、截图、网络诊断、人机确认…
  • 工作流录制 — 做一遍教会 Mole。录制你的浏览器操作,AI 自动清洗去噪,生成可复用的标准工作流
  • 站点工作流 — 声明式 JSON 定义,无需写代码即可自动化网站操作
  • LLM 自由选择 — 兼容任何 OpenAI API 格式的服务,数据完全自主可控
  • MCP 协议 — 标准化工具注册与调用,支持动态扩展
  • Agentic Loop — Codex 风格自驱循环,代码管边界,模型管决策
  • 开源免费 — AGPL-3.0 协议,社区驱动

快速开始

git clone https://github.com/clark-maybe/mole-extension.git
cd mole-extension
npm install
npm run build

构建完成后,在 Chrome 中加载 build_version/ 下的扩展目录即可使用。详见快速开始文档

工作原理

你提问 → 鼹鼠钻入地下(AI 进入后台 Agentic Loop)
       → 在隧道网络中挖掘(Channel 通信 + MCP 工具调用 + 多轮推理)
       → 带着宝物浮出地面(结果呈现在悬浮球中)

MoleClaw 运行在 Chrome 扩展的三层架构中:

角色 鼹鼠隐喻
Content Script 悬浮球 UI + 页面交互 地面 — 你看到的部分
Background AI 编排 + 工具调度 地下 — 鼹鼠工作的地方
Channel 跨层消息通信 隧道网络 — 连接地面与地下

文档

访问 MoleClaw 文档站 了解详细使用和开发指南。

开发

npm run dev          # 开发模式(监听构建)
npm run build        # 构建所有组件
npm run lint         # 代码检查
npm run docs:dev     # 文档站本地预览

致谢

本项目在 linux.do 社区发起,感谢社区成员的反馈与支持。

许可证

AGPL-3.0

Extension points exported contracts — how you extend this code

LLMStatus (Interface)
LLM 配置状态
src/App.tsx
PendingDialog (Interface)
待处理对话框信息
src/lib/cdp-session.ts
WaitNavigationOptions (Interface)
等待页面导航稳定(从 page-action.ts 搬迁)
src/functions/cdp-input.ts
ExecutionGroup (Interface)
执行组类型:并行组或串行组
src/ai/tool-executor.ts
WorkflowItem (Interface)
Workflow 定义(与 registry 中格式一致)
src/options/pages/WorkflowsPage.tsx
RuntimeResourceEventPayload (Interface)
运行时资源事件载荷
src/background/session-resource.ts
PageBasicInfo (Interface)
页面基础信息(始终返回)
src/content/page-parser.ts
LogItem (Interface)
(no doc)
src/types/index.ts

Core symbols most depended-on inside this repo

get
called by 161
src/ai/agent-registry.ts
add
called by 111
src/ai/todo-manager.ts
remove
called by 102
src/ai/todo-manager.ts
escapeHtml
called by 100
src/content/float-ball/markdown.ts
on
called by 86
src/lib/channel.ts
send
called by 81
src/lib/channel.ts
saveSnapshot
called by 65
src/content/float-ball.ts
updateInputUI
called by 45
src/content/float-ball.ts

Shape

Function 926
Interface 169
Method 52
Class 14

Languages

TypeScript100%

Modules by API surface

src/content/float-ball.ts144 symbols
src/lib/cdp-session.ts43 symbols
src/background/session-manager.ts43 symbols
src/functions/skill-registry.ts36 symbols
src/content/page-grounding.ts33 symbols
src/functions/resident-runtime.ts30 symbols
src/functions/cdp-input.ts30 symbols
src/functions/site-workflow-registry.ts26 symbols
src/functions/remote-workflow.ts25 symbols
src/functions/site-experience.ts23 symbols
src/background/session-context-tasks.ts23 symbols
src/functions/registry.ts21 symbols

For agents

$ claude mcp add mole-extension \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact