weixin-devtools-mcp: Instructions file for Codex

AGENTS.md

weixin-devtools-mcp AGENTS.md is an instructions file for Codex, OpenCode from wooter-s/weixin-devtools-mcp. It costs 3,075 tokens per session, scanned A, original, MIT.

A repository guide for coding agents working on the Weixin development-tools project. It explains the project structure, which source files are authoritative, and how development, debugging, testing, and releases should be handled.

In plain words
What is it for?
Use it when changing, debugging, testing, or releasing this repository, especially when you need to understand its server, tools, page state, and data collectors.
Why use it?
It gives an agent shared rules for finding the right code and prevents outdated documentation from being treated as the source of truth.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is wooter-s/weixin-devtools-mcp's own configuration. It tells Codex and OpenCode how to work on weixin-devtools-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything weixin-devtools-mcp configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/wooter-s/weixin-devtools-mcp/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/wooter-s/weixin-devtools-mcp

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for weixin-devtools-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/wooter-s/weixin-devtools-mcp/agents-md/github.svg)](https://agentmods.dev/instructions/wooter-s/weixin-devtools-mcp/agents-md)
Your own site
<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.

agentmods 80×15 button for weixin-devtools-mcp AGENTS.md

Your own site · 80×15
<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>
Per session 3,075 This file is loaded in full into every session.
When invoked 3,075 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 2mo ago against content hash 987a918c0b6b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

AGENTS.md · 211 lines

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.ts
    • src/protocol/lean-server.ts
    • src/protocol/tool-descriptor-manifest.ts
    • src/tools/index.ts
    • src/MiniProgramContext.ts
    • src/tools.ts
  • docs/、claudedocs/、README.md 可作为参考,但当与代码冲突时,必须以代码为准并同步修正文档。

2. 项目架构总览

2.1 分层结构

  • 协议入口层:src/server.ts
    • 基于官方 SDK Protocol 创建轻量 LeanServer
    • 注册 ListTools、CallTool、ListResources、ReadResource handlers
    • ListTools 从构建期静态 manifest 返回 descriptor;工具实现与结果运行时仅在首次有效 CallTool 时加载
  • 工具编排层: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 启动流程

  1. 通过 build/server.js 启动 MCP 服务(stdio transport)。
  2. 初始化全局 MiniProgramContext。
  3. 读取 build/protocol/tool-descriptors.generated.json,按 profile 筛选静态 descriptor。
  4. 保持工具实现、automator 和结果运行时未加载,直到首次有效 CallTool。

3.2 工具调用流程

  1. 客户端发起 CallTool。
  2. src/server.ts 先用静态 descriptor 判定工具是否存在、是否被 profile 禁用。
  3. 首次有效调用懒加载 allTools 和结果运行时,并校验实现与 manifest 一致。
  4. 使用 zod schema 校验输入参数,执行 handler 并写入 SimpleToolResponse。
  5. 成功与失败均返回 schemaVersion: "2.0" 全字段结构化信封;handler 已产生的文本、图片、partial data 和已提交 observation 在失败时继续保留,异常统一标记 isError: true。

Read the full file on GitHub · 211 lines

Changes

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.

  1. 2mo ago First seen · 211 lines · 3,075 tokens per session scan A 987a918c0b6b

Subscribe to this mod's changes

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.

Related

weixin-devtools-mcp AGENTS.md compared with instructions from other repositories

weixin-devtools-mcp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
weixin-devtools-mcp AGENTS.mdwooter-s/weixin-devtools-mcpInstructions file782mo agoMITA3,075Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode