协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
test-mcp【开发与工程】Build and test MCP tools using direct API calls or MCP Inspector. Use when testing tool changes, verifying API responses, debugging MCP tools, or investigating what an API endpoint returns.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill whenever you need to:
Run npm run build to compile TypeScript. Fix any compilation errors before proceeding.
Call API methods directly using Node with the .env file for credentials:
node --env-file=.env --input-type=module -e "
import { RohlikAPI } from './dist/rohlik-api.js';
const api = new RohlikAPI({ username: process.env.ROHLIK_USERNAME, password: process.env.ROHLIK_PASSWORD });
const result = await api.methodName(args);
console.log(JSON.stringify(result, null, 2));
"
Replace methodName and args with the appropriate API method. Check src/rohlik-api.ts for available methods.
This lets you inspect the raw API response shape to understand what fields are available, verify field names, and confirm your tool's output matches the actual data.
If the user wants to test the full MCP tool flow (not just the API), tell them to run npm run inspect in a separate terminal. The Inspector provides a web UI to invoke individual MCP tools with custom arguments.
If the user provides a specific tool name via $ARGUMENTS, suggest they test that tool.
MCP servers communicate over stdout (used for the JSON-RPC protocol), so console.log output is invisible in the Inspector.
Always use console.error for debug logging. It writes to stderr, which is visible in the terminal where the Inspector was launched.
Example:
console.error('[ROHLIK_DEBUG] Response:', JSON.stringify(response, null, 2));
Remember to remove debug logging before committing.
For logic-only changes (no API calls), run npm test to execute unit tests. Use npm run test:watch during development.