Agent skill
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.
Install this agent skill to your Project
npx add-skill https://github.com/tomaspavlin/rohlik-mcp/tree/main/.claude/skills/test-mcp
SKILL.md
Testing MCP Tools
Use this skill whenever you need to:
- Investigate what an API endpoint returns (e.g. before updating a tool's field mappings)
- Verify that tool changes correctly map API response fields
- Debug why a tool returns wrong or missing data
- Test tool changes after implementation
1. Build the project
Run npm run build to compile TypeScript. Fix any compilation errors before proceeding.
2. Call the API directly
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.
3. MCP Inspector (manual testing)
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.
4. Debugging with console.error
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.
5. Unit tests
For logic-only changes (no API calls), run npm test to execute unit tests. Use npm run test:watch during development.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
publish
Publish a new version of the npm package
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
claude-code-expert
Especialista profundo em Claude Code - CLI da Anthropic. Maximiza produtividade com atalhos, hooks, MCPs, configuracoes avancadas, workflows, CLAUDE.md, memoria, sub-agentes, permissoes e integracao com ecossistemas.
lex
Centralized 'Truth Engine' for cross-jurisdictional legal context (US, EU, CA) and contract scaffolding.
odoo-inventory-optimizer
Expert guide for Odoo Inventory: stock valuation (FIFO/AVCO), reordering rules, putaway strategies, routes, and multi-warehouse configuration.
android_ui_verification
Automated end-to-end UI testing and verification on an Android Emulator using ADB.
Didn't find tool you were looking for?