Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here
yapi-plugin logo

yapi-plugin

cross-request-marketplace

developmentClaude Codeby leeguooooo

Summary

Use YApi from Claude Code through the local yapi CLI. Inspect interfaces and sync API docs.

Install to Claude Code

/plugin install yapi-plugin@cross-request-marketplace

Run in Claude Code. Add the marketplace first with /plugin marketplace add leeguooooo/cross-request-master if you haven't already.

README.md

Cross Request Master

![GitHub Sponsors](https://github.com/sponsors/leeguooooo) ![License: MIT](https://opensource.org/licenses/MIT) ![Chrome Web Store](https://chrome.google.com/webstore/detail/efgjanhcajpiljllnehiinpmicghbgfm)

面向 API 开发/测试的 Chrome 扩展:绕过 CORS 发请求、自动生成 cURL,并对 YApi「运行」页做增强(内嵌 cURL、路径参数 {param} 引导填写)。

本仓库包含生态内的多个子项目:

  • packages/yapi-mcp — CLI / Skill(发布包名保持为 @leeguoo/yapi-mcp,MCP 配置作为兼容方案保留,不影响扩展打包)
  • plugins/yapi-plugin — Cursor 与 Claude Code 插件(已从原独立仓库 leeguooooo/yapi-plugin 归档并整合回本仓库)

当前推荐安装链路是 npx skills add leeguooooo/cross-request-master -y -g 安装 Skill,再用 yapi config init 初始化 ~/.yapi/config.tomlyapi-mcp 已支持浏览器登录同步 Cookie(yapi login --browser),可用于仅支持 SSO/无法账号密码登录的 YApi 场景。

<p align="center"> <img src="screenshots/store/store-2-yapi-run-curl-1280x800.jpg" alt="YApi 运行页:内嵌 cURL + 路径参数填写" width="960" /> </p> <p align="center"> <img src="screenshots/store/store-3-popup-1280x800.jpg" alt="扩展弹出窗口:状态与问题反馈入口" width="520" /> </p>

功能特性

  • 跨域请求(CORS bypass):在页面侧调用 crossRequest,由扩展后台代发
  • 内嵌 cURL:YApi「运行」页 URL 下方展示可复制的 cURL 命令
  • 路径参数引导:URL 含 {param} 时提示填写,避免请求失败
  • 固定 Header:为跨域请求自动追加自定义 Header
  • YApi 工具箱:Skill 一键安装(推荐,支持 npx skills add)/ Cursor 与 Claude Code 插件(plugins/yapi-plugin/)/ MCP 配置(兼容)/ CLI 使用与 docs-sync
  • 复制给 AI:把当前接口信息整理为 Markdown 一键复制
  • 现代请求支持:优先 fetch / Promise 工作流,兼容历史 $.ajax
  • Manifest V3:兼容最新 Chrome 扩展标准

安装

Chrome Web Store(推荐) https://chrome.google.com/webstore/detail/efgjanhcajpiljllnehiinpmicghbgfm

开发者模式

git clone https://github.com/leeguooooo/cross-request-master.git
cd cross-request-master
./build-extension.sh

然后在 chrome://extensions/ 开启开发者模式 → “加载已解压的扩展程序” → 选择 build/

使用

在 YApi 中

安装后直接在 YApi「运行」页发送请求即可,扩展会自动处理跨域、显示 cURL,并把 JSON 响应解析为对象供脚本使用。

在接口详情页(基本信息区域右上角)额外提供:

  • YApi 工具箱:包含 Skill 一键安装(推荐,支持 Codex/Claude/Cursor 与 npx skills add)、MCP 配置(兼容)、CLI 使用与 docs-sync 说明(自动拼好命令)
  • 复制给 AI:把当前接口信息整理成 Markdown(仅接口相关字段)复制到剪贴板

如果你要在本机直接装好 Skill + CLI,当前最短路径是:

npm install -g @leeguoo/yapi-mcp
npx skills add leeguooooo/cross-request-master -y -g
yapi config init --base-url=https://your-yapi-domain.com --auth-mode=global --email=your_email@example.com
yapi login --base-url=https://your-yapi-domain.com --browser

更完整说明见 packages/yapi-mcp/README.md

ClawHub Skill 同步

  • ClawHub 地址:leeguooooo/yapi
  • 通过项目脚本同步(已接入 clawhub sync --all):
pnpm run clawhub:sync:dry
pnpm run clawhub:sync

YApi OpenAPI(Yapi-MCP tool 同名方法)

扩展在页面侧额外暴露 window.crossRequest.yapiMcp(也可用 window.crossRequest.yapi),把 YApi OpenAPI 封装成与 Yapi-MCP 一致的 5 个方法,方便直接在浏览器控制台/脚本里操作接口文档:

// 先配置(支持多项目:'28:token1,29:token2')
window.crossRequest.yapiMcp.configure({
  baseUrl: 'https://your-yapi-domain.com',
  token: '28:your_project_token'
});

// 查接口、拉分类、搜索、保存
const api = await window.crossRequest.yapiMcp.yapi_get_api_desc({ projectId: '28', apiId: '66' });

在任意网页中手动调用

window.crossRequest({
  url: 'https://api.example.com/data',
  method: 'GET',
  headers: { Authorization: 'Bearer token' },
  success(res) {
    console.log('Success:', res);
  },
  error(err) {
    console.error('Error:', err);
  }
});

crossRequest 也会返回 Promise:

const resp = await window.crossRequest({ url: '/api/ping' });
console.log(resp.status, resp.data);

兼容模式:jQuery(Legacy)

大多数场景建议直接使用 fetch + window.crossRequest。以下仅用于历史页面仍依赖 $.ajax 时:

  • YApi/目标站点:默认拦截所有 $.ajax。如需关闭:crossRequest: false
  • 其他站点:默认不拦截。需显式开启:crossRequest: true
$.ajax({
  url: 'https://api.example.com/data',
  method: 'GET',
  crossRequest: true
});

文件上传(FormData)

const fd = new FormData();
fd.append('file', fileInput.files[0]);
fd.append('name', 'demo');

await window.crossRequest({
  url: 'https://api.example.com/upload',
  method: 'POST',
  body: fd
});

TypeScript 类型定义

仓库内置 types/cross-request.d.ts,可直接复制到你的项目并在 tsconfig.json 中 include,或在 global.d.ts 引用:

/// <reference path="./types/cross-request.d.ts" />

已知限制 / FAQ

  • 自定义 Header 被放到 Access-Control-Request-Headers:这是浏览器 CORS 预检行为,需要服务端正确返回 Access-Control-Allow-Headers
  • Network 面板看不到请求:请求由扩展后台发出,不会出现在页面 Network;可在扩展 Service Worker 的 Network/Console 查看。

开发与测试(本仓库)

项目结构:

manifest.json        MV3 配置
background.js        Service Worker
content-script.js    注入/通信
index.js             页面侧 API 与适配器
popup.html/popup.js  扩展弹出窗口
src/helpers/         可复用 helper
tests/               Jest 单测
skills/yapi/         YApi Skill(canonical;自动同步到 packages/yapi-mcp/skill-template 与 plugins/yapi-plugin/skills)
packages/yapi-mcp/   CLI(@leeguoo/yapi-mcp)与 MCP skill-template
plugins/yapi-plugin/ Cursor 与 Claude Code 插件
docs/                文档(见 docs/README.md)

常用命令:

pnpm install
pnpm test
pnpm lint
pnpm format
./build-extension.sh

贡献与支持

  • 提交 Issue/PR 前请先看 CONTRIBUTING.md
  • 如果项目对你有帮助,欢迎 Star 或赞助:
  • GitHub Sponsors: https://github.com/sponsors/leeguooooo
  • 微信/支付宝赞赏码见下方

赞助开发

如果你觉得这个项目对你有帮助,可以请作者喝杯咖啡:

GitHub Sponsors

![GitHub Sponsors](https://github.com/sponsors/leeguooooo)

微信 / 支付宝

<div align="center"> <img src=".github/wechatpay.JPG" alt="微信赞赏码" width="300"/> <img src=".github/alipay.JPG" alt="支付宝收款码" width="300"/> </div>

更新日志

CHANGELOG.md

许可证

MIT License

相关链接

  • Issues: https://github.com/leeguooooo/cross-request-master/issues
  • YApi: https://github.com/YMFE/yapi
  • Yapi-MCP: https://github.com/leeguooooo/Yapi-MCP
  • YApi OpenAPI 文档: https://hellosean1025.github.io/yapi/openapi.html
  • Chrome Extension Docs: https://developer.chrome.com/docs/extensions/

更多文档

  • 文档总览:docs/README.md
  • 测试指南:docs/TESTING.md
  • 技术路线图:docs/ROADMAP.md
  • YApi 插件(Cursor / Claude Code):docs/yapi-plugin/README.md

---

> Built by leeguooooo — field notes on AI agents, reverse engineering & Cloudflare Workers at blog.misonote.com · follow on X @leeguooooo

Related plugins

Browse all →