install
source · Clone the upstream repo
git clone https://github.com/jieni777/opencode-config-backup
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/jieni777/opencode-config-backup "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/api-testing" ~/.claude/skills/jieni777-opencode-config-backup-api-testing && rm -rf "$T"
manifest:
skills/api-testing/SKILL.mdsource content
MCP Postman - API测试工具
直接触发指令
当用户请求以下内容时自动激活此技能:
- "测试API"
- "发送HTTP请求"
- "验证API响应"
- "调试接口"
- "检查端点"
- "API集成测试"
功能
在Trae中直接触发API请求并获取响应,自动根据API返回结果修正前端调用逻辑。
使用场景
- 测试REST API端点
- 验证POST请求
- 检查响应状态码
- 调试API集成
- 自动化API测试
使用方法
在Solo模式下直接请求:
Test the GET /api/users endpoint
Send a POST request to /api/users with this JSON payload
Check if the /api/health endpoint returns 200
Run a collection of API tests
工具说明
- api_call: 执行HTTP请求
- get_collection: 获取Postman集合
- run_collection: 运行测试集合
- get_environment: 获取环境变量
⚠️ 必需配置
需要Postman API Key:
- 访问 Postman API Keys 获取Key
- 配置:
trae --add-mcp '{"name":"postman","command":"npx","args":["-y","@postman/mcp-server-postman"],"env":{"POSTMAN_API_KEY":"your-api-key"}}'
使用示例
测试GET请求
GET https://api.example.com/users Accept: application/json
测试POST请求
POST https://api.example.com/users Content-Type: application/json { "name": "John Doe", "email": "john@example.com" }
验证响应
Verify the response status is 200 Verify response contains "id" field
最佳实践
- 使用环境变量管理不同环境的URL
- 保存常用请求为Collection
- 编写测试断言验证响应