← weixin-devtools-mcp

weixin-devtools-mcp 0.6.0

npm · weixin-devtools-mcp · current release

20
Tools
1
Resources
0
Templates
0
Prompts

Observation

Observed 2026-08-15T23:29:32.205Z using mcpSecurity-inventory. Status: partial. Negotiated protocol: 2025-06-18.

Server capabilities
{
  "resources": {},
  "tools": {}
}

Tools 20

ToolCategoryAnnotationsRisk
assert_attribute断言元素属性值
Input schema
{
  "type": "object",
  "properties": {
    "target": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "ref"
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "description": "页面快照返回的 opaque ref"
            }
          },
          "required": [
            "kind",
            "ref"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "testId"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "data-testid 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "id"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "id 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "selector"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "小程序组件选择器"
            },
            "index": {
              "type": "integer",
              "minimum": 0,
              "description": "从 0 开始的匹配索引;多匹配时必须提供"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "text"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "元素文本"
            },
            "exact": {
              "type": "boolean",
              "default": true,
              "description": "是否精确匹配,默认 true"
            },
            "tagName": {
              "type": "string",
              "minLength": 1,
              "description": "可选的组件标签限制"
            },
            "index": {
              "$ref": "#/properties/target/anyOf/3/properties/index"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        }
      ]
    },
    "attributeKey": {
      "type": "string",
      "description": "属性名"
    },
    "attributeValue": {
      "type": "string",
      "description": "期望的属性值"
    }
  },
  "required": [
    "target",
    "attributeKey",
    "attributeValue"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "passed": {
              "type": "boolean"
            },
            "message": {
              "type": "string"
            },
            "expected": {},
            "actual": {},
            "timestamp": {
              "type": "string"
            }
          },
          "required": [
            "passed",
            "message",
            "expected",
            "actual",
            "timestamp"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:9801141c371b585c2a483f2dc94c9c8c05ca2eaeaabfa065cb3eded26281d58a"
}
— · —
assert_state断言元素的各种状态
Input schema
{
  "type": "object",
  "properties": {
    "target": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "ref"
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "description": "页面快照返回的 opaque ref"
            }
          },
          "required": [
            "kind",
            "ref"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "testId"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "data-testid 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "id"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "id 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "selector"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "小程序组件选择器"
            },
            "index": {
              "type": "integer",
              "minimum": 0,
              "description": "从 0 开始的匹配索引;多匹配时必须提供"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "text"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "元素文本"
            },
            "exact": {
              "type": "boolean",
              "default": true,
              "description": "是否精确匹配,默认 true"
            },
            "tagName": {
              "type": "string",
              "minLength": 1,
              "description": "可选的组件标签限制"
            },
            "index": {
              "$ref": "#/properties/target/anyOf/3/properties/index"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        }
      ]
    },
    "visible": {
      "type": "boolean",
      "description": "期望可见状态"
    },
    "enabled": {
      "type": "boolean",
      "description": "期望启用状态"
    },
    "checked": {
      "type": "boolean",
      "description": "期望选中状态(checkbox/radio)"
    },
    "focused": {
      "type": "boolean",
      "description": "期望焦点状态"
    }
  },
  "required": [
    "target"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "passed": {
              "type": "boolean"
            },
            "checks": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "passed": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "expected": {},
                  "actual": {}
                },
                "required": [
                  "passed",
                  "message",
                  "expected",
                  "actual"
                ],
                "additionalProperties": false
              }
            },
            "total": {
              "type": "integer",
              "minimum": 0
            },
            "passedCount": {
              "type": "integer",
              "minimum": 0
            },
            "failedCount": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "passed",
            "checks",
            "total",
            "passedCount",
            "failedCount"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:c01004e5b708e7cccf30ce9809af148489f71f17efec3a94ad9437ae630ded7e"
}
— · —
assert_text断言元素文本内容
Input schema
{
  "type": "object",
  "properties": {
    "target": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "ref"
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "description": "页面快照返回的 opaque ref"
            }
          },
          "required": [
            "kind",
            "ref"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "testId"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "data-testid 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "id"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "id 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "selector"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "小程序组件选择器"
            },
            "index": {
              "type": "integer",
              "minimum": 0,
              "description": "从 0 开始的匹配索引;多匹配时必须提供"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "text"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "元素文本"
            },
            "exact": {
              "type": "boolean",
              "default": true,
              "description": "是否精确匹配,默认 true"
            },
            "tagName": {
              "type": "string",
              "minLength": 1,
              "description": "可选的组件标签限制"
            },
            "index": {
              "$ref": "#/properties/target/anyOf/3/properties/index"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        }
      ]
    },
    "text": {
      "type": "string",
      "description": "精确匹配的文本"
    },
    "textContains": {
      "type": "string",
      "description": "包含的文本"
    },
    "textMatches": {
      "type": "string",
      "description": "正则表达式匹配"
    }
  },
  "required": [
    "target"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "passed": {
              "type": "boolean"
            },
            "message": {
              "type": "string"
            },
            "expected": {},
            "actual": {},
            "timestamp": {
              "type": "string"
            }
          },
          "required": [
            "passed",
            "message",
            "expected",
            "actual",
            "timestamp"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:9801141c371b585c2a483f2dc94c9c8c05ca2eaeaabfa065cb3eded26281d58a"
}
— · —
click点击指定 target 的页面元素
Input schema
{
  "type": "object",
  "properties": {
    "target": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "ref"
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "description": "页面快照返回的 opaque ref"
            }
          },
          "required": [
            "kind",
            "ref"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "testId"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "data-testid 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "id"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "id 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "selector"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "小程序组件选择器"
            },
            "index": {
              "type": "integer",
              "minimum": 0,
              "description": "从 0 开始的匹配索引;多匹配时必须提供"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "text"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "元素文本"
            },
            "exact": {
              "type": "boolean",
              "default": true,
              "description": "是否精确匹配,默认 true"
            },
            "tagName": {
              "type": "string",
              "minLength": 1,
              "description": "可选的组件标签限制"
            },
            "index": {
              "$ref": "#/properties/target/anyOf/3/properties/index"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        }
      ]
    },
    "dblClick": {
      "type": "boolean",
      "default": false,
      "description": "是否为双击,默认false"
    }
  },
  "required": [
    "target"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "target": {},
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "doubleClick": {
              "type": "boolean"
            }
          },
          "required": [
            "target",
            "pageRevision",
            "doubleClick"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:5025059e34b2f47fd70554958d4e812588f19615d9d65e59142c7d3484988771"
}
— · —
connect_devtools连接微信开发者工具,支持多入口策略和自动回退
Input schema
{
  "type": "object",
  "properties": {
    "strategy": {
      "type": "string",
      "enum": [
        "auto",
        "launch",
        "connect",
        "wsEndpoint",
        "browserUrl",
        "discover"
      ],
      "default": "auto",
      "description": "连接策略: auto/launch/connect/wsEndpoint/browserUrl/discover"
    },
    "projectPath": {
      "type": "string",
      "description": "小程序项目的绝对路径"
    },
    "cliPath": {
      "type": "string",
      "description": "微信开发者工具 CLI 绝对路径(可选)"
    },
    "autoPort": {
      "type": "number",
      "description": "自动化监听端口(可选)"
    },
    "browserUrl": {
      "type": "string",
      "description": "已运行实例的 HTTP 调试地址,如 http://127.0.0.1:9222"
    },
    "wsEndpoint": {
      "type": "string",
      "description": "已运行实例的 WS 地址,如 ws://127.0.0.1:9420"
    },
    "wsHeaders": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "WS 自定义请求头"
    },
    "timeoutMs": {
      "type": "number",
      "default": 45000,
      "description": "连接超时时间(毫秒)"
    },
    "fallback": {
      "type": "array",
      "items": {
        "$ref": "#/properties/strategy"
      },
      "description": "连接失败时的回退策略序列"
    },
    "healthCheck": {
      "type": "boolean",
      "default": true,
      "description": "是否执行连接健康检查"
    },
    "autoDiscover": {
      "type": "boolean",
      "default": true,
      "description": "auto 策略下是否优先尝试自动发现端点"
    },
    "verbose": {
      "type": "boolean",
      "default": false,
      "description": "是否输出详细日志"
    },
    "autoAudits": {
      "type": "boolean",
      "description": "launch/connect 策略下是否启用体验评分"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "connectionId": {
              "type": "string"
            },
            "state": {
              "type": "string",
              "enum": [
                "connected",
                "degraded"
              ]
            },
            "strategy": {
              "type": "string",
              "enum": [
                "auto",
                "launch",
                "connect",
                "wsEndpoint",
                "browserUrl",
                "discover"
              ]
            },
            "endpoint": {
              "type": [
                "string",
                "null"
              ]
            },
            "pagePath": {
              "type": "string"
            },
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "health": {},
            "timing": {},
            "warnings": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "connectionId",
            "state",
            "strategy",
            "endpoint",
            "pagePath",
            "pageRevision",
            "health",
            "timing",
            "warnings"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:d4718a17a45d9e6bb12ba6b9801cb89f9a5fef2dbf0f623e51c922c02144c58a"
}
— · —
disconnect_devtools断开与微信开发者工具的连接并清理上下文状态
Input schema
{
  "type": "object",
  "properties": {},
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "const": "disconnected"
            },
            "connected": {
              "type": "boolean",
              "const": false
            }
          },
          "required": [
            "state",
            "connected"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:f2486aaca4639be06dfd5c9439f8d58463a74eb17209b1e50b658da7968a21a6"
}
— · —
evaluate_script在小程序 AppService 上下文中执行 JavaScript 代码并返回结果。 支持访问 wx API、getApp()、getCurrentPages() 等小程序全局对象。 返回值必须是 JSON 可序列化的类型。
Input schema
{
  "type": "object",
  "properties": {
    "function": {
      "type": "string",
      "description": "JavaScript 函数声明,将在小程序 AppService 上下文中执行。\n支持同步和异步函数,可访问 wx API 和 getApp()。\n\n注意:函数会被序列化传递,无法使用闭包引用外部变量。\n\n无参数示例:\n`() => {\n  return wx.getSystemInfoSync();\n}`\n\n或使用字符串形式:\n`\"() => wx.getSystemInfoSync()\"`\n\n异步示例:\n`async () => {\n  return new Promise(resolve => {\n    wx.getSystemInfo({\n      success: result => resolve(result)\n    });\n  });\n}`\n\n带参数示例:\n`(key, value) => {\n  wx.setStorageSync(key, value);\n  return { success: true };\n}`\n\n访问全局数据示例:\n`() => {\n  const app = getApp();\n  return app.globalData;\n}`\n\n访问当前页面示例:\n`() => {\n  const pages = getCurrentPages();\n  const currentPage = pages[pages.length - 1];\n  return currentPage.data;\n}`"
    },
    "args": {
      "type": "array",
      "description": "可选的参数数组,传递给函数执行。\n参数必须是 JSON 可序列化的类型(字符串、数字、布尔值、对象、数组等)。\n\n示例:\n- 单个参数: [\"testKey\"]\n- 多个参数: [\"key\", 123, { foo: \"bar\" }]\n- 复杂对象: [{ name: \"test\", data: [1, 2, 3] }]"
    }
  },
  "required": [
    "function"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "result": {}
          },
          "required": [
            "result"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:73d8bfd3e8bc0610ab4cbbc8f4f3175f118f91dd6a6460b68a5233a45f02978b"
}
— · —
find_elements通过 selector、id、testId、text 或 ref 查找页面元素并返回 opaque ref
Input schema
{
  "type": "object",
  "properties": {
    "locator": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "ref"
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "description": "页面快照返回的 opaque ref"
            }
          },
          "required": [
            "kind",
            "ref"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "testId"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "data-testid 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "id"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "id 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "selector"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "小程序组件选择器"
            },
            "index": {
              "type": "integer",
              "minimum": 0,
              "description": "从 0 开始的匹配索引;多匹配时必须提供"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "text"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "元素文本"
            },
            "exact": {
              "type": "boolean",
              "default": true,
              "description": "是否精确匹配,默认 true"
            },
            "tagName": {
              "type": "string",
              "minLength": 1,
              "description": "可选的组件标签限制"
            },
            "index": {
              "$ref": "#/properties/locator/anyOf/3/properties/index"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "locator"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "count": {
              "type": "integer",
              "minimum": 0
            },
            "elements": {
              "type": "array",
              "items": {}
            }
          },
          "required": [
            "pageRevision",
            "count",
            "elements"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:84c6c26ac480000c96fe6f9a57f38c614aaacaeaf871a63e3e863cf36c0301fe"
}
— · —
get_connection_status获取当前连接状态(可选刷新健康检查)
Input schema
{
  "type": "object",
  "properties": {
    "refreshHealth": {
      "type": "boolean",
      "default": true,
      "description": "是否刷新健康检查状态"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "disconnected",
                "connecting",
                "connected",
                "degraded"
              ]
            },
            "connected": {
              "type": "boolean"
            },
            "connectionId": {
              "type": [
                "string",
                "null"
              ]
            },
            "strategy": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "auto",
                    "launch",
                    "connect",
                    "wsEndpoint",
                    "browserUrl",
                    "discover"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "endpoint": {
              "type": [
                "string",
                "null"
              ]
            },
            "pagePath": {
              "type": [
                "string",
                "null"
              ]
            },
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "health": {},
            "lastError": {}
          },
          "required": [
            "state",
            "connected",
            "connectionId",
            "strategy",
            "endpoint",
            "pagePath",
            "pageRevision",
            "health",
            "lastError"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:53b2f508888a3f77e03a56872018b2ee1e1ade75928a58e6beb23b21c1cf0c9b"
}
— · —
get_current_page获取当前页面信息并设置为活动页面
Input schema
{
  "type": "object",
  "properties": {},
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "pagePath": {
              "type": "string"
            },
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "pagePath",
            "pageRevision"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:d2459eacd334f515749a499525ab440d690cafac1fefe49a0836c6513206293f"
}
— · —
get_page_snapshot获取当前页面的元素快照,包含所有元素的 opaque ref 输出格式选项: - compact: 紧凑文本格式(推荐,token使用减少60-70%) - minimal: 最小化格式(只包含ref、tagName、text) - json: 完整结构化JSON格式 示例: compact格式: ref=ref_a1b2_0 view "Welcome" pos=[0,64] size=[375x667] ref=ref_a1b2_1 button "Submit" pos=[100,400] size=[175x44] minimal格式: ref_a1b2_0 view "Welcome" ref_a1b2_1 button "Submit"
Input schema
{
  "type": "object",
  "properties": {
    "format": {
      "type": "string",
      "enum": [
        "compact",
        "minimal",
        "json"
      ],
      "default": "compact",
      "description": "输出格式"
    },
    "includePosition": {
      "type": "boolean",
      "default": true,
      "description": "是否包含位置信息(compact和json格式有效)"
    },
    "includeAttributes": {
      "type": "boolean",
      "default": false,
      "description": "是否包含属性信息(compact和json格式有效)"
    },
    "maxElements": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "限制返回的元素数量"
    },
    "filePath": {
      "type": "string",
      "description": "保存快照到文件的路径(可选)"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "snapshotId": {
              "type": "string"
            },
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "path": {
              "type": "string"
            },
            "count": {
              "type": "integer",
              "minimum": 0
            },
            "format": {
              "type": "string",
              "enum": [
                "compact",
                "minimal",
                "json"
              ]
            },
            "tokenEstimate": {
              "type": "integer",
              "minimum": 0
            },
            "filePath": {
              "type": [
                "string",
                "null"
              ]
            },
            "elements": {
              "type": "array",
              "items": {}
            }
          },
          "required": [
            "snapshotId",
            "pageRevision",
            "path",
            "count",
            "format",
            "tokenEstimate",
            "filePath",
            "elements"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:b7fbffd94692dcbedc099c1f47accc77561479d2751bc982278394834ca65484"
}
— · —
get_value获取元素的值或文本内容
Input schema
{
  "type": "object",
  "properties": {
    "target": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "ref"
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "description": "页面快照返回的 opaque ref"
            }
          },
          "required": [
            "kind",
            "ref"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "testId"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "data-testid 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "id"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "id 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "selector"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "小程序组件选择器"
            },
            "index": {
              "type": "integer",
              "minimum": 0,
              "description": "从 0 开始的匹配索引;多匹配时必须提供"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "text"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "元素文本"
            },
            "exact": {
              "type": "boolean",
              "default": true,
              "description": "是否精确匹配,默认 true"
            },
            "tagName": {
              "type": "string",
              "minLength": 1,
              "description": "可选的组件标签限制"
            },
            "index": {
              "$ref": "#/properties/target/anyOf/3/properties/index"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        }
      ]
    },
    "attribute": {
      "type": "string",
      "description": "要获取的属性名,不指定则获取value或text"
    }
  },
  "required": [
    "target"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "target": {},
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "attribute": {
              "type": [
                "string",
                "null"
              ]
            },
            "value": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "target",
            "pageRevision",
            "attribute",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:eacf0aa0b1fb817e3f7fb8a393c822476b972a3864e83f5426c5f40c55480834"
}
— · —
input_text向input/textarea元素输入文本
Input schema
{
  "type": "object",
  "properties": {
    "target": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "ref"
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "description": "页面快照返回的 opaque ref"
            }
          },
          "required": [
            "kind",
            "ref"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "testId"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "data-testid 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "id"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "id 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "selector"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "小程序组件选择器"
            },
            "index": {
              "type": "integer",
              "minimum": 0,
              "description": "从 0 开始的匹配索引;多匹配时必须提供"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "text"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "元素文本"
            },
            "exact": {
              "type": "boolean",
              "default": true,
              "description": "是否精确匹配,默认 true"
            },
            "tagName": {
              "type": "string",
              "minLength": 1,
              "description": "可选的组件标签限制"
            },
            "index": {
              "$ref": "#/properties/target/anyOf/3/properties/index"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        }
      ]
    },
    "mode": {
      "type": "string",
      "enum": [
        "replace",
        "append",
        "clear"
      ]
    },
    "text": {
      "type": "string"
    }
  },
  "required": [
    "target",
    "mode"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "target": {},
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "mode": {
              "type": "string",
              "enum": [
                "replace",
                "append",
                "clear"
              ]
            },
            "value": {
              "type": "string"
            }
          },
          "required": [
            "target",
            "pageRevision",
            "mode",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:6697ac9136d9c704e3f321860e3d81016e81946007bcba1222514efc385a6238"
}
— · —
navigate_back返回上一页(当前 automator 版本仅支持 delta=1)
Input schema
{
  "type": "object",
  "properties": {
    "delta": {
      "type": "number",
      "const": 1,
      "default": 1,
      "description": "返回层数,当前仅支持1"
    },
    "waitForLoad": {
      "type": "boolean",
      "default": true,
      "description": "是否等待页面加载完成,默认true"
    },
    "timeout": {
      "type": "number",
      "minimum": 0,
      "default": 5000,
      "description": "等待超时时间(毫秒),默认5000ms"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "enum": [
                "navigate",
                "redirect",
                "back",
                "switchTab",
                "relaunch"
              ]
            },
            "pagePath": {
              "type": "string"
            },
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "details": {}
          },
          "required": [
            "operation",
            "pagePath",
            "pageRevision",
            "details"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:dd13f058cf33279bf49d9a0256ccbef44533e683e86f81f35ba199e55538685e"
}
— · —
navigate_to跳转到指定页面
Input schema
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "目标页面路径"
    },
    "params": {
      "type": "object",
      "additionalProperties": {
        "type": [
          "string",
          "number",
          "boolean"
        ]
      },
      "description": "页面参数(查询参数)"
    },
    "redirect": {
      "type": "boolean",
      "default": false,
      "description": "是否使用重定向模式(关闭当前页面),默认false"
    },
    "waitForLoad": {
      "type": "boolean",
      "default": true,
      "description": "是否等待页面加载完成,默认true"
    },
    "timeout": {
      "type": "number",
      "minimum": 0,
      "default": 10000,
      "description": "等待超时时间(毫秒),默认10000ms"
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "enum": [
                "navigate",
                "redirect",
                "back",
                "switchTab",
                "relaunch"
              ]
            },
            "pagePath": {
              "type": "string"
            },
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "details": {}
          },
          "required": [
            "operation",
            "pagePath",
            "pageRevision",
            "details"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:dd13f058cf33279bf49d9a0256ccbef44533e683e86f81f35ba199e55538685e"
}
— · —
reconnect_devtools重新连接微信开发者工具,可复用上一次连接参数
Input schema
{
  "type": "object",
  "properties": {
    "strategy": {
      "type": "string",
      "enum": [
        "auto",
        "launch",
        "connect",
        "wsEndpoint",
        "browserUrl",
        "discover"
      ],
      "description": "可选,覆盖上次连接策略"
    },
    "projectPath": {
      "type": "string",
      "description": "可选,覆盖上次项目路径"
    },
    "cliPath": {
      "type": "string"
    },
    "autoPort": {
      "type": "number"
    },
    "browserUrl": {
      "type": "string"
    },
    "wsEndpoint": {
      "type": "string"
    },
    "wsHeaders": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "timeoutMs": {
      "type": "number"
    },
    "fallback": {
      "type": "array",
      "items": {
        "$ref": "#/properties/strategy"
      }
    },
    "healthCheck": {
      "type": "boolean"
    },
    "autoDiscover": {
      "type": "boolean"
    },
    "verbose": {
      "type": "boolean"
    },
    "autoAudits": {
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "connectionId": {
              "type": "string"
            },
            "state": {
              "type": "string",
              "enum": [
                "connected",
                "degraded"
              ]
            },
            "strategy": {
              "type": "string",
              "enum": [
                "auto",
                "launch",
                "connect",
                "wsEndpoint",
                "browserUrl",
                "discover"
              ]
            },
            "endpoint": {
              "type": [
                "string",
                "null"
              ]
            },
            "pagePath": {
              "type": "string"
            },
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "health": {},
            "timing": {},
            "warnings": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "connectionId",
            "state",
            "strategy",
            "endpoint",
            "pagePath",
            "pageRevision",
            "health",
            "timing",
            "warnings"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:d4718a17a45d9e6bb12ba6b9801cb89f9a5fef2dbf0f623e51c922c02144c58a"
}
— · —
relaunch重新启动小程序并跳转到指定页面
Input schema
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "目标页面路径"
    },
    "params": {
      "type": "object",
      "additionalProperties": {
        "type": [
          "string",
          "number",
          "boolean"
        ]
      },
      "description": "页面参数(查询参数)"
    },
    "waitForLoad": {
      "type": "boolean",
      "default": true,
      "description": "是否等待页面加载完成,默认true"
    },
    "timeout": {
      "type": "number",
      "minimum": 0,
      "default": 10000,
      "description": "等待超时时间(毫秒),默认10000ms"
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "enum": [
                "navigate",
                "redirect",
                "back",
                "switchTab",
                "relaunch"
              ]
            },
            "pagePath": {
              "type": "string"
            },
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "details": {}
          },
          "required": [
            "operation",
            "pagePath",
            "pageRevision",
            "details"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:dd13f058cf33279bf49d9a0256ccbef44533e683e86f81f35ba199e55538685e"
}
— · —
set_form_control设置表单控件的值(如picker、switch、slider等)
Input schema
{
  "type": "object",
  "properties": {
    "target": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "ref"
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "description": "页面快照返回的 opaque ref"
            }
          },
          "required": [
            "kind",
            "ref"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "testId"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "data-testid 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "id"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "id 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "selector"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "小程序组件选择器"
            },
            "index": {
              "type": "integer",
              "minimum": 0,
              "description": "从 0 开始的匹配索引;多匹配时必须提供"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "text"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "元素文本"
            },
            "exact": {
              "type": "boolean",
              "default": true,
              "description": "是否精确匹配,默认 true"
            },
            "tagName": {
              "type": "string",
              "minLength": 1,
              "description": "可选的组件标签限制"
            },
            "index": {
              "$ref": "#/properties/target/anyOf/3/properties/index"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        }
      ]
    },
    "value": {
      "type": [
        "string",
        "number",
        "boolean"
      ],
      "description": "要设置的值"
    },
    "trigger": {
      "type": "string",
      "default": "change",
      "description": "触发的事件类型,默认为change"
    }
  },
  "required": [
    "target",
    "value"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "target": {},
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "value": {},
            "trigger": {
              "type": "string"
            }
          },
          "required": [
            "target",
            "pageRevision",
            "value",
            "trigger"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:5b9d28b6aa8e3e63e7fd671eb1aa02db49edc578af0b220284d5ef49649beb25"
}
— · —
switch_tab切换到指定Tab页
Input schema
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Tab页路径"
    },
    "waitForLoad": {
      "type": "boolean",
      "default": true,
      "description": "是否等待页面加载完成,默认true"
    },
    "timeout": {
      "type": "number",
      "minimum": 0,
      "default": 5000,
      "description": "等待超时时间(毫秒),默认5000ms"
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "enum": [
                "navigate",
                "redirect",
                "back",
                "switchTab",
                "relaunch"
              ]
            },
            "pagePath": {
              "type": "string"
            },
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            },
            "details": {}
          },
          "required": [
            "operation",
            "pagePath",
            "pageRevision",
            "details"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:dd13f058cf33279bf49d9a0256ccbef44533e683e86f81f35ba199e55538685e"
}
— · —
wait_for等待条件满足,支持等待元素出现、消失、文本匹配等
Input schema
{
  "type": "object",
  "properties": {
    "delay": {
      "type": "number",
      "description": "等待指定毫秒数(时间等待模式)"
    },
    "target": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "ref"
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "description": "页面快照返回的 opaque ref"
            }
          },
          "required": [
            "kind",
            "ref"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "testId"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "data-testid 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "id"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "id 属性值"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "selector"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "小程序组件选择器"
            },
            "index": {
              "type": "integer",
              "minimum": 0,
              "description": "从 0 开始的匹配索引;多匹配时必须提供"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "text"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "description": "元素文本"
            },
            "exact": {
              "type": "boolean",
              "default": true,
              "description": "是否精确匹配,默认 true"
            },
            "tagName": {
              "type": "string",
              "minLength": 1,
              "description": "可选的组件标签限制"
            },
            "index": {
              "$ref": "#/properties/target/anyOf/3/properties/index"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        }
      ],
      "description": "等待元素目标(定位等待模式)"
    },
    "timeout": {
      "type": "number",
      "default": 5000,
      "description": "超时时间(毫秒),默认5000ms"
    },
    "text": {
      "type": "string",
      "description": "等待元素包含指定文本"
    },
    "visible": {
      "type": "boolean",
      "description": "等待元素可见状态,true为可见,false为隐藏"
    },
    "disappear": {
      "type": "boolean",
      "default": false,
      "description": "等待元素消失,默认false"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema
{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "ok": {
      "type": "boolean"
    },
    "code": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_ARGUMENT",
        "TOOL_DISABLED",
        "UNKNOWN_TOOL",
        "NOT_CONNECTED",
        "CONNECTION_FAILED",
        "CONNECTION_LOST",
        "NO_ACTIVE_PAGE",
        "STALE_ELEMENT",
        "ELEMENT_NOT_FOUND",
        "AMBIGUOUS_ELEMENT",
        "ELEMENT_NOT_INTERACTABLE",
        "TIMEOUT",
        "ASSERTION_FAILED",
        "DEVTOOLS_OPERATION_FAILED",
        "UNSUPPORTED_OPERATION",
        "INTERNAL_ERROR"
      ]
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "matched": {
              "type": "boolean"
            },
            "durationMs": {
              "type": "number",
              "minimum": 0
            },
            "pageRevision": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "matched",
            "durationMs",
            "pageRevision"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "required": [
        "message",
        "retryable"
      ],
      "additionalProperties": false
    },
    "observation": {
      "type": "object"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "nextActions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "requestId",
        "tool",
        "durationMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "ok",
    "code",
    "data",
    "warnings",
    "nextActions",
    "meta"
  ],
  "additionalProperties": false,
  "$id": "urn:weixin-devtools-mcp:schema:output:sha256:1275acf5d9e64a9fe05620bead3a3702c4e7b742a496bd23a09b04cbb7903236"
}
— · —

Resources 1

Resource templates 0

Prompts 0

Let’s talk about MCP security.

Share your details and our security team will contact you.