Borrowing it
Nothing to install: this file belongs to wooter-s/weixin-devtools-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/wooter-s/weixin-devtools-mcp/main/AGENTS.mdgit clone --depth 1 https://github.com/wooter-s/weixin-devtools-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/wooter-s/weixin-devtools-mcp/agents-md)<a href="https://agentmods.dev/instructions/wooter-s/weixin-devtools-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/wooter-s/weixin-devtools-mcp/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/wooter-s/weixin-devtools-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/wooter-s/weixin-devtools-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.03075 | $0.03075 |
| Opus 5.5 | $0.01230 | $0.01230 |
| Sonnet 5.5 | $0.00615 | $0.00615 |
| Haiku 4.5 | $0.00308 | $0.00308 |
Grade A, and why
weixin-devtools-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 211 lines — stays where its author put it; the contents beside it link to each section on GitHub.
weixin-devtools-mcp AGENTS 指南
1. 文档定位与事实源
- 本文档用于指导在本仓库中进行增量开发、调试、测试和发布。
- 架构与行为以
src/下的实现为唯一事实源,尤其是:src/server.tssrc/protocol/lean-server.tssrc/protocol/tool-descriptor-manifest.tssrc/tools/index.tssrc/MiniProgramContext.tssrc/tools.ts
docs/、claudedocs/、README.md可作为参考,但当与代码冲突时,必须以代码为准并同步修正文档。
2. 项目架构总览
2.1 分层结构
- 协议入口层:
src/server.ts- 基于官方 SDK
Protocol创建轻量LeanServer - 注册
ListTools、CallTool、ListResources、ReadResourcehandlers ListTools从构建期静态 manifest 返回 descriptor;工具实现与结果运行时仅在首次有效CallTool时加载
- 基于官方 SDK
- 工具编排层:
src/tools/*.ts+src/tools/index.ts- 每个工具模块按功能域拆分
- 统一通过
defineTool定义名称、schema、handler
- 运行时状态层:
src/MiniProgramContext.ts- 管理
miniProgram、currentPage、elementMap - 管理 console/network collector 生命周期
- 通过 page-state 队列原子管理 DOM epoch、revision、快照、ref registry 和状态摘要
- 查询、ref 注册、元素 I/O、导航与最终 observation 共用页面状态事务
- 管理
- 核心能力层:
src/tools.ts- 封装连接、导航、断言、交互等可复用能力
- 供工具层调用(包括连接增强逻辑、重试与健康检查)
- 数据收集层:
src/collectors/*ConsoleCollector和NetworkCollector负责会话化数据采集与查询console-runtime.ts/network-runtime.ts是通过 evaluate 序列化的自包含运行时函数,不得引用宿主模块变量- 网络采集禁止使用 SDK
mockWxMethod;日志采集禁止订阅 SDK console 事件触发App.enableLog - 安装与恢复必须核对 owner token 和包装函数身份;日志读取、导航分段和异步停止前必须同步远端队列
2.2 目录职责
src/:生产代码(TypeScript)tests/protocol/:MCP 协议层测试tests/tools/:工具行为测试tests/utils/:测试工具与辅助方法tests/integration/:真实微信开发者工具环境集成测试scripts/:构建辅助脚本(如可执行权限设置)build/:编译产物,禁止手改playground/:本地实验样例
3. 运行时核心流程
3.1 启动流程
- 通过
build/server.js启动 MCP 服务(stdio transport)。 - 初始化全局
MiniProgramContext。 - 读取
build/protocol/tool-descriptors.generated.json,按 profile 筛选静态 descriptor。 - 保持工具实现、automator 和结果运行时未加载,直到首次有效
CallTool。
3.2 工具调用流程
- 客户端发起
CallTool。 src/server.ts先用静态 descriptor 判定工具是否存在、是否被 profile 禁用。- 首次有效调用懒加载
allTools和结果运行时,并校验实现与 manifest 一致。 - 使用 zod schema 校验输入参数,执行 handler 并写入
SimpleToolResponse。 - 成功与失败均返回
schemaVersion: "2.0"全字段结构化信封;handler 已产生的文本、图片、partial data 和已提交 observation 在失败时继续保留,异常统一标记isError: true。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 211 lines · 3,075 tokens per session scan A 987a918c0b6b
weixin-devtools-mcp AGENTS.md is an instructions file published in the GitHub repository wooter-s/weixin-devtools-mcp (78 stars, last pushed 2mo ago), licensed MIT. It adds 3,075 tokens to every session, about $0.0123 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-07.
weixin-devtools-mcp AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| weixin-devtools-mcp AGENTS.mdwooter-s/weixin-devtools-mcp | Instructions file | 78 | 2mo ago | MIT | A | 3,075 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |