@ktbtw/verify-mcp
v0.2.6
Published
MCP server for Verify ApiToken public APIs
Readme
verify_mcp
基于 TypeScript 的 MCP 服务,用于把现有 ApiToken 公共接口封装成可供智能体直接调用的 MCP tools。
已发布 npm 包名:
@ktbtw/verify-mcp目标
- 运行形态:
stdio - 后端来源:现有
/api/app-token/*公共接口与旧加固提交接口。 - 鉴权方式:
VERIFY_API_TOKEN用于配置/编译工具,VERIFY_PROTECT_TOKEN用于 VMP、混淆、Dex2C、SO、注入等加固工具;两者可以只配置一个,调用未配置 token 的工具时会返回明确错误。 - 当前已接入:
- 上下文查询
- 应用列表查询
- 应用
apiKey/secretKey查询 - 验证接口签名规则与调用示例查询
- 配置列表/详情/创建/更新/删除
- dex/zip 文件读取与更新
- 云端代码读取与推送
- 编译配置修改
- 云端代码编译
- 编译任务列表/详情/下载/删除
- 编译配额查询
- VMP / 混淆 / Dex2C / SO / 注入加固任务提交、列表、详情、下载、删除
- 高阶流程工具:推送并编译、等待编译结果、获取完整配置快照
最近更新
0.2.6
- 新增
list_apps,ACCOUNT 级 ApiToken 可列出账号下全部应用,不再依赖配置列表反推应用。 get_app_credentials与get_verification_examples支持 ACCOUNT 级 ApiToken 不传appId时返回全部应用。
0.2.5
- 新增
get_app_credentials,通过 ApiToken 权限读取应用apiKey/secretKey。 - 新增
get_verification_examples,返回验证接口签名规则和 curl / JavaScript / Python 调用示例。 - APP 级 Token 可直接读取绑定应用;ACCOUNT 级 Token 需传
appId;CONFIG 级 Token 不允许读取应用密钥。
0.2.4
create_config支持账号级 ApiToken 传入appId,用于在“全部应用”Token 下指定新配置归属应用。get_context说明补充账号级 ApiToken 上下文。
0.2.2
- 默认 MCP 服务名改为
verify,与前端复制出的配置保持一致。 - 更新 README 与
.env.example中的客户端配置示例,移除verify-api-token旧命名。
0.2.1
- 新增
VERIFY_PROTECT_TOKEN,加固工具复用旧加固提交接口,不使用独立/api/protect-token/*接口。 - MCP 允许只配置
VERIFY_API_TOKEN或VERIFY_PROTECT_TOKEN其中一个;调用未配置 token 的工具时返回明确错误。 server_info区分返回apiTokenMasked与protectTokenMasked。
0.2.0
- 新增
list_runtime_api_classes - 新增
get_runtime_api_doc - 运行时文档按真实源码区分
xposed与inject - 可准确识别
HookHelper.getModuleContext()只属于 Xposed,不再把它误判为InjectHelper可用方法 - smoke 测试已覆盖新增工具,并验证
inject在includeInternal=false时不会返回getModuleContext - 新增迁移知识层、生命周期、资源与编译语义说明工具
- 新增
validate_cloud_runtime、simulate_resource_layout、validate_cloud_code_layout push_cloud_code/publish_cloud_code改为强校验模式,缺少fileTree或currentFilePath会直接拒绝
升级后,如果你希望 MCP 客户端立即使用这版,建议显式指定:
{
"mcpServers": {
"verify": {
"command": "npx",
"args": ["-y", "@ktbtw/[email protected]"],
"env": {
"VERIFY_BASE_URL": "https://www.xyapi.top/verfiy",
"VERIFY_API_TOKEN": "vat_xxx_replace_me",
"VERIFY_PROTECT_TOKEN": "vpt_xxx_replace_me",
"VERIFY_TIMEOUT_MS": "30000"
}
}
}
}安装
直接给 MCP 客户端使用时,优先走 npx,不需要单独安装:
{
"mcpServers": {
"verify": {
"command": "npx",
"args": ["-y", "@ktbtw/verify-mcp"],
"env": {
"VERIFY_BASE_URL": "https://www.xyapi.top/verfiy",
"VERIFY_API_TOKEN": "vat_xxx_replace_me",
"VERIFY_TIMEOUT_MS": "30000"
}
}
}
}如果你要本地开发,再使用下面的方式:
cd /Users/yuminghao/Downloads/verfiy/verify_mcp
cp .env.example .env
pnpm install然后修改 .env:
VERIFY_BASE_URL=https://www.xyapi.top/verfiy
VERIFY_API_TOKEN=你的_api_token
VERIFY_TIMEOUT_MS=30000运行
开发模式:
pnpm dev构建:
pnpm build生产运行:
pnpm start回归测试
先构建,再执行 smoke test:
pnpm build
pnpm -s smokesmoke 会通过 MCP stdio 客户端实际连接当前服务,并验证:
list_runtime_api_classesget_runtime_api_doc- tools 列表
get_contextlist_appslist_configsget_quotapublish_cloud_codewait_compile_resultget_full_config_snapshot
Inspector 调试
pnpm build
pnpm inspect工具列表
list_runtime_api_classesget_runtime_api_docget_runtime_migration_guideget_runtime_lifecycle_guideget_resource_and_native_rulesget_compile_semanticsget_card_verification_guidevalidate_cloud_runtimesimulate_resource_layoutvalidate_cloud_code_layoutserver_infosubmit_vmp_protect_tasksubmit_obfuscate_protect_tasksubmit_dex2c_protect_tasksubmit_so_protect_tasksubmit_inject_protect_tasklist_protect_tasksget_protect_taskdownload_protect_taskdelete_protect_taskget_contextlist_configsget_app_credentialsget_verification_examplesget_configcreate_configupdate_configdelete_configget_config_filesupdate_config_filesget_cloud_codepush_cloud_code- 严格要求同时传
files、fileTree、currentFilePath - 不会自动补树;布局不对会直接拒绝
- 严格要求同时传
update_compile_settingscompile_configlist_compile_tasksget_compile_taskdownload_compile_taskdelete_compile_taskget_quotaget_compile_quotawait_compile_resultpublish_cloud_code- 严格要求同时传
files、fileTree、currentFilePath - 会先校验编辑器兼容布局,再推送与编译
- 严格要求同时传
get_full_config_snapshot
运行时文档工具
为了让智能体准确区分 Xposed HookHelper 和 DEX InjectHelper 的真实能力,MCP 里额外提供了两类本地文档工具:
list_runtime_api_classes- 列出
xposed/inject各自有哪些运行时工具类 - 返回每个类的常用方法名和框架内部公开方法名摘要
- 列出
get_runtime_api_doc- 支持按
runtime、className、methodName精确查询 - 例如可查
HookHelper.getModuleContext - 也可查
InjectHelper全类说明,确认它并不提供getModuleContext
- 支持按
除此之外,又补了一组“迁移知识层 / 运行时语义层”工具:
get_runtime_migration_guide- 说明入口类/入口方法写法
- 说明当前云端代码支持
files[]多文件上传 - 说明 Xposed / Inject 在 Helper 能力上的差异
get_runtime_lifecycle_guide- 说明初始化时机
- 说明
main()不等于资源已就绪 - 说明 ActivityTask / ResourceTask 的晚提交兜底语义
get_resource_and_native_rules- 说明
resHook.zip固定命名、解压目录、缓存行为 - 说明
findFileInUnzipDir*的真实搜索语义 - 说明 native 建议如何结合
ResourceTaskManager
- 说明
get_compile_semantics- 说明
hasDexFile - 说明
cloudCode.exists - 说明编译任务
SUCCESS - 说明
downloaded
- 说明
get_card_verification_guide- 说明
requireCardVerification/exitOnVerificationFailure - 说明平台卡密门禁与业务自带卡密逻辑如何共存
- 说明
validate_cloud_runtime- 在编译前静态检查入口方法、运行时 API 混用、资源/native 风险
simulate_resource_layout- 根据
resHook.zip内部条目模拟findFileInUnzipDir*会命中什么
- 根据
validate_cloud_code_layout- 校验
files / fileTree / currentFilePath是否满足编辑器恢复要求 - 只做检查,不会自动补任何字段
- 校验
推荐调用顺序:
- 不确定某个运行时有哪些工具类时,先调用
list_runtime_api_classes - 确认目标类存在后,再调用
get_runtime_api_doc - 需要确认“用户代码能不能直接调”时,
get_runtime_api_doc建议加includeInternal=false - 真正开始迁移项目时,再调用
get_runtime_migration_guide/get_runtime_lifecycle_guide - 涉及图片、配置、
.so时,再调用get_resource_and_native_rules - 提交编译前,先调用
validate_cloud_runtime - 推送云端代码前,先调用
validate_cloud_code_layout
典型调用示例:
- 列出 DEX Inject 运行时有哪些工具类
{
"name": "list_runtime_api_classes",
"arguments": {
"runtime": "inject"
}
}- 同时查看
xposed和inject两边的工具类摘要
{
"name": "list_runtime_api_classes",
"arguments": {}
}- 查询 Xposed 下
HookHelper.getModuleContext()是否存在
{
"name": "get_runtime_api_doc",
"arguments": {
"runtime": "xposed",
"className": "HookHelper",
"methodName": "getModuleContext"
}
}- 查询 DEX 下
InjectHelper的可直接调用方法,并排除框架内部回填方法
{
"name": "get_runtime_api_doc",
"arguments": {
"runtime": "inject",
"className": "InjectHelper",
"includeInternal": false
}
}- 查询
ActivityTaskManager的整类说明,确认submitTask(...)等能力
{
"name": "get_runtime_api_doc",
"arguments": {
"runtime": "inject",
"className": "ActivityTaskManager"
}
}- 使用完整包名查询也可以
{
"name": "get_runtime_api_doc",
"arguments": {
"runtime": "inject",
"className": "com.xy.verfiy_inject.Util.InjectHelper",
"methodName": "getHostContext"
}
}- 读取 DEX Inject 的迁移指南
{
"name": "get_runtime_migration_guide",
"arguments": {
"runtime": "inject"
}
}- 读取 Xposed 的生命周期说明
{
"name": "get_runtime_lifecycle_guide",
"arguments": {
"runtime": "xposed"
}
}- 编译前静态校验云端入口和资源风险
{
"name": "validate_cloud_runtime",
"arguments": {
"runtime": "inject",
"dexClassName": "com.example.cloud.Entry",
"dexMethodName": "main",
"files": [
{
"path": "src/com/example/cloud/Entry.java",
"content": "package com.example.cloud;\\npublic final class Entry {\\n public static void main() {}\\n}"
},
{
"path": "src/com/example/cloud/Helper.java",
"content": "package com.example.cloud;\\npublic final class Helper {}"
}
],
"resourceEntries": [
"lib/arm64-v8a/libdemo.so",
"images/logo.png"
],
"requireCardVerification": false
}
}- 模拟
resHook.zip解压后查找libdemo.so
{
"name": "simulate_resource_layout",
"arguments": {
"entries": [
"lib/arm64-v8a/libdemo.so",
"images/logo.png",
"config/app.json"
],
"exactFileNames": ["libdemo.so"],
"containsFileNames": ["logo"]
}
}- 推送前先校验编辑器布局是否完整
{
"name": "validate_cloud_code_layout",
"arguments": {
"files": [
{
"path": "src/com/example/cloud/Entry.java",
"content": "package com.example.cloud;\\npublic final class Entry {\\n public static void main() {}\\n}"
},
{
"path": "src/com/example/cloud/Helper.java",
"content": "package com.example.cloud;\\npublic final class Helper {}"
}
],
"fileTree": {
"name": "root",
"type": "folder",
"path": "",
"children": [
{
"name": "src",
"type": "folder",
"path": "src",
"children": [
{
"name": "com",
"type": "folder",
"path": "src/com",
"children": [
{
"name": "example",
"type": "folder",
"path": "src/com/example",
"children": [
{
"name": "cloud",
"type": "folder",
"path": "src/com/example/cloud",
"children": [
{
"name": "Entry.java",
"type": "file",
"path": "src/com/example/cloud/Entry.java"
},
{
"name": "Helper.java",
"type": "file",
"path": "src/com/example/cloud/Helper.java"
}
]
}
]
}
]
}
]
}
]
},
"currentFilePath": "src/com/example/cloud/Entry.java"
}
}- 通过校验后再推送/发布;如果
fileTree缺失、currentFilePath不命中真实文件,工具会直接拒绝
{
"name": "publish_cloud_code",
"arguments": {
"configId": 39,
"cacheKey": "verify_mcp_example",
"files": [
{
"path": "src/com/example/cloud/Entry.java",
"content": "package com.example.cloud;\\npublic final class Entry {\\n public static void main() {}\\n}"
}
],
"fileTree": {
"name": "root",
"type": "folder",
"path": "",
"children": [
{
"name": "src",
"type": "folder",
"path": "src",
"children": [
{
"name": "com",
"type": "folder",
"path": "src/com",
"children": [
{
"name": "example",
"type": "folder",
"path": "src/com/example",
"children": [
{
"name": "cloud",
"type": "folder",
"path": "src/com/example/cloud",
"children": [
{
"name": "Entry.java",
"type": "file",
"path": "src/com/example/cloud/Entry.java"
}
]
}
]
}
]
}
]
}
]
},
"currentFilePath": "src/com/example/cloud/Entry.java",
"compileSettings": {
"dexClassName": "com.example.cloud.Entry",
"dexMethodName": "main",
"dexMethodParamTypes": []
},
"waitForResult": false
}
}AI 调用建议:
- 写 DEX 代码前,优先查
inject - 写 Xposed 代码前,优先查
xposed - 如果 AI 不确定
InjectHelper.getModuleContext()这类方法是否真实存在,应先调用get_runtime_api_doc,不要只凭补全文案猜测 - 开始迁移旧项目前,优先查
get_runtime_migration_guide - 涉及
main()时序、Activity 可见阶段、native 资源回调时,优先查get_runtime_lifecycle_guide与get_resource_and_native_rules - 编译前先跑
validate_cloud_runtime,比等到运行时再猜问题更稳 - 推送前先跑
validate_cloud_code_layout,确保“能编译”和“能完整拉回编辑器树”同时成立 - 不要只传
files;push_cloud_code/publish_cloud_code现在会把缺失的fileTree、错误的currentFilePath直接判错
MCP 客户端配置示例
以本地 npx 方式为例,客户端配置通常类似:
{
"mcpServers": {
"verify": {
"command": "npx",
"args": [
"-y",
"@ktbtw/verify-mcp"
],
"env": {
"VERIFY_BASE_URL": "https://www.xyapi.top/verfiy",
"VERIFY_API_TOKEN": "vat_xxx_replace_me",
"VERIFY_TIMEOUT_MS": "30000"
}
}
}
}如果你已经把仓库拉到本地,也可以直接指向构建产物:
{
"mcpServers": {
"verify": {
"command": "node",
"args": [
"/Users/yuminghao/Downloads/verfiy/verify_mcp/dist/index.js"
],
"env": {
"VERIFY_BASE_URL": "https://www.xyapi.top/verfiy",
"VERIFY_API_TOKEN": "vat_xxx_replace_me",
"VERIFY_TIMEOUT_MS": "30000"
}
}
}
}